isaacscript-common 31.4.0 → 31.6.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.rollup.d.ts +38 -4
- package/dist/isaacscript-common.lua +722 -684
- package/dist/src/classes/ModFeature.d.ts.map +1 -1
- package/dist/src/classes/ModFeature.lua +5 -9
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +8 -14
- package/dist/src/classes/callbacks/PostNewRoomEarly.lua +2 -2
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +3 -3
- package/dist/src/classes/features/other/CharacterHealthConversion.lua +1 -1
- package/dist/src/classes/features/other/CustomItemPools.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomItemPools.lua +12 -6
- package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomStages.lua +12 -14
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +6 -8
- package/dist/src/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
- package/dist/src/classes/features/other/DeployJSONRoom.lua +15 -15
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +21 -12
- package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
- package/dist/src/classes/features/other/Pause.lua +4 -6
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +5 -9
- package/dist/src/classes/features/other/customStages/backdrop.lua +9 -10
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayDoor.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayDoor.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPit.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPit.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPoop.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPoop.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayRock.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayRock.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySlot.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySlot.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySpikes.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySpikes.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTNT.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTNT.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.lua +2 -1
- package/dist/src/classes/features/other/debugDisplay/utils.d.ts +0 -1
- package/dist/src/classes/features/other/debugDisplay/utils.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/utils.lua +0 -17
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +1 -1
- package/dist/src/functions/array.d.ts +3 -0
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +9 -3
- package/dist/src/functions/bitSet128.d.ts.map +1 -1
- package/dist/src/functions/bitSet128.lua +4 -6
- package/dist/src/functions/bitwise.d.ts.map +1 -1
- package/dist/src/functions/bitwise.lua +7 -3
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/color.lua +5 -9
- package/dist/src/functions/deepCopy.lua +23 -31
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +20 -18
- package/dist/src/functions/entitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/entitiesSpecific.lua +11 -27
- package/dist/src/functions/enums.d.ts +6 -4
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +13 -9
- package/dist/src/functions/gridEntities.d.ts.map +1 -1
- package/dist/src/functions/gridEntities.lua +18 -11
- package/dist/src/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/gridEntitiesSpecific.lua +16 -28
- package/dist/src/functions/input.d.ts +3 -0
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +14 -14
- package/dist/src/functions/jsonRoom.d.ts.map +1 -1
- package/dist/src/functions/jsonRoom.lua +35 -23
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/kColor.lua +6 -12
- package/dist/src/functions/map.d.ts.map +1 -1
- package/dist/src/functions/map.lua +3 -3
- package/dist/src/functions/minimap.d.ts.map +1 -1
- package/dist/src/functions/minimap.lua +17 -9
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +17 -22
- package/dist/src/functions/render.d.ts +16 -0
- package/dist/src/functions/render.d.ts.map +1 -0
- package/dist/src/functions/render.lua +50 -0
- package/dist/src/functions/rng.d.ts.map +1 -1
- package/dist/src/functions/rng.lua +3 -3
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -1
- package/dist/src/functions/roomShapeWalls.lua +7 -3
- package/dist/src/functions/roomTransition.d.ts.map +1 -1
- package/dist/src/functions/roomTransition.lua +7 -3
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +8 -5
- package/dist/src/functions/serialization.d.ts.map +1 -1
- package/dist/src/functions/serialization.lua +8 -18
- package/dist/src/functions/table.d.ts.map +1 -1
- package/dist/src/functions/table.lua +6 -12
- package/dist/src/functions/tstlClass.d.ts.map +1 -1
- package/dist/src/functions/tstlClass.lua +3 -3
- package/dist/src/functions/utils.d.ts +9 -10
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +14 -22
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +4 -6
- package/dist/src/functions/weighted.d.ts.map +1 -1
- package/dist/src/functions/weighted.lua +7 -3
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/dist/src/sets/bossSets.d.ts.map +1 -1
- package/dist/src/sets/bossSets.lua +3 -3
- package/dist/src/types/Expand.d.ts +8 -0
- package/dist/src/types/Expand.d.ts.map +1 -0
- package/dist/src/types/Expand.lua +2 -0
- package/package.json +2 -2
- package/src/classes/ModFeature.ts +16 -12
- package/src/classes/ModUpgraded.ts +18 -16
- package/src/classes/callbacks/PostNewRoomEarly.ts +2 -2
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +2 -3
- package/src/classes/features/other/CharacterHealthConversion.ts +1 -1
- package/src/classes/features/other/CustomItemPools.ts +9 -8
- package/src/classes/features/other/CustomStages.ts +9 -10
- package/src/classes/features/other/CustomTrapdoors.ts +9 -10
- package/src/classes/features/other/DeployJSONRoom.ts +21 -21
- package/src/classes/features/other/ModdedElementSets.ts +18 -21
- package/src/classes/features/other/Pause.ts +9 -6
- package/src/classes/features/other/SaveDataManager.ts +14 -16
- package/src/classes/features/other/customStages/backdrop.ts +5 -6
- package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayDoor.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPit.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPoop.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayRock.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplaySlot.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplaySpikes.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayTNT.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +2 -1
- package/src/classes/features/other/debugDisplay/utils.ts +0 -13
- package/src/classes/features/other/saveDataManager/restoreDefaults.ts +1 -1
- package/src/functions/array.ts +8 -6
- package/src/functions/bitSet128.ts +9 -10
- package/src/functions/bitwise.ts +6 -3
- package/src/functions/color.ts +13 -15
- package/src/functions/deepCopy.ts +18 -24
- package/src/functions/deepCopyTests.ts +5 -6
- package/src/functions/entities.ts +22 -20
- package/src/functions/entitiesSpecific.ts +10 -27
- package/src/functions/enums.ts +29 -17
- package/src/functions/gridEntities.ts +14 -16
- package/src/functions/gridEntitiesSpecific.ts +15 -28
- package/src/functions/input.ts +3 -3
- package/src/functions/jsonRoom.ts +39 -27
- package/src/functions/kColor.ts +17 -20
- package/src/functions/map.ts +5 -5
- package/src/functions/minimap.ts +16 -15
- package/src/functions/players.ts +7 -10
- package/src/functions/render.ts +53 -0
- package/src/functions/rng.ts +5 -5
- package/src/functions/roomShapeWalls.ts +3 -4
- package/src/functions/roomTransition.ts +5 -5
- package/src/functions/rooms.ts +5 -6
- package/src/functions/serialization.ts +25 -30
- package/src/functions/table.ts +18 -20
- package/src/functions/tstlClass.ts +5 -5
- package/src/functions/utils.ts +27 -23
- package/src/functions/vector.ts +9 -10
- package/src/functions/weighted.ts +5 -5
- package/src/index.ts +2 -0
- package/src/sets/bossSets.ts +5 -5
- package/src/types/Expand.ts +5 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1194,6 +1194,16 @@ export declare function asPillEffect(num: number): PillEffect;
|
|
|
1194
1194
|
*/
|
|
1195
1195
|
export declare function asPlayerType(num: number): PlayerType;
|
|
1196
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* Helper function to throw an error (using the `error` Lua function) if the provided value is equal
|
|
1199
|
+
* to `undefined`.
|
|
1200
|
+
*
|
|
1201
|
+
* This is useful to have TypeScript narrow a `T | undefined` value to `T` in a concise way.
|
|
1202
|
+
*/
|
|
1203
|
+
export declare function assertDefined<T>(value: T, ...[msg]: [undefined] extends [T] ? [string] : [
|
|
1204
|
+
"The assertion is useless because the provided value does not contain undefined."
|
|
1205
|
+
]): asserts value is Exclude<T, undefined>;
|
|
1206
|
+
|
|
1197
1207
|
/**
|
|
1198
1208
|
* Helper function to safely cast an enum to a `string`. (This is better than using the `as`
|
|
1199
1209
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
@@ -4118,6 +4128,14 @@ declare class EsauJrDetection extends Feature {
|
|
|
4118
4128
|
*/
|
|
4119
4129
|
export declare function every<T>(array: T[], func: (value: T, index: number, array: T[]) => boolean): boolean;
|
|
4120
4130
|
|
|
4131
|
+
/**
|
|
4132
|
+
* From:
|
|
4133
|
+
* https://stackoverflow.com/questions/57683303/how-can-i-see-the-full-expanded-contract-of-a-typescript-type
|
|
4134
|
+
*/
|
|
4135
|
+
export declare type Expand<T> = T extends infer O ? {
|
|
4136
|
+
[K in keyof O]: O[K];
|
|
4137
|
+
} : never;
|
|
4138
|
+
|
|
4121
4139
|
declare class ExtraConsoleCommands extends Feature {
|
|
4122
4140
|
private readonly commandFunctionMap;
|
|
4123
4141
|
private readonly postUpdate;
|
|
@@ -5255,10 +5273,10 @@ export declare function getEnumEntries<T>(transpiledEnum: T): Array<[key: string
|
|
|
5255
5273
|
* For a more in depth explanation, see:
|
|
5256
5274
|
* https://isaacscript.github.io/main/gotchas#iterating-over-enums
|
|
5257
5275
|
*/
|
|
5258
|
-
export declare function getEnumKeys
|
|
5276
|
+
export declare function getEnumKeys(transpiledEnum: Record<string | number, string | number>): string[];
|
|
5259
5277
|
|
|
5260
5278
|
/** Helper function to get the amount of entries inside of an enum. */
|
|
5261
|
-
export declare function getEnumLength
|
|
5279
|
+
export declare function getEnumLength(transpiledEnum: Record<string | number, string | number>): int;
|
|
5262
5280
|
|
|
5263
5281
|
/**
|
|
5264
5282
|
* TypeScriptToLua will transpile TypeScript enums to Lua tables that have a double mapping. Thus,
|
|
@@ -5478,8 +5496,8 @@ export declare function getHeartsUIWidth(): int;
|
|
|
5478
5496
|
/**
|
|
5479
5497
|
* Helper function to get the enum value with the highest value.
|
|
5480
5498
|
*
|
|
5481
|
-
* Note that this is not necessarily the enum value that is declared last, since there
|
|
5482
|
-
* infer that at run-time.
|
|
5499
|
+
* Note that this is not necessarily the enum value that is declared last in the code, since there
|
|
5500
|
+
* is no way to infer that at run-time.
|
|
5483
5501
|
*/
|
|
5484
5502
|
export declare function getHighestEnumValue<T>(transpiledEnum: T): T[keyof T];
|
|
5485
5503
|
|
|
@@ -5620,6 +5638,9 @@ export declare function getLasers(laserVariant?: LaserVariant | -1, subType?: nu
|
|
|
5620
5638
|
* Helper function to return the last element of an array.
|
|
5621
5639
|
*
|
|
5622
5640
|
* If the array is empty, this will return undefined.
|
|
5641
|
+
*
|
|
5642
|
+
* (Note that TSTL does not support `Array.at(-1)`, which would make this helper function largely
|
|
5643
|
+
* unnecessary.)
|
|
5623
5644
|
*/
|
|
5624
5645
|
export declare function getLastElement<T>(array: T[]): T | undefined;
|
|
5625
5646
|
|
|
@@ -8273,6 +8294,9 @@ export declare function isEntity(variable: unknown): variable is Entity;
|
|
|
8273
8294
|
*/
|
|
8274
8295
|
export declare function isEntityMoving(entity: Entity, threshold?: number): boolean;
|
|
8275
8296
|
|
|
8297
|
+
/** Helper function to validate that a particular value exists inside of an enum. */
|
|
8298
|
+
export declare function isEnumValue(value: number | string, transpiledEnum: Record<string | number, string | number>): boolean;
|
|
8299
|
+
|
|
8276
8300
|
export declare function isEven(num: int): boolean;
|
|
8277
8301
|
|
|
8278
8302
|
/** Helper function to detect if a variable is of type `EntityFamiliar`. */
|
|
@@ -13045,6 +13069,8 @@ export declare class ModFeature {
|
|
|
13045
13069
|
uninit(): void;
|
|
13046
13070
|
}
|
|
13047
13071
|
|
|
13072
|
+
export declare const MODIFIER_KEYS: readonly [Keyboard.LEFT_SHIFT, Keyboard.LEFT_CONTROL, Keyboard.LEFT_ALT, Keyboard.LEFT_SUPER, Keyboard.RIGHT_SHIFT, Keyboard.RIGHT_CONTROL, Keyboard.RIGHT_ALT, Keyboard.RIGHT_SUPER];
|
|
13073
|
+
|
|
13048
13074
|
/**
|
|
13049
13075
|
* `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
|
|
13050
13076
|
* hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
|
|
@@ -13138,6 +13164,8 @@ export declare class ModUpgraded implements Mod {
|
|
|
13138
13164
|
*/
|
|
13139
13165
|
declare type ModUpgradedWithFeatures<T extends readonly ISCFeature[] = []> = ModUpgraded & ISCFeaturesToKeys<T>;
|
|
13140
13166
|
|
|
13167
|
+
export declare const MOVEMENT_ACTIONS: readonly [ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN];
|
|
13168
|
+
|
|
13141
13169
|
export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
13142
13170
|
|
|
13143
13171
|
/**
|
|
@@ -14879,6 +14907,10 @@ export declare const RENDER_FRAMES_PER_SECOND = 60;
|
|
|
14879
14907
|
*/
|
|
14880
14908
|
export declare function renderChargeBar(sprites: ChargeBarSprites, position: Vector, normalCharges: int, batteryCharges: int): void;
|
|
14881
14909
|
|
|
14910
|
+
export declare function renderScaledTextOnEntity(entity: Entity | GridEntity, text: string, scaleX: float, scaleY: float): void;
|
|
14911
|
+
|
|
14912
|
+
export declare function renderTextOnEntity(entity: Entity | GridEntity, text: string): void;
|
|
14913
|
+
|
|
14882
14914
|
/**
|
|
14883
14915
|
* Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
|
|
14884
14916
|
*
|
|
@@ -15992,6 +16024,8 @@ export declare function setUnseeded(): void;
|
|
|
15992
16024
|
*/
|
|
15993
16025
|
export declare const sfxManager: SFXManager;
|
|
15994
16026
|
|
|
16027
|
+
export declare const SHOOTING_ACTIONS: readonly [ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN];
|
|
16028
|
+
|
|
15995
16029
|
export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
15996
16030
|
|
|
15997
16031
|
declare function shouldFireCollectibleType(fireArgs: [player: EntityPlayer, collectibleType: CollectibleType], optionalArgs: [collectibleType?: CollectibleType]): boolean;
|