isaacscript-common 17.4.2 → 17.5.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 +13 -5
- package/dist/isaacscript-common.lua +29 -24
- package/dist/src/callbacks.d.ts +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +6 -3
- 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 +11 -3
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +18 -4
- 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/ModdedElementSets.ts +3 -0
- 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 +19 -5
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomTypeGotoPrefixes.d.ts","sourceRoot":"","sources":["../../../src/objects/roomTypeGotoPrefixes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roomTypeGotoPrefixes.d.ts","sourceRoot":"","sources":["../../../src/objects/roomTypeGotoPrefixes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BiB,CAAC"}
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import { RoomType } from "isaac-typescript-definitions";
|
|
2
1
|
export declare const ROOM_TYPE_NAMES: {
|
|
3
|
-
readonly
|
|
2
|
+
readonly 1: "default room";
|
|
3
|
+
readonly 2: "shop";
|
|
4
|
+
readonly 3: "I AM ERROR Room";
|
|
5
|
+
readonly 4: "Treasure Room";
|
|
6
|
+
readonly 5: "Boss Room";
|
|
7
|
+
readonly 6: "Miniboss Room";
|
|
8
|
+
readonly 7: "Secret Room";
|
|
9
|
+
readonly 8: "Super Secret Room";
|
|
10
|
+
readonly 9: "Arcade";
|
|
11
|
+
readonly 10: "Curse Room";
|
|
12
|
+
readonly 11: "Challenge Room";
|
|
13
|
+
readonly 12: "Library";
|
|
14
|
+
readonly 13: "Sacrifice Room";
|
|
15
|
+
readonly 14: "Devil Room";
|
|
16
|
+
readonly 15: "Angel Room";
|
|
17
|
+
readonly 16: "Crawl Space";
|
|
18
|
+
readonly 17: "Boss Rush";
|
|
19
|
+
readonly 18: "Clean Bedroom";
|
|
20
|
+
readonly 19: "Dirty Bedroom";
|
|
21
|
+
readonly 20: "Chest Room";
|
|
22
|
+
readonly 21: "Dice Room";
|
|
23
|
+
readonly 22: "Black Market";
|
|
24
|
+
readonly 23: "Greed Exit Room";
|
|
25
|
+
readonly 24: "Planetarium";
|
|
26
|
+
readonly 25: "Teleporter Room";
|
|
27
|
+
readonly 26: "Teleporter Exit Room";
|
|
28
|
+
readonly 27: "Secret Exit";
|
|
29
|
+
readonly 28: "Blue Room";
|
|
30
|
+
readonly 29: "Ultra Secret Room";
|
|
4
31
|
};
|
|
5
32
|
//# sourceMappingURL=roomTypeNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomTypeNames.d.ts","sourceRoot":"","sources":["../../../src/objects/roomTypeNames.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roomTypeNames.d.ts","sourceRoot":"","sources":["../../../src/objects/roomTypeNames.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8ByB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { StageType } from "isaac-typescript-definitions";
|
|
2
1
|
export declare const STAGE_TYPE_SUFFIXES: {
|
|
3
|
-
readonly
|
|
2
|
+
readonly 0: "";
|
|
3
|
+
readonly 1: "a";
|
|
4
|
+
readonly 2: "b";
|
|
5
|
+
readonly 3: "";
|
|
6
|
+
readonly 4: "c";
|
|
7
|
+
readonly 5: "d";
|
|
4
8
|
};
|
|
5
9
|
//# sourceMappingURL=stageTypeSuffixes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypeSuffixes.d.ts","sourceRoot":"","sources":["../../../src/objects/stageTypeSuffixes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageTypeSuffixes.d.ts","sourceRoot":"","sources":["../../../src/objects/stageTypeSuffixes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;;CAOsB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { StageType } from "isaac-typescript-definitions";
|
|
2
1
|
export declare const STAGE_TYPE_TO_LETTER: {
|
|
3
|
-
readonly
|
|
2
|
+
readonly 0: "";
|
|
3
|
+
readonly 1: "a";
|
|
4
|
+
readonly 2: "b";
|
|
5
|
+
readonly 3: "";
|
|
6
|
+
readonly 4: "c";
|
|
7
|
+
readonly 5: "d";
|
|
4
8
|
};
|
|
5
9
|
//# sourceMappingURL=stageTypeToLetter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypeToLetter.d.ts","sourceRoot":"","sources":["../../../src/objects/stageTypeToLetter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stageTypeToLetter.d.ts","sourceRoot":"","sources":["../../../src/objects/stageTypeToLetter.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;CAYqB,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { PlayerForm } from "isaac-typescript-definitions";
|
|
2
1
|
export declare const TRANSFORMATION_NAMES: {
|
|
3
|
-
readonly
|
|
2
|
+
readonly 0: "Guppy";
|
|
3
|
+
readonly 1: "Beelzebub";
|
|
4
|
+
readonly 2: "Fun Guy";
|
|
5
|
+
readonly 3: "Seraphim";
|
|
6
|
+
readonly 4: "Bob";
|
|
7
|
+
readonly 5: "Spun";
|
|
8
|
+
readonly 6: "Yes Mother?";
|
|
9
|
+
readonly 7: "Conjoined";
|
|
10
|
+
readonly 8: "Leviathan";
|
|
11
|
+
readonly 9: "Oh Crap";
|
|
12
|
+
readonly 10: "Bookworm";
|
|
13
|
+
readonly 11: "Adult";
|
|
14
|
+
readonly 12: "Spider Baby";
|
|
15
|
+
readonly 13: "Stompy";
|
|
4
16
|
};
|
|
5
17
|
//# sourceMappingURL=transformationNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformationNames.d.ts","sourceRoot":"","sources":["../../../src/objects/transformationNames.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformationNames.d.ts","sourceRoot":"","sources":["../../../src/objects/transformationNames.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;CAesB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StageID } from "isaac-typescript-definitions";
|
|
2
2
|
/** These values are taken from StageAPI. */
|
|
3
3
|
export declare const VERSUS_SCREEN_BACKGROUND_COLORS: {
|
|
4
|
-
readonly [
|
|
4
|
+
readonly [Key in StageID]: Readonly<Color>;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=versusScreenBackgroundColors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versusScreenBackgroundColors.d.ts","sourceRoot":"","sources":["../../../src/objects/versusScreenBackgroundColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAKvD,4CAA4C;
|
|
1
|
+
{"version":3,"file":"versusScreenBackgroundColors.d.ts","sourceRoot":"","sources":["../../../src/objects/versusScreenBackgroundColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAKvD,4CAA4C;AAG5C,eAAO,MAAM,+BAA+B,EAAE;IAC5C,QAAQ,EAAE,GAAG,IAAI,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC;CA+BlC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StageID } from "isaac-typescript-definitions";
|
|
2
2
|
/** These values are taken from StageAPI. */
|
|
3
3
|
export declare const VERSUS_SCREEN_DIRT_SPOT_COLORS: {
|
|
4
|
-
readonly [
|
|
4
|
+
readonly [Key in StageID]: Readonly<Color>;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=versusScreenDirtSpotColors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versusScreenDirtSpotColors.d.ts","sourceRoot":"","sources":["../../../src/objects/versusScreenDirtSpotColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAKvD,4CAA4C;
|
|
1
|
+
{"version":3,"file":"versusScreenDirtSpotColors.d.ts","sourceRoot":"","sources":["../../../src/objects/versusScreenDirtSpotColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAKvD,4CAA4C;AAG5C,eAAO,MAAM,8BAA8B,EAAE;IAC3C,QAAQ,EAAE,GAAG,IAAI,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC;CA+BlC,CAAC"}
|
|
@@ -15,12 +15,12 @@
|
|
|
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
|
};
|
|
26
26
|
//# sourceMappingURL=HasAllEnumKeys.d.ts.map
|
package/package.json
CHANGED
package/src/callbacks.ts
CHANGED
|
@@ -120,8 +120,8 @@ const MOD_CALLBACK_CUSTOM_TO_CLASS = newObjectWithEnumKeys(ModCallbackCustom, {
|
|
|
120
120
|
} as const);
|
|
121
121
|
|
|
122
122
|
export type ModCallbackCustomToClass = {
|
|
123
|
-
readonly [
|
|
124
|
-
typeof MOD_CALLBACK_CUSTOM_TO_CLASS[
|
|
123
|
+
readonly [Key in keyof typeof MOD_CALLBACK_CUSTOM_TO_CLASS]: InstanceType<
|
|
124
|
+
typeof MOD_CALLBACK_CUSTOM_TO_CLASS[Key]
|
|
125
125
|
>;
|
|
126
126
|
};
|
|
127
127
|
|
|
@@ -366,6 +366,9 @@ export class ModdedElementSets extends Feature {
|
|
|
366
366
|
for (const collectibleType of CONDITIONAL_FLYING_COLLECTIBLE_TYPES) {
|
|
367
367
|
permanentFlyingCollectibleTypes.delete(collectibleType);
|
|
368
368
|
}
|
|
369
|
+
for (const collectibleType of permanentFlyingCollectibleTypes.values()) {
|
|
370
|
+
this.permanentFlyingCollectibleTypesSet.add(collectibleType);
|
|
371
|
+
}
|
|
369
372
|
}
|
|
370
373
|
|
|
371
374
|
private lazyInitFlyingTrinketTypesSet() {
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from "../../../../functions/string";
|
|
22
22
|
import { eRange, iRange } from "../../../../functions/utils";
|
|
23
23
|
import { CustomStage } from "../../../../interfaces/private/CustomStage";
|
|
24
|
+
import { HasAllEnumKeys } from "../../../../types/HasAllEnumKeys";
|
|
24
25
|
import { ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH } from "./constants";
|
|
25
26
|
|
|
26
27
|
enum BackdropKind {
|
|
@@ -42,9 +43,7 @@ const DEFAULT_BACKDROP: NonNullable<CustomStage["backdropPNGPaths"]> = {
|
|
|
42
43
|
corners: [`${ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH}/backdrop/corner.png`],
|
|
43
44
|
} as const;
|
|
44
45
|
|
|
45
|
-
const ROOM_SHAPE_WALL_ANM2_LAYERS
|
|
46
|
-
readonly [key in RoomShape]: int;
|
|
47
|
-
} = {
|
|
46
|
+
const ROOM_SHAPE_WALL_ANM2_LAYERS = {
|
|
48
47
|
[RoomShape.SHAPE_1x1]: 44, // 1
|
|
49
48
|
[RoomShape.IH]: 36, // 2
|
|
50
49
|
[RoomShape.IV]: 28, // 3
|
|
@@ -57,10 +56,10 @@ const ROOM_SHAPE_WALL_ANM2_LAYERS: {
|
|
|
57
56
|
[RoomShape.LTR]: 63, // 10
|
|
58
57
|
[RoomShape.LBL]: 63, // 11
|
|
59
58
|
[RoomShape.LBR]: 63, // 12
|
|
60
|
-
} as const
|
|
59
|
+
} as const satisfies HasAllEnumKeys<RoomShape, int>;
|
|
61
60
|
|
|
62
61
|
const ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS: {
|
|
63
|
-
readonly [
|
|
62
|
+
readonly [Key in RoomShape]?: int;
|
|
64
63
|
} = {
|
|
65
64
|
[RoomShape.SHAPE_2x1]: 7, // 6
|
|
66
65
|
[RoomShape.SHAPE_2x2]: 21, // 8
|
|
@@ -5,6 +5,7 @@ import { getRandomArrayElement } from "../../../../functions/array";
|
|
|
5
5
|
import { spawnEffectWithSeed } from "../../../../functions/entitiesSpecific";
|
|
6
6
|
import { removeCharactersBefore } from "../../../../functions/string";
|
|
7
7
|
import { CustomStage } from "../../../../interfaces/private/CustomStage";
|
|
8
|
+
import { HasAllEnumKeys } from "../../../../types/HasAllEnumKeys";
|
|
8
9
|
import { ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH } from "./constants";
|
|
9
10
|
|
|
10
11
|
type ShadowAnimation = "1x1" | "1x2" | "2x1" | "2x2";
|
|
@@ -21,9 +22,7 @@ const SHADOW_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
|
21
22
|
const SHADOW_EFFECT_SUB_TYPE = LadderSubTypeCustom.CUSTOM_SHADOW;
|
|
22
23
|
|
|
23
24
|
/** The animation comes from StageAPI. */
|
|
24
|
-
const ROOM_SHAPE_TO_SHADOW_ANIMATION
|
|
25
|
-
readonly [key in RoomShape]: ShadowAnimation;
|
|
26
|
-
} = {
|
|
25
|
+
const ROOM_SHAPE_TO_SHADOW_ANIMATION = {
|
|
27
26
|
[RoomShape.SHAPE_1x1]: "1x1", // 1
|
|
28
27
|
[RoomShape.IH]: "1x1", // 2
|
|
29
28
|
[RoomShape.IV]: "1x1", // 3
|
|
@@ -36,7 +35,7 @@ const ROOM_SHAPE_TO_SHADOW_ANIMATION: {
|
|
|
36
35
|
[RoomShape.LTR]: "2x2", // 10
|
|
37
36
|
[RoomShape.LBL]: "2x2", // 11
|
|
38
37
|
[RoomShape.LBR]: "2x2", // 12
|
|
39
|
-
} as const
|
|
38
|
+
} as const satisfies HasAllEnumKeys<RoomShape, ShadowAnimation>;
|
|
40
39
|
|
|
41
40
|
const FADED_BLACK = Color(0, 0, 0, 0.25);
|
|
42
41
|
|
|
@@ -8,15 +8,14 @@ import {
|
|
|
8
8
|
getScreenTopCenterPos,
|
|
9
9
|
} from "../../../../functions/ui";
|
|
10
10
|
import { CustomStage } from "../../../../interfaces/private/CustomStage";
|
|
11
|
+
import { HasAllEnumKeys } from "../../../../types/HasAllEnumKeys";
|
|
11
12
|
|
|
12
13
|
/** Corresponds to "resources/gfx/ui/ui_streak.anm2". */
|
|
13
|
-
const UI_STREAK_ANIMATION_END_FRAMES
|
|
14
|
-
readonly [key in UIStreakAnimation]: int;
|
|
15
|
-
} = {
|
|
14
|
+
const UI_STREAK_ANIMATION_END_FRAMES = {
|
|
16
15
|
[UIStreakAnimation.NONE]: 0,
|
|
17
16
|
[UIStreakAnimation.TEXT]: 69,
|
|
18
17
|
[UIStreakAnimation.TEXT_STAY]: 1,
|
|
19
|
-
} as const
|
|
18
|
+
} as const satisfies HasAllEnumKeys<UIStreakAnimation, int>;
|
|
20
19
|
|
|
21
20
|
/** This must match the name of the shader in "shaders.xml". */
|
|
22
21
|
const EMPTY_SHADER_NAME = "IsaacScript-RenderAboveHUD";
|
|
@@ -38,9 +38,7 @@ interface VersusScreenVars {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const DEFAULT_CHARACTER = PlayerType.ISAAC;
|
|
42
41
|
const DEFAULT_STAGE_ID = StageID.BASEMENT;
|
|
43
|
-
|
|
44
42
|
const VERSUS_SCREEN_ANIMATION_NAME = "Scene";
|
|
45
43
|
|
|
46
44
|
/** The layers range from 0 to 13. */
|
|
@@ -242,19 +240,13 @@ function getPlayerPNGPaths(): {
|
|
|
242
240
|
} {
|
|
243
241
|
const player = Isaac.GetPlayer();
|
|
244
242
|
const character = player.GetPlayerType();
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (namePNGFileName === undefined) {
|
|
248
|
-
namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[DEFAULT_CHARACTER];
|
|
243
|
+
if (character === PlayerType.POSSESSOR) {
|
|
244
|
+
error("Failed to get the player PNG paths since they are a possessor.");
|
|
249
245
|
}
|
|
250
246
|
|
|
247
|
+
const namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[character];
|
|
251
248
|
const namePNGPath = `${PNG_PATH_PREFIX}/${namePNGFileName}`;
|
|
252
|
-
|
|
253
|
-
let portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[character];
|
|
254
|
-
if (namePNGFileName === undefined) {
|
|
255
|
-
portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[DEFAULT_CHARACTER];
|
|
256
|
-
}
|
|
257
|
-
|
|
249
|
+
const portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[character];
|
|
258
250
|
const portraitPNGPath = `${PLAYER_PORTRAIT_PNG_PATH_PREFIX}/${portraitFileName}`;
|
|
259
251
|
|
|
260
252
|
return { namePNGPath, portraitPNGPath };
|
package/src/functions/input.ts
CHANGED
|
@@ -65,24 +65,38 @@ export function getShootActions(): ReadonlySet<ButtonAction> {
|
|
|
65
65
|
return SHOOTING_ACTIONS_SET;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
/**
|
|
69
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Iterates over all inputs to determine if a particular button is pressed (i.e. held down).
|
|
70
|
+
*
|
|
71
|
+
* This function is variadic, meaning you can pass as many buttons as you want to check for. This
|
|
72
|
+
* function will return true if any of the buttons are pressed.
|
|
73
|
+
*/
|
|
74
|
+
export function isActionPressedOnAnyInput(
|
|
75
|
+
...buttonActions: ButtonAction[]
|
|
76
|
+
): boolean {
|
|
70
77
|
const controllerIndexes = getEnumValues(ControllerIndex);
|
|
71
78
|
return controllerIndexes.some((controllerIndex) =>
|
|
72
|
-
|
|
79
|
+
buttonActions.some((buttonAction) =>
|
|
80
|
+
Input.IsActionPressed(buttonAction, controllerIndex),
|
|
81
|
+
),
|
|
73
82
|
);
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
/**
|
|
77
86
|
* Iterates over all inputs to determine if a particular button is triggered (i.e. held down and
|
|
78
87
|
* then released).
|
|
88
|
+
*
|
|
89
|
+
* This function is variadic, meaning you can pass as many buttons as you want to check for. This
|
|
90
|
+
* function will return true if any of the buttons are pressed.
|
|
79
91
|
*/
|
|
80
92
|
export function isActionTriggeredOnAnyInput(
|
|
81
|
-
|
|
93
|
+
...buttonActions: ButtonAction[]
|
|
82
94
|
): boolean {
|
|
83
95
|
const controllerIndexes = getEnumValues(ControllerIndex);
|
|
84
96
|
return controllerIndexes.some((controllerIndex) =>
|
|
85
|
-
|
|
97
|
+
buttonActions.some((buttonAction) =>
|
|
98
|
+
Input.IsActionTriggered(buttonAction, controllerIndex),
|
|
99
|
+
),
|
|
86
100
|
);
|
|
87
101
|
}
|
|
88
102
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
2
|
import { VectorZero } from "../core/constants";
|
|
3
3
|
|
|
4
|
-
const TWO_BY_TWO_BOTTOM_RIGHT = Vector(25, 13);
|
|
4
|
+
const TWO_BY_TWO_BOTTOM_RIGHT: Readonly<Vector> = Vector(25, 13);
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
8
8
|
* wall would be at "Vector(-1, -1)".)
|
|
9
9
|
*/
|
|
10
|
+
// We need the vectors to be read-only, so we specify the type instead of using the `satisfies`
|
|
11
|
+
// operator.
|
|
10
12
|
export const L_ROOM_SHAPE_TO_RECTANGLES: {
|
|
11
|
-
readonly [
|
|
12
|
-
verticalTopLeft: Vector
|
|
13
|
-
verticalBottomRight: Vector
|
|
14
|
-
horizontalTopLeft: Vector
|
|
15
|
-
horizontalBottomRight: Vector
|
|
13
|
+
readonly [Key in RoomShape]?: readonly [
|
|
14
|
+
verticalTopLeft: Readonly<Vector>,
|
|
15
|
+
verticalBottomRight: Readonly<Vector>,
|
|
16
|
+
horizontalTopLeft: Readonly<Vector>,
|
|
17
|
+
horizontalBottomRight: Readonly<Vector>,
|
|
16
18
|
];
|
|
17
19
|
} = {
|
|
18
20
|
// 9
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BackdropType } from "isaac-typescript-definitions";
|
|
2
2
|
import { RockAltType } from "../enums/RockAltType";
|
|
3
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
3
4
|
|
|
4
5
|
/** Used by the `getRockAltType` function. */
|
|
5
|
-
export const BACKDROP_TYPE_TO_ROCK_ALT_TYPE
|
|
6
|
-
readonly [key in BackdropType]: RockAltType;
|
|
7
|
-
} = {
|
|
6
|
+
export const BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
|
|
8
7
|
[BackdropType.BASEMENT]: RockAltType.URN, // 1
|
|
9
8
|
[BackdropType.CELLAR]: RockAltType.URN, // 2
|
|
10
9
|
[BackdropType.BURNT_BASEMENT]: RockAltType.URN, // 3
|
|
@@ -65,4 +64,4 @@ export const BACKDROP_TYPE_TO_ROCK_ALT_TYPE: {
|
|
|
65
64
|
[BackdropType.MINES_SHAFT]: RockAltType.MUSHROOM, // 58
|
|
66
65
|
[BackdropType.ASHPIT_SHAFT]: RockAltType.MUSHROOM, // 59
|
|
67
66
|
[BackdropType.DARK_CLOSET]: RockAltType.SKULL, // 60
|
|
68
|
-
} as const
|
|
67
|
+
} as const satisfies HasAllEnumKeys<BackdropType, RockAltType>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// cspell:disable
|
|
2
2
|
|
|
3
3
|
import { BossID } from "isaac-typescript-definitions";
|
|
4
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
4
5
|
|
|
5
6
|
/** Used when rendering the "versusscreen.anm2" sprite. */
|
|
6
|
-
export const BOSS_NAME_PNG_FILE_NAMES
|
|
7
|
-
readonly [key in BossID]: string;
|
|
8
|
-
} = {
|
|
7
|
+
export const BOSS_NAME_PNG_FILE_NAMES = {
|
|
9
8
|
[BossID.MONSTRO]: "bossname_20.0_monstro.png", // 1
|
|
10
9
|
[BossID.LARRY_JR]: "bossname_19.0_larryjr.png", // 2
|
|
11
10
|
[BossID.CHUB]: "bossname_28.0_chub.png", // 3
|
|
@@ -112,4 +111,4 @@ export const BOSS_NAME_PNG_FILE_NAMES: {
|
|
|
112
111
|
[BossID.BEAST]: "bossname_dogma.png", // 100
|
|
113
112
|
[BossID.HORNY_BOYS]: "bossname_hornyboys.png", // 101
|
|
114
113
|
[BossID.CLUTCH]: "bossname_clutch.png", // 102
|
|
115
|
-
} as const
|
|
114
|
+
} as const satisfies HasAllEnumKeys<BossID, string>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// cspell:disable
|
|
2
2
|
|
|
3
3
|
import { BossID } from "isaac-typescript-definitions";
|
|
4
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
4
5
|
|
|
5
6
|
/** Used when rendering the "versusscreen.anm2" sprite. */
|
|
6
|
-
export const BOSS_PORTRAIT_PNG_FILE_NAMES
|
|
7
|
-
readonly [key in BossID]: string;
|
|
8
|
-
} = {
|
|
7
|
+
export const BOSS_PORTRAIT_PNG_FILE_NAMES = {
|
|
9
8
|
[BossID.MONSTRO]: "portrait_20.0_monstro.png", // 1
|
|
10
9
|
[BossID.LARRY_JR]: "portrait_19.0_larryjr.png", // 2
|
|
11
10
|
[BossID.CHUB]: "portrait_28.0_chub.png", // 3
|
|
@@ -115,4 +114,4 @@ export const BOSS_PORTRAIT_PNG_FILE_NAMES: {
|
|
|
115
114
|
[BossID.BEAST]: "portrait_dogma.png", // 100
|
|
116
115
|
[BossID.HORNY_BOYS]: "portrait_hornyboys.png", // 101
|
|
117
116
|
[BossID.CLUTCH]: "portrait_clutch.png", // 102
|
|
118
|
-
} as const
|
|
117
|
+
} as const satisfies HasAllEnumKeys<BossID, string>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CardType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_CARD_DESCRIPTION = "Unknown";
|
|
4
5
|
|
|
5
6
|
/** This is a temporary map due to missing features in the vanilla API. */
|
|
6
|
-
export const CARD_DESCRIPTIONS
|
|
7
|
+
export const CARD_DESCRIPTIONS = {
|
|
7
8
|
[CardType.NULL]: DEFAULT_CARD_DESCRIPTION, // 0
|
|
8
9
|
[CardType.FOOL]: "Where journey begins", // 1
|
|
9
10
|
[CardType.MAGICIAN]: "May you never miss your goal", // 2
|
|
@@ -102,4 +103,4 @@ export const CARD_DESCRIPTIONS: { readonly [key in CardType]: string } = {
|
|
|
102
103
|
[CardType.SOUL_FORGOTTEN]: "Skeletal protector", // 95
|
|
103
104
|
[CardType.SOUL_BETHANY]: "Friends from beyond", // 96
|
|
104
105
|
[CardType.SOUL_JACOB]: "Bound by blood", // 97
|
|
105
|
-
} as const
|
|
106
|
+
} as const satisfies HasAllEnumKeys<CardType, string>;
|
package/src/objects/cardNames.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CardType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_CARD_NAME = "Unknown";
|
|
4
5
|
|
|
5
6
|
/** This is a temporary map due to missing features in the vanilla API. */
|
|
6
|
-
export const CARD_NAMES
|
|
7
|
+
export const CARD_NAMES = {
|
|
7
8
|
[CardType.NULL]: DEFAULT_CARD_NAME,
|
|
8
9
|
[CardType.FOOL]: "0 - The Fool",
|
|
9
10
|
[CardType.MAGICIAN]: "I - The Magician",
|
|
@@ -102,4 +103,4 @@ export const CARD_NAMES: { readonly [key in CardType]: string } = {
|
|
|
102
103
|
[CardType.SOUL_FORGOTTEN]: "Soul of the Forgotten",
|
|
103
104
|
[CardType.SOUL_BETHANY]: "Soul of Bethany",
|
|
104
105
|
[CardType.SOUL_JACOB]: "Soul of Jacob and Esau",
|
|
105
|
-
} as const
|
|
106
|
+
} as const satisfies HasAllEnumKeys<CardType, string>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Challenge } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_CHALLENGE_NAME = "Unknown";
|
|
4
5
|
|
|
5
|
-
export const CHALLENGE_NAMES
|
|
6
|
+
export const CHALLENGE_NAMES = {
|
|
6
7
|
[Challenge.NULL]: DEFAULT_CHALLENGE_NAME, // 0
|
|
7
8
|
[Challenge.PITCH_BLACK]: "Pitch Black", // 1
|
|
8
9
|
[Challenge.HIGH_BROW]: "High Brow", // 2
|
|
@@ -49,4 +50,4 @@ export const CHALLENGE_NAMES: { readonly [key in Challenge]: string } = {
|
|
|
49
50
|
[Challenge.CANTRIPPED]: "Cantripped!", // 43
|
|
50
51
|
[Challenge.RED_REDEMPTION]: "Red Redemption", // 44
|
|
51
52
|
[Challenge.DELETE_THIS]: "DELETE THIS", // 45
|
|
52
|
-
} as const
|
|
53
|
+
} as const satisfies HasAllEnumKeys<Challenge, string>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
/** From: https://bindingofisaacrebirth.fandom.com/wiki/Characters#Regular_Characters */
|
|
4
|
-
export const CHARACTER_DAMAGE_MULTIPLIERS
|
|
5
|
-
readonly [key in PlayerType]: float;
|
|
6
|
-
} = {
|
|
5
|
+
export const CHARACTER_DAMAGE_MULTIPLIERS = {
|
|
7
6
|
[PlayerType.POSSESSOR]: 1.0, // -1
|
|
8
7
|
[PlayerType.ISAAC]: 1.0, // 0
|
|
9
8
|
[PlayerType.MAGDALENE]: 1.0, // 1
|
|
@@ -46,4 +45,4 @@ export const CHARACTER_DAMAGE_MULTIPLIERS: {
|
|
|
46
45
|
[PlayerType.LAZARUS_2_B]: 1.5, // 38
|
|
47
46
|
[PlayerType.JACOB_2_B]: 1.0, // 39
|
|
48
47
|
[PlayerType.SOUL_B]: 1.0, // 40
|
|
49
|
-
} as const
|
|
48
|
+
} as const satisfies HasAllEnumKeys<PlayerType, float>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const CHARACTER_NAMES
|
|
4
|
+
export const CHARACTER_NAMES = {
|
|
4
5
|
[PlayerType.POSSESSOR]: "Possessor", // -1
|
|
5
6
|
[PlayerType.ISAAC]: "Isaac", // 0
|
|
6
7
|
[PlayerType.MAGDALENE]: "Magdalene", // 1
|
|
@@ -43,4 +44,4 @@ export const CHARACTER_NAMES: { readonly [key in PlayerType]: string } = {
|
|
|
43
44
|
[PlayerType.LAZARUS_2_B]: "Dead Tainted Lazarus", // 38
|
|
44
45
|
[PlayerType.JACOB_2_B]: "Dead Tainted Jacob", // 39
|
|
45
46
|
[PlayerType.SOUL_B]: "Tainted Soul", // 40
|
|
46
|
-
} as const
|
|
47
|
+
} as const satisfies HasAllEnumKeys<PlayerType, string>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CoinSubType } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_COIN_VALUE = 1;
|
|
4
5
|
|
|
5
|
-
export const COIN_SUB_TYPE_TO_VALUE
|
|
6
|
+
export const COIN_SUB_TYPE_TO_VALUE = {
|
|
6
7
|
[CoinSubType.NULL]: 0, // 0
|
|
7
8
|
[CoinSubType.PENNY]: 1, // 1
|
|
8
9
|
[CoinSubType.NICKEL]: 5, // 2
|
|
@@ -11,4 +12,4 @@ export const COIN_SUB_TYPE_TO_VALUE: { readonly [key in CoinSubType]: int } = {
|
|
|
11
12
|
[CoinSubType.LUCKY_PENNY]: 1, // 5
|
|
12
13
|
[CoinSubType.STICKY_NICKEL]: 5, // 6
|
|
13
14
|
[CoinSubType.GOLDEN]: 1, // 7
|
|
14
|
-
} as const
|
|
15
|
+
} as const satisfies HasAllEnumKeys<CoinSubType, int>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Direction } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const DIRECTION_NAMES
|
|
4
|
-
readonly [key in Direction]: string | undefined;
|
|
5
|
-
} = {
|
|
4
|
+
export const DIRECTION_NAMES = {
|
|
6
5
|
[Direction.NO_DIRECTION]: undefined, // -1
|
|
7
6
|
[Direction.LEFT]: "left", // 0
|
|
8
7
|
[Direction.UP]: "up", // 1
|
|
9
8
|
[Direction.RIGHT]: "right", // 2
|
|
10
9
|
[Direction.DOWN]: "down", // 3
|
|
11
|
-
} as const
|
|
10
|
+
} as const satisfies HasAllEnumKeys<Direction, string | undefined>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Direction } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
|
-
export const DIRECTION_TO_DEGREES
|
|
4
|
-
readonly [key in Direction]: int;
|
|
5
|
-
} = {
|
|
4
|
+
export const DIRECTION_TO_DEGREES = {
|
|
6
5
|
[Direction.NO_DIRECTION]: 0, // -1
|
|
7
6
|
[Direction.LEFT]: 180, // 0
|
|
8
7
|
[Direction.UP]: 270, // 1
|
|
9
8
|
[Direction.RIGHT]: 0, // 2
|
|
10
9
|
[Direction.DOWN]: 90, // 3
|
|
11
|
-
} as const
|
|
10
|
+
} as const satisfies HasAllEnumKeys<Direction, int>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Direction } from "isaac-typescript-definitions";
|
|
2
2
|
import { VectorZero } from "../core/constants";
|
|
3
3
|
|
|
4
|
+
// We need the vectors to be read-only, so we specify the type instead of using the `satisfies`
|
|
5
|
+
// operator.
|
|
4
6
|
export const DIRECTION_TO_VECTOR: {
|
|
5
|
-
readonly [
|
|
7
|
+
readonly [Key in Direction]: Readonly<Vector>;
|
|
6
8
|
} = {
|
|
7
9
|
[Direction.NO_DIRECTION]: VectorZero, // -1
|
|
8
10
|
[Direction.LEFT]: Vector(-1, 0), // 0
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { DoorSlot, DoorSlotFlag } from "isaac-typescript-definitions";
|
|
2
|
+
import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_DOOR_SLOT = DoorSlot.NO_DOOR_SLOT;
|
|
4
5
|
|
|
5
|
-
export const DOOR_SLOT_FLAG_TO_DOOR_SLOT
|
|
6
|
-
readonly [key in DoorSlotFlag]: DoorSlot;
|
|
7
|
-
} = {
|
|
6
|
+
export const DOOR_SLOT_FLAG_TO_DOOR_SLOT = {
|
|
8
7
|
[DoorSlotFlag.LEFT_0]: DoorSlot.LEFT_0, // 0
|
|
9
8
|
[DoorSlotFlag.UP_0]: DoorSlot.UP_0, // 1
|
|
10
9
|
[DoorSlotFlag.RIGHT_0]: DoorSlot.RIGHT_0, // 2
|
|
@@ -13,4 +12,4 @@ export const DOOR_SLOT_FLAG_TO_DOOR_SLOT: {
|
|
|
13
12
|
[DoorSlotFlag.UP_1]: DoorSlot.UP_1, // 5
|
|
14
13
|
[DoorSlotFlag.RIGHT_1]: DoorSlot.RIGHT_1, // 6
|
|
15
14
|
[DoorSlotFlag.DOWN_1]: DoorSlot.DOWN_1, // 7
|
|
16
|
-
} as const
|
|
15
|
+
} as const satisfies HasAllEnumKeys<DoorSlotFlag, DoorSlot>;
|
|
@@ -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>;
|