isaacscript-common 17.4.3 → 17.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.d.ts +35 -8
- package/dist/isaacscript-common.lua +39 -21
- package/dist/src/callbacks.d.ts +1 -1
- package/dist/src/classes/features/other/customStages/backdrop.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/shadows.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/versusScreen.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/versusScreen.lua +6 -10
- package/dist/src/functions/input.d.ts +32 -7
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +49 -8
- package/dist/src/functions/roomShape.lua +0 -2
- package/dist/src/objects/LRoomShapeToRectangles.d.ts +5 -5
- package/dist/src/objects/LRoomShapeToRectangles.d.ts.map +1 -1
- package/dist/src/objects/backdropTypeToRockAltType.d.ts +60 -2
- package/dist/src/objects/backdropTypeToRockAltType.d.ts.map +1 -1
- package/dist/src/objects/bossNamePNGFileNames.d.ts +101 -2
- package/dist/src/objects/bossNamePNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/bossPortraitPNGFileNames.d.ts +101 -2
- package/dist/src/objects/bossPortraitPNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/cardDescriptions.d.ts +98 -2
- package/dist/src/objects/cardDescriptions.d.ts.map +1 -1
- package/dist/src/objects/cardNames.d.ts +98 -2
- package/dist/src/objects/cardNames.d.ts.map +1 -1
- package/dist/src/objects/challengeNames.d.ts +46 -2
- package/dist/src/objects/challengeNames.d.ts.map +1 -1
- package/dist/src/objects/characterDamageMultipliers.d.ts +42 -2
- package/dist/src/objects/characterDamageMultipliers.d.ts.map +1 -1
- package/dist/src/objects/characterNames.d.ts +42 -2
- package/dist/src/objects/characterNames.d.ts.map +1 -1
- package/dist/src/objects/coinSubTypeToValue.d.ts +8 -2
- package/dist/src/objects/coinSubTypeToValue.d.ts.map +1 -1
- package/dist/src/objects/directionNames.d.ts +5 -2
- package/dist/src/objects/directionNames.d.ts.map +1 -1
- package/dist/src/objects/directionToDegrees.d.ts +5 -2
- package/dist/src/objects/directionToDegrees.d.ts.map +1 -1
- package/dist/src/objects/directionToVector.d.ts +1 -1
- package/dist/src/objects/directionToVector.d.ts.map +1 -1
- package/dist/src/objects/doorSlotFlagToDoorSlot.d.ts +2 -2
- package/dist/src/objects/doorSlotFlagToDoorSlot.d.ts.map +1 -1
- package/dist/src/objects/doorSlotToDirection.d.ts +10 -2
- package/dist/src/objects/doorSlotToDirection.d.ts.map +1 -1
- package/dist/src/objects/doorSlotToDoorSlotFlag.d.ts +45 -2
- package/dist/src/objects/doorSlotToDoorSlotFlag.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +5 -2
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts +1 -1
- package/dist/src/objects/languageNames.d.ts +7 -2
- package/dist/src/objects/languageNames.d.ts.map +1 -1
- package/dist/src/objects/oppositeDoorSlots.d.ts +9 -1
- package/dist/src/objects/oppositeDoorSlots.d.ts.map +1 -1
- package/dist/src/objects/pillEffectClasses.d.ts +51 -2
- package/dist/src/objects/pillEffectClasses.d.ts.map +1 -1
- package/dist/src/objects/pillEffectNames.d.ts +50 -2
- package/dist/src/objects/pillEffectNames.d.ts.map +1 -1
- package/dist/src/objects/pillEffectTypes.d.ts +51 -2
- package/dist/src/objects/pillEffectTypes.d.ts.map +1 -1
- package/dist/src/objects/playerNamePNGFileNames.d.ts +42 -2
- package/dist/src/objects/playerNamePNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/playerPortraitPNGFileNames.d.ts +42 -2
- package/dist/src/objects/playerPortraitPNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/roomShapeBounds.d.ts +1 -1
- package/dist/src/objects/roomShapeBounds.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts.map +1 -1
- package/dist/src/objects/roomShapeLayoutSizes.d.ts +1 -1
- package/dist/src/objects/roomShapeLayoutSizes.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToBottomRightPosition.d.ts +1 -1
- package/dist/src/objects/roomShapeToBottomRightPosition.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts +1 -1
- package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlots.d.ts +1 -1
- package/dist/src/objects/roomShapeToDoorSlots.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlotsToGridIndexDelta.d.ts +1 -1
- package/dist/src/objects/roomShapeToDoorSlotsToGridIndexDelta.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToGridWidth.d.ts +12 -2
- package/dist/src/objects/roomShapeToGridWidth.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToTopLeftPosition.d.ts +1 -1
- package/dist/src/objects/roomShapeToTopLeftPosition.d.ts.map +1 -1
- package/dist/src/objects/roomShapeVolumes.d.ts +12 -2
- package/dist/src/objects/roomShapeVolumes.d.ts.map +1 -1
- package/dist/src/objects/roomTypeGotoPrefixes.d.ts +29 -2
- package/dist/src/objects/roomTypeGotoPrefixes.d.ts.map +1 -1
- package/dist/src/objects/roomTypeNames.d.ts +29 -2
- package/dist/src/objects/roomTypeNames.d.ts.map +1 -1
- package/dist/src/objects/stageTypeSuffixes.d.ts +6 -2
- package/dist/src/objects/stageTypeSuffixes.d.ts.map +1 -1
- package/dist/src/objects/stageTypeToLetter.d.ts +6 -2
- package/dist/src/objects/stageTypeToLetter.d.ts.map +1 -1
- package/dist/src/objects/transformationNames.d.ts +14 -2
- package/dist/src/objects/transformationNames.d.ts.map +1 -1
- package/dist/src/objects/versusScreenBackgroundColors.d.ts +1 -1
- package/dist/src/objects/versusScreenBackgroundColors.d.ts.map +1 -1
- package/dist/src/objects/versusScreenDirtSpotColors.d.ts +1 -1
- package/dist/src/objects/versusScreenDirtSpotColors.d.ts.map +1 -1
- package/dist/src/types/HasAllEnumKeys.d.ts +2 -2
- package/package.json +1 -1
- package/src/callbacks.ts +2 -2
- package/src/classes/features/other/customStages/backdrop.ts +4 -5
- package/src/classes/features/other/customStages/shadows.ts +3 -4
- package/src/classes/features/other/customStages/streakText.ts +3 -4
- package/src/classes/features/other/customStages/versusScreen.ts +4 -12
- package/src/functions/input.ts +51 -8
- package/src/objects/LRoomShapeToRectangles.ts +8 -6
- package/src/objects/backdropTypeToRockAltType.ts +3 -4
- package/src/objects/bossNamePNGFileNames.ts +3 -4
- package/src/objects/bossPortraitPNGFileNames.ts +3 -4
- package/src/objects/cardDescriptions.ts +3 -2
- package/src/objects/cardNames.ts +3 -2
- package/src/objects/challengeNames.ts +3 -2
- package/src/objects/characterDamageMultipliers.ts +3 -4
- package/src/objects/characterNames.ts +3 -2
- package/src/objects/coinSubTypeToValue.ts +3 -2
- package/src/objects/directionNames.ts +3 -4
- package/src/objects/directionToDegrees.ts +3 -4
- package/src/objects/directionToVector.ts +3 -1
- package/src/objects/doorSlotFlagToDoorSlot.ts +3 -4
- package/src/objects/doorSlotToDirection.ts +12 -12
- package/src/objects/doorSlotToDoorSlotFlag.ts +3 -4
- package/src/objects/isaacAPIClassTypeToBrand.ts +6 -4
- package/src/objects/isaacAPIClassTypeToFunctions.ts +3 -3
- package/src/objects/languageNames.ts +3 -4
- package/src/objects/oppositeDoorSlots.ts +3 -4
- package/src/objects/pillEffectClasses.ts +3 -4
- package/src/objects/pillEffectNames.ts +3 -2
- package/src/objects/pillEffectTypes.ts +3 -4
- package/src/objects/playerNamePNGFileNames.ts +3 -4
- package/src/objects/playerPortraitPNGFileNames.ts +3 -4
- package/src/objects/roomShapeBounds.ts +3 -1
- package/src/objects/roomShapeCorners.ts +3 -1
- package/src/objects/roomShapeLayoutSizes.ts +3 -1
- package/src/objects/roomShapeToBottomRightPosition.ts +8 -3
- package/src/objects/roomShapeToDoorSlotCoordinates.ts +3 -1
- package/src/objects/roomShapeToDoorSlots.ts +3 -1
- package/src/objects/roomShapeToDoorSlotsToGridIndexDelta.ts +3 -1
- package/src/objects/roomShapeToGridWidth.ts +3 -4
- package/src/objects/roomShapeToTopLeftPosition.ts +5 -3
- package/src/objects/roomShapeVolumes.ts +3 -4
- package/src/objects/roomTypeGotoPrefixes.ts +3 -4
- package/src/objects/roomTypeNames.ts +3 -2
- package/src/objects/stageTypeSuffixes.ts +3 -4
- package/src/objects/stageTypeToLetter.ts +3 -2
- package/src/objects/transformationNames.ts +3 -2
- package/src/objects/versusScreenBackgroundColors.ts +4 -2
- package/src/objects/versusScreenDirtSpotColors.ts +4 -2
- package/src/types/HasAllEnumKeys.ts +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Direction, DoorSlot } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const DOOR_SLOT_TO_DIRECTION
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} as const;
|
|
4
|
+
export const DOOR_SLOT_TO_DIRECTION = {
|
|
5
|
+
[DoorSlot.NO_DOOR_SLOT]: Direction.NO_DIRECTION, // -1
|
|
6
|
+
[DoorSlot.LEFT_0]: Direction.LEFT, // 0
|
|
7
|
+
[DoorSlot.UP_0]: Direction.UP, // 1
|
|
8
|
+
[DoorSlot.RIGHT_0]: Direction.RIGHT, // 2
|
|
9
|
+
[DoorSlot.DOWN_0]: Direction.DOWN, // 3
|
|
10
|
+
[DoorSlot.LEFT_1]: Direction.LEFT, // 4
|
|
11
|
+
[DoorSlot.UP_1]: Direction.UP, // 5
|
|
12
|
+
[DoorSlot.RIGHT_1]: Direction.RIGHT, // 6
|
|
13
|
+
[DoorSlot.DOWN_1]: Direction.DOWN, // 7
|
|
14
|
+
} as const satisfies HasAllEnumKeys<DoorSlot, Direction>;
|
|
@@ -3,10 +3,9 @@ import {
|
|
|
3
3
|
DoorSlotFlag,
|
|
4
4
|
DoorSlotFlagZero,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
6
7
|
|
|
7
|
-
export const DOOR_SLOT_TO_DOOR_SLOT_FLAG
|
|
8
|
-
readonly [key in DoorSlot]: DoorSlotFlag;
|
|
9
|
-
} = {
|
|
8
|
+
export const DOOR_SLOT_TO_DOOR_SLOT_FLAG = {
|
|
10
9
|
[DoorSlot.NO_DOOR_SLOT]: DoorSlotFlagZero, // -1
|
|
11
10
|
[DoorSlot.LEFT_0]: DoorSlotFlag.LEFT_0, // 0
|
|
12
11
|
[DoorSlot.UP_0]: DoorSlotFlag.UP_0, // 1
|
|
@@ -16,4 +15,4 @@ export const DOOR_SLOT_TO_DOOR_SLOT_FLAG: {
|
|
|
16
15
|
[DoorSlot.UP_1]: DoorSlotFlag.UP_1, // 5
|
|
17
16
|
[DoorSlot.RIGHT_1]: DoorSlotFlag.RIGHT_1, // 6
|
|
18
17
|
[DoorSlot.DOWN_1]: DoorSlotFlag.DOWN_1, // 7
|
|
19
|
-
} as const
|
|
18
|
+
} as const satisfies HasAllEnumKeys<DoorSlot, DoorSlotFlag>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { CopyableIsaacAPIClassType } from "isaac-typescript-definitions";
|
|
2
2
|
import { SerializationBrand } from "../enums/SerializationBrand";
|
|
3
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
3
4
|
|
|
4
|
-
export const ISAAC_API_CLASS_TYPE_TO_BRAND
|
|
5
|
-
readonly [key in CopyableIsaacAPIClassType]: SerializationBrand;
|
|
6
|
-
} = {
|
|
5
|
+
export const ISAAC_API_CLASS_TYPE_TO_BRAND = {
|
|
7
6
|
[CopyableIsaacAPIClassType.BIT_SET_128]: SerializationBrand.BIT_SET_128,
|
|
8
7
|
[CopyableIsaacAPIClassType.COLOR]: SerializationBrand.COLOR,
|
|
9
8
|
[CopyableIsaacAPIClassType.K_COLOR]: SerializationBrand.K_COLOR,
|
|
10
9
|
[CopyableIsaacAPIClassType.RNG]: SerializationBrand.RNG,
|
|
11
10
|
[CopyableIsaacAPIClassType.VECTOR]: SerializationBrand.VECTOR,
|
|
12
|
-
} as const
|
|
11
|
+
} as const satisfies HasAllEnumKeys<
|
|
12
|
+
CopyableIsaacAPIClassType,
|
|
13
|
+
SerializationBrand
|
|
14
|
+
>;
|
|
@@ -81,9 +81,9 @@ export interface IsaacAPIClassTypeFunctions<T, SerializedT> {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export const ISAAC_API_CLASS_TYPE_TO_FUNCTIONS: {
|
|
84
|
-
readonly [
|
|
85
|
-
IsaacAPIClassTypeToType[
|
|
86
|
-
IsaacAPIClassTypeToSerializedType[
|
|
84
|
+
readonly [Key in CopyableIsaacAPIClassType]: IsaacAPIClassTypeFunctions<
|
|
85
|
+
IsaacAPIClassTypeToType[Key],
|
|
86
|
+
IsaacAPIClassTypeToSerializedType[Key]
|
|
87
87
|
>;
|
|
88
88
|
} = {
|
|
89
89
|
[CopyableIsaacAPIClassType.BIT_SET_128]: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LanguageAbbreviation } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const LANGUAGE_NAMES
|
|
4
|
-
readonly [key in LanguageAbbreviation]: string;
|
|
5
|
-
} = {
|
|
4
|
+
export const LANGUAGE_NAMES = {
|
|
6
5
|
[LanguageAbbreviation.ENGLISH]: "English",
|
|
7
6
|
[LanguageAbbreviation.JAPANESE]: "Japanese",
|
|
8
7
|
[LanguageAbbreviation.KOREAN]: "Korean",
|
|
@@ -10,4 +9,4 @@ export const LANGUAGE_NAMES: {
|
|
|
10
9
|
[LanguageAbbreviation.RUSSIAN]: "Russian",
|
|
11
10
|
[LanguageAbbreviation.GERMAN]: "German",
|
|
12
11
|
[LanguageAbbreviation.SPANISH]: "Spanish",
|
|
13
|
-
} as const
|
|
12
|
+
} as const satisfies HasAllEnumKeys<LanguageAbbreviation, string>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DoorSlot } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const OPPOSITE_DOOR_SLOTS
|
|
4
|
-
readonly [key in DoorSlot]: DoorSlot | undefined;
|
|
5
|
-
} = {
|
|
4
|
+
export const OPPOSITE_DOOR_SLOTS = {
|
|
6
5
|
[DoorSlot.NO_DOOR_SLOT]: undefined, // -1
|
|
7
6
|
[DoorSlot.LEFT_0]: DoorSlot.RIGHT_0, // 0
|
|
8
7
|
[DoorSlot.UP_0]: DoorSlot.DOWN_0, // 1
|
|
@@ -12,4 +11,4 @@ export const OPPOSITE_DOOR_SLOTS: {
|
|
|
12
11
|
[DoorSlot.UP_1]: DoorSlot.DOWN_1, // 5
|
|
13
12
|
[DoorSlot.RIGHT_1]: DoorSlot.LEFT_1, // 6
|
|
14
13
|
[DoorSlot.DOWN_1]: DoorSlot.UP_1, // 7
|
|
15
|
-
} as const
|
|
14
|
+
} as const satisfies HasAllEnumKeys<DoorSlot, DoorSlot | undefined>;
|
|
@@ -2,12 +2,11 @@ import {
|
|
|
2
2
|
ItemConfigPillEffectClass,
|
|
3
3
|
PillEffect,
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
5
6
|
|
|
6
7
|
export const DEFAULT_PILL_EFFECT_CLASS = ItemConfigPillEffectClass.MODDED;
|
|
7
8
|
|
|
8
|
-
export const PILL_EFFECT_CLASSES
|
|
9
|
-
readonly [key in PillEffect]: ItemConfigPillEffectClass;
|
|
10
|
-
} = {
|
|
9
|
+
export const PILL_EFFECT_CLASSES = {
|
|
11
10
|
[PillEffect.BAD_GAS]: ItemConfigPillEffectClass.MINOR,
|
|
12
11
|
[PillEffect.BAD_TRIP]: ItemConfigPillEffectClass.MEDIUM,
|
|
13
12
|
[PillEffect.BALLS_OF_STEEL]: ItemConfigPillEffectClass.MEDIUM,
|
|
@@ -60,4 +59,4 @@ export const PILL_EFFECT_CLASSES: {
|
|
|
60
59
|
[PillEffect.SHOT_SPEED_UP]: ItemConfigPillEffectClass.MAJOR,
|
|
61
60
|
[PillEffect.EXPERIMENTAL]: ItemConfigPillEffectClass.MAJOR,
|
|
62
61
|
[PillEffect.EXPERIMENTAL]: ItemConfigPillEffectClass.MAJOR,
|
|
63
|
-
} as const
|
|
62
|
+
} as const satisfies HasAllEnumKeys<PillEffect, ItemConfigPillEffectClass>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PillEffect } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_PILL_EFFECT_NAME = "Unknown";
|
|
4
5
|
|
|
5
|
-
export const PILL_EFFECT_NAMES
|
|
6
|
+
export const PILL_EFFECT_NAMES = {
|
|
6
7
|
[PillEffect.BAD_GAS]: "Bad Gas",
|
|
7
8
|
[PillEffect.BAD_TRIP]: "Bad Trip",
|
|
8
9
|
[PillEffect.BALLS_OF_STEEL]: "Balls of Steel",
|
|
@@ -54,4 +55,4 @@ export const PILL_EFFECT_NAMES: { readonly [key in PillEffect]: string } = {
|
|
|
54
55
|
[PillEffect.SHOT_SPEED_DOWN]: "Shot Speed Down",
|
|
55
56
|
[PillEffect.SHOT_SPEED_UP]: "Shot Speed Up",
|
|
56
57
|
[PillEffect.EXPERIMENTAL]: "Experimental Pill",
|
|
57
|
-
} as const
|
|
58
|
+
} as const satisfies HasAllEnumKeys<PillEffect, string>;
|
|
@@ -2,12 +2,11 @@ import {
|
|
|
2
2
|
ItemConfigPillEffectType,
|
|
3
3
|
PillEffect,
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
5
6
|
|
|
6
7
|
export const DEFAULT_PILL_EFFECT_TYPE = ItemConfigPillEffectType.MODDED;
|
|
7
8
|
|
|
8
|
-
export const PILL_EFFECT_TYPES
|
|
9
|
-
readonly [key in PillEffect]: ItemConfigPillEffectType;
|
|
10
|
-
} = {
|
|
9
|
+
export const PILL_EFFECT_TYPES = {
|
|
11
10
|
[PillEffect.BAD_GAS]: ItemConfigPillEffectType.POSITIVE,
|
|
12
11
|
[PillEffect.BAD_TRIP]: ItemConfigPillEffectType.NEGATIVE,
|
|
13
12
|
[PillEffect.BALLS_OF_STEEL]: ItemConfigPillEffectType.POSITIVE,
|
|
@@ -59,4 +58,4 @@ export const PILL_EFFECT_TYPES: {
|
|
|
59
58
|
[PillEffect.SHOT_SPEED_DOWN]: ItemConfigPillEffectType.NEGATIVE,
|
|
60
59
|
[PillEffect.SHOT_SPEED_UP]: ItemConfigPillEffectType.POSITIVE,
|
|
61
60
|
[PillEffect.EXPERIMENTAL]: ItemConfigPillEffectType.NEUTRAL,
|
|
62
|
-
} as const
|
|
61
|
+
} as const satisfies HasAllEnumKeys<PillEffect, ItemConfigPillEffectType>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// cspell:disable
|
|
2
2
|
|
|
3
3
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
4
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
4
5
|
|
|
5
6
|
/** Used when rendering the "versusscreen.anm2" sprite. */
|
|
6
|
-
export const PLAYER_NAME_PNG_FILE_NAMES
|
|
7
|
-
readonly [key in PlayerType]: string | undefined;
|
|
8
|
-
} = {
|
|
7
|
+
export const PLAYER_NAME_PNG_FILE_NAMES = {
|
|
9
8
|
[PlayerType.POSSESSOR]: undefined, // -1
|
|
10
9
|
[PlayerType.ISAAC]: "playername_01_isaac.png", // 0
|
|
11
10
|
[PlayerType.MAGDALENE]: "playername_02_magdalene.png", // 1
|
|
@@ -55,4 +54,4 @@ export const PLAYER_NAME_PNG_FILE_NAMES: {
|
|
|
55
54
|
[PlayerType.JACOB_2_B]: "playername_02x_jacob.png", // 39
|
|
56
55
|
// Tainted The Soul uses the same name as Tainted Forgotten.
|
|
57
56
|
[PlayerType.SOUL_B]: "playername_16_theforgotten.png", // 40
|
|
58
|
-
} as const
|
|
57
|
+
} as const satisfies HasAllEnumKeys<PlayerType, string | undefined>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// cspell:disable
|
|
2
2
|
|
|
3
3
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
4
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
4
5
|
|
|
5
6
|
/** Used when rendering the "versusscreen.anm2" sprite. */
|
|
6
|
-
export const PLAYER_PORTRAIT_PNG_FILE_NAMES
|
|
7
|
-
readonly [key in PlayerType]: string | undefined;
|
|
8
|
-
} = {
|
|
7
|
+
export const PLAYER_PORTRAIT_PNG_FILE_NAMES = {
|
|
9
8
|
[PlayerType.POSSESSOR]: undefined, // -1
|
|
10
9
|
[PlayerType.ISAAC]: "playerportrait_isaac.png", // 0
|
|
11
10
|
[PlayerType.MAGDALENE]: "playerportrait_magdalene.png", // 1
|
|
@@ -52,4 +51,4 @@ export const PLAYER_PORTRAIT_PNG_FILE_NAMES: {
|
|
|
52
51
|
[PlayerType.JACOB_2_B]: "playerportrait_jacob_b.png", // 39
|
|
53
52
|
// Tainted The Soul uses the same name as Tainted Forgotten.
|
|
54
53
|
[PlayerType.SOUL_B]: "playerportrait_theforgotten_b.png", // 40
|
|
55
|
-
} as const
|
|
54
|
+
} as const satisfies HasAllEnumKeys<PlayerType, string | undefined>;
|
|
@@ -15,8 +15,10 @@ const TWO_BY_TWO_BOUNDS: [width: int, height: int] = [
|
|
|
15
15
|
* The size of a room shape's contents. This does not include the tiles that the walls are on. L
|
|
16
16
|
* rooms use the same bounds as a 2x2 room.
|
|
17
17
|
*/
|
|
18
|
+
// We need the tuples to be read-only, so we specify the type instead of using the `satisfies`
|
|
19
|
+
// operator.
|
|
18
20
|
export const ROOM_SHAPE_BOUNDS: {
|
|
19
|
-
readonly [
|
|
21
|
+
readonly [Key in RoomShape]: readonly [width: int, height: int];
|
|
20
22
|
} = {
|
|
21
23
|
// 1
|
|
22
24
|
[RoomShape.SHAPE_1x1]: [
|
|
@@ -8,8 +8,10 @@ import { Corner } from "../interfaces/Corner";
|
|
|
8
8
|
* Note that these corner locations are not accurate for the Mother Boss Room and the Home closet
|
|
9
9
|
* rooms. (Those rooms have custom shapes.)
|
|
10
10
|
*/
|
|
11
|
+
// We need the arrays to be read-only, so we specify the type instead of using the `satisfies`
|
|
12
|
+
// operator.
|
|
11
13
|
export const ROOM_SHAPE_CORNERS: {
|
|
12
|
-
readonly [
|
|
14
|
+
readonly [Key in RoomShape]: readonly Corner[];
|
|
13
15
|
} = {
|
|
14
16
|
// 1
|
|
15
17
|
[RoomShape.SHAPE_1x1]: [
|
|
@@ -27,8 +27,10 @@ const TWO_BY_TWO_LAYOUT_SIZE: readonly [width: int, height: int] = [
|
|
|
27
27
|
*
|
|
28
28
|
* For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
|
|
29
29
|
*/
|
|
30
|
+
// We need the tuples to be read-only, so we specify the type instead of using the `satisfies`
|
|
31
|
+
// operator.
|
|
30
32
|
export const ROOM_SHAPE_LAYOUT_SIZES: {
|
|
31
|
-
readonly [
|
|
33
|
+
readonly [Key in RoomShape]: readonly [width: int, height: int];
|
|
32
34
|
} = {
|
|
33
35
|
[RoomShape.SHAPE_1x1]: ONE_BY_ONE_LAYOUT_SIZE, // 1
|
|
34
36
|
[RoomShape.IH]: ONE_BY_ONE_LAYOUT_SIZE, // 2
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
|
-
const TWO_BY_TWO_BOTTOM_RIGHT_POSITION = Vector(25, 13);
|
|
4
|
-
const ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION = Vector(
|
|
3
|
+
const TWO_BY_TWO_BOTTOM_RIGHT_POSITION: Readonly<Vector> = Vector(25, 13);
|
|
4
|
+
const ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION: Readonly<Vector> = Vector(
|
|
5
|
+
12,
|
|
6
|
+
13,
|
|
7
|
+
);
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
8
11
|
* wall would be at "Vector(-1, -1)".)
|
|
9
12
|
*/
|
|
13
|
+
// We need the vectors to be read-only, so we specify the type instead of using the `satisfies`
|
|
14
|
+
// operator.
|
|
10
15
|
export const ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION: {
|
|
11
|
-
readonly [
|
|
16
|
+
readonly [Key in RoomShape]: Readonly<Vector>;
|
|
12
17
|
} = {
|
|
13
18
|
[RoomShape.SHAPE_1x1]: Vector(12, 6), // 1
|
|
14
19
|
[RoomShape.IH]: Vector(12, 4), // 2
|
|
@@ -5,8 +5,10 @@ import { DoorSlot, RoomShape } from "isaac-typescript-definitions";
|
|
|
5
5
|
*
|
|
6
6
|
* e.g. `<door exists="False" x="-1" y="3" />`
|
|
7
7
|
*/
|
|
8
|
+
// We need the maps to be read-only, so we specify the type instead of using the `satisfies`
|
|
9
|
+
// operator.
|
|
8
10
|
export const ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES: {
|
|
9
|
-
readonly [
|
|
11
|
+
readonly [Key in RoomShape]: ReadonlyMap<DoorSlot, [x: int, y: int]>;
|
|
10
12
|
} = {
|
|
11
13
|
// 1
|
|
12
14
|
[RoomShape.SHAPE_1x1]: new Map([
|
|
@@ -11,8 +11,10 @@ const ALL_DOOR_SLOTS_SET: ReadonlySet<DoorSlot> = new Set([
|
|
|
11
11
|
DoorSlot.DOWN_1, // 7
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
|
+
// We need the sets to be read-only, so we specify the type instead of using the `satisfies`
|
|
15
|
+
// operator.
|
|
14
16
|
export const ROOM_SHAPE_TO_DOOR_SLOTS: {
|
|
15
|
-
readonly [
|
|
17
|
+
readonly [Key in RoomShape]: ReadonlySet<DoorSlot>;
|
|
16
18
|
} = {
|
|
17
19
|
// 1
|
|
18
20
|
[RoomShape.SHAPE_1x1]: new Set([
|
|
@@ -10,8 +10,10 @@ const DOWN = LEVEL_GRID_ROW_WIDTH;
|
|
|
10
10
|
* Deltas are considered to be from the safe grid index of the room (i.e. the top left corner, or
|
|
11
11
|
* top right corner in the case of `RoomShape.LTL`).
|
|
12
12
|
*/
|
|
13
|
+
// We need the maps to be read-only, so we specify the type instead of using the `satisfies`
|
|
14
|
+
// operator.
|
|
13
15
|
export const ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA: {
|
|
14
|
-
readonly [
|
|
16
|
+
readonly [Key in RoomShape]: ReadonlyMap<DoorSlot, int>;
|
|
15
17
|
} = {
|
|
16
18
|
// 1
|
|
17
19
|
[RoomShape.SHAPE_1x1]: new Map([
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
const ONE_BY_ONE_WIDTH = 15;
|
|
4
5
|
const TWO_BY_ONE_WIDTH = 28;
|
|
5
6
|
|
|
6
|
-
export const ROOM_SHAPE_TO_GRID_WIDTH
|
|
7
|
-
readonly [key in RoomShape]: int;
|
|
8
|
-
} = {
|
|
7
|
+
export const ROOM_SHAPE_TO_GRID_WIDTH = {
|
|
9
8
|
[RoomShape.SHAPE_1x1]: ONE_BY_ONE_WIDTH, // 1
|
|
10
9
|
[RoomShape.IH]: ONE_BY_ONE_WIDTH, // 2
|
|
11
10
|
[RoomShape.IV]: ONE_BY_ONE_WIDTH, // 3
|
|
@@ -18,4 +17,4 @@ export const ROOM_SHAPE_TO_GRID_WIDTH: {
|
|
|
18
17
|
[RoomShape.LTR]: TWO_BY_ONE_WIDTH, // 10
|
|
19
18
|
[RoomShape.LBL]: TWO_BY_ONE_WIDTH, // 11
|
|
20
19
|
[RoomShape.LBR]: TWO_BY_ONE_WIDTH, // 12
|
|
21
|
-
} as const
|
|
20
|
+
} as const satisfies HasAllEnumKeys<RoomShape, int>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
2
|
import { VectorZero } from "../core/constants";
|
|
3
3
|
|
|
4
|
-
const NARROW_HORIZONTAL_TOP_LEFT_POSITION = Vector(0, 2);
|
|
5
|
-
const NARROW_VERTICAL_TOP_LEFT_POSITION = Vector(4, 0);
|
|
4
|
+
const NARROW_HORIZONTAL_TOP_LEFT_POSITION: Readonly<Vector> = Vector(0, 2);
|
|
5
|
+
const NARROW_VERTICAL_TOP_LEFT_POSITION: Readonly<Vector> = Vector(4, 0);
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
9
9
|
* wall would be at "Vector(-1, -1)".)
|
|
10
10
|
*/
|
|
11
|
+
// We need the vectors to be read-only, so we specify the type instead of using the `satisfies`
|
|
12
|
+
// operator.
|
|
11
13
|
export const ROOM_SHAPE_TO_TOP_LEFT_POSITION: {
|
|
12
|
-
readonly [
|
|
14
|
+
readonly [Key in RoomShape]: Readonly<Vector>;
|
|
13
15
|
} = {
|
|
14
16
|
[RoomShape.SHAPE_1x1]: VectorZero, // 1
|
|
15
17
|
[RoomShape.IH]: NARROW_HORIZONTAL_TOP_LEFT_POSITION, // 2
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const ONE_BY_ONE_CONTENTS_WIDTH = 13;
|
|
4
5
|
export const ONE_BY_ONE_CONTENTS_HEIGHT = 7;
|
|
@@ -20,9 +21,7 @@ const L_ROOM_VOLUME = ONE_BY_ONE_VOLUME * 3;
|
|
|
20
21
|
*
|
|
21
22
|
* (This cannot be directly calculated from the bounds since L rooms are a special case.)
|
|
22
23
|
*/
|
|
23
|
-
export const ROOM_SHAPE_VOLUMES
|
|
24
|
-
readonly [key in RoomShape]: int;
|
|
25
|
-
} = {
|
|
24
|
+
export const ROOM_SHAPE_VOLUMES = {
|
|
26
25
|
[RoomShape.SHAPE_1x1]: ONE_BY_ONE_VOLUME, // 1
|
|
27
26
|
[RoomShape.IH]: NARROW_HORIZONTAL_VOLUME, // 2
|
|
28
27
|
[RoomShape.IV]: NARROW_VERTICAL_VOLUME, // 3
|
|
@@ -35,4 +34,4 @@ export const ROOM_SHAPE_VOLUMES: {
|
|
|
35
34
|
[RoomShape.LTR]: L_ROOM_VOLUME, // 10
|
|
36
35
|
[RoomShape.LBL]: L_ROOM_VOLUME, // 11
|
|
37
36
|
[RoomShape.LBR]: L_ROOM_VOLUME, // 12
|
|
38
|
-
} as const
|
|
37
|
+
} as const satisfies HasAllEnumKeys<RoomShape, int>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { RoomType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const ROOM_TYPE_GOTO_PREFIXES
|
|
4
|
-
readonly [key in RoomType]: string;
|
|
5
|
-
} = {
|
|
4
|
+
export const ROOM_TYPE_GOTO_PREFIXES = {
|
|
6
5
|
[RoomType.DEFAULT]: "s.default", // 1
|
|
7
6
|
[RoomType.SHOP]: "s.shop", // 2
|
|
8
7
|
[RoomType.ERROR]: "s.error", // 3
|
|
@@ -32,4 +31,4 @@ export const ROOM_TYPE_GOTO_PREFIXES: {
|
|
|
32
31
|
[RoomType.SECRET_EXIT]: "s.secretexit", // 27
|
|
33
32
|
[RoomType.BLUE]: "s.blue", // 28
|
|
34
33
|
[RoomType.ULTRA_SECRET]: "s.ultrasecret", // 29
|
|
35
|
-
} as const
|
|
34
|
+
} as const satisfies HasAllEnumKeys<RoomType, string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RoomType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const ROOM_TYPE_NAMES
|
|
4
|
+
export const ROOM_TYPE_NAMES = {
|
|
4
5
|
[RoomType.DEFAULT]: "default room", // 1
|
|
5
6
|
[RoomType.SHOP]: "shop", // 2
|
|
6
7
|
[RoomType.ERROR]: "I AM ERROR Room", // 3
|
|
@@ -30,4 +31,4 @@ export const ROOM_TYPE_NAMES: { readonly [key in RoomType]: string } = {
|
|
|
30
31
|
[RoomType.SECRET_EXIT]: "Secret Exit", // 27
|
|
31
32
|
[RoomType.BLUE]: "Blue Room", // 28
|
|
32
33
|
[RoomType.ULTRA_SECRET]: "Ultra Secret Room", // 29
|
|
33
|
-
} as const
|
|
34
|
+
} as const satisfies HasAllEnumKeys<RoomType, string>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const STAGE_TYPE_SUFFIXES
|
|
4
|
-
readonly [key in StageType]: string;
|
|
5
|
-
} = {
|
|
4
|
+
export const STAGE_TYPE_SUFFIXES = {
|
|
6
5
|
[StageType.ORIGINAL]: "", // 0
|
|
7
6
|
[StageType.WRATH_OF_THE_LAMB]: "a", // 1
|
|
8
7
|
[StageType.AFTERBIRTH]: "b", // 2
|
|
9
8
|
[StageType.GREED_MODE]: "", // 3
|
|
10
9
|
[StageType.REPENTANCE]: "c", // 4
|
|
11
10
|
[StageType.REPENTANCE_B]: "d", // 5
|
|
12
|
-
} as const
|
|
11
|
+
} as const satisfies HasAllEnumKeys<StageType, string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const STAGE_TYPE_TO_LETTER
|
|
4
|
+
export const STAGE_TYPE_TO_LETTER = {
|
|
4
5
|
// For example, to go to Basement 2, the command is simply "stage 2" without a letter suffix.
|
|
5
6
|
[StageType.ORIGINAL]: "", // 0
|
|
6
7
|
|
|
@@ -12,4 +13,4 @@ export const STAGE_TYPE_TO_LETTER: { readonly [key in StageType]: string } = {
|
|
|
12
13
|
|
|
13
14
|
[StageType.REPENTANCE]: "c", // 4
|
|
14
15
|
[StageType.REPENTANCE_B]: "d", // 5
|
|
15
|
-
} as const
|
|
16
|
+
} as const satisfies HasAllEnumKeys<StageType, string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PlayerForm } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const TRANSFORMATION_NAMES
|
|
4
|
+
export const TRANSFORMATION_NAMES = {
|
|
4
5
|
[PlayerForm.GUPPY]: "Guppy", // 0
|
|
5
6
|
[PlayerForm.BEELZEBUB]: "Beelzebub", // 1
|
|
6
7
|
[PlayerForm.FUN_GUY]: "Fun Guy", // 2
|
|
@@ -15,4 +16,4 @@ export const TRANSFORMATION_NAMES: { readonly [key in PlayerForm]: string } = {
|
|
|
15
16
|
[PlayerForm.ADULT]: "Adult", // 11
|
|
16
17
|
[PlayerForm.SPIDER_BABY]: "Spider Baby", // 12
|
|
17
18
|
[PlayerForm.STOMPY]: "Stompy", // 13
|
|
18
|
-
} as const
|
|
19
|
+
} as const satisfies HasAllEnumKeys<PlayerForm, string>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { StageID } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
3
|
/** We arbitrarily specify a default color equal to that of Basement. */
|
|
4
|
-
const DEFAULT_COLOR = Color(26 / 255, 14 / 255, 12 / 255);
|
|
4
|
+
const DEFAULT_COLOR: Readonly<Color> = Color(26 / 255, 14 / 255, 12 / 255);
|
|
5
5
|
|
|
6
6
|
/** These values are taken from StageAPI. */
|
|
7
|
+
// We need the colors to be read-only, so we specify the type instead of using the `satisfies`
|
|
8
|
+
// operator.
|
|
7
9
|
export const VERSUS_SCREEN_BACKGROUND_COLORS: {
|
|
8
|
-
readonly [
|
|
10
|
+
readonly [Key in StageID]: Readonly<Color>;
|
|
9
11
|
} = {
|
|
10
12
|
[StageID.SPECIAL_ROOMS]: DEFAULT_COLOR, // 0
|
|
11
13
|
[StageID.BASEMENT]: Color(26 / 255, 14 / 255, 12 / 255), // 1
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { StageID } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
3
|
/** We arbitrarily specify a default color equal to that of Basement. */
|
|
4
|
-
const DEFAULT_COLOR = Color(201 / 255, 114 / 255, 96 / 255);
|
|
4
|
+
const DEFAULT_COLOR: Readonly<Color> = Color(201 / 255, 114 / 255, 96 / 255);
|
|
5
5
|
|
|
6
6
|
/** These values are taken from StageAPI. */
|
|
7
|
+
// We need the colors to be read-only, so we specify the type instead of using the `satisfies`
|
|
8
|
+
// operator.
|
|
7
9
|
export const VERSUS_SCREEN_DIRT_SPOT_COLORS: {
|
|
8
|
-
readonly [
|
|
10
|
+
readonly [Key in StageID]: Readonly<Color>;
|
|
9
11
|
} = {
|
|
10
12
|
[StageID.SPECIAL_ROOMS]: DEFAULT_COLOR, // 0
|
|
11
13
|
[StageID.BASEMENT]: Color(201 / 255, 114 / 255, 96 / 255), // 1
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
* [MyEnum.Value1]: "foo",
|
|
16
16
|
* [MyEnum.Value2]: "bar",
|
|
17
17
|
* [MyEnum.Value3]: "baz",
|
|
18
|
-
* } as const satisfies HasAllEnumKeys<MyEnum>;
|
|
18
|
+
* } as const satisfies HasAllEnumKeys<MyEnum, string>;
|
|
19
19
|
*
|
|
20
20
|
* const value = MyEnumToString[MyEnum.Value2];
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export type HasAllEnumKeys<Enum extends string | number, T> = {
|
|
24
|
-
readonly [
|
|
24
|
+
readonly [Key in Enum]: T;
|
|
25
25
|
};
|