isaacscript-common 46.0.0 → 47.1.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.
Files changed (66) hide show
  1. package/dist/index.rollup.d.ts +109 -19
  2. package/dist/isaacscript-common.lua +202 -16
  3. package/dist/src/functions/cards.d.ts +4 -1
  4. package/dist/src/functions/cards.d.ts.map +1 -1
  5. package/dist/src/functions/cards.lua +4 -1
  6. package/dist/src/functions/collectibles.d.ts +2 -2
  7. package/dist/src/functions/collectibles.lua +2 -2
  8. package/dist/src/functions/pickups.d.ts +64 -1
  9. package/dist/src/functions/pickups.d.ts.map +1 -1
  10. package/dist/src/functions/pickups.lua +84 -0
  11. package/dist/src/functions/pills.d.ts +4 -1
  12. package/dist/src/functions/pills.d.ts.map +1 -1
  13. package/dist/src/functions/pills.lua +4 -1
  14. package/dist/src/functions/stage.d.ts +12 -12
  15. package/dist/src/functions/stage.d.ts.map +1 -1
  16. package/dist/src/functions/stage.lua +21 -21
  17. package/dist/src/functions/trinkets.d.ts +2 -2
  18. package/dist/src/functions/trinkets.lua +2 -2
  19. package/dist/src/index.d.ts +2 -0
  20. package/dist/src/index.d.ts.map +1 -1
  21. package/dist/src/index.lua +16 -0
  22. package/dist/src/objects/batteryNames.d.ts +10 -0
  23. package/dist/src/objects/batteryNames.d.ts.map +1 -0
  24. package/dist/src/objects/batteryNames.lua +13 -0
  25. package/dist/src/objects/bombNames.d.ts +13 -0
  26. package/dist/src/objects/bombNames.d.ts.map +1 -0
  27. package/dist/src/objects/bombNames.lua +16 -0
  28. package/dist/src/objects/chestNames.d.ts +16 -0
  29. package/dist/src/objects/chestNames.d.ts.map +1 -0
  30. package/dist/src/objects/chestNames.lua +19 -0
  31. package/dist/src/objects/coinNames.d.ts +13 -0
  32. package/dist/src/objects/coinNames.d.ts.map +1 -0
  33. package/dist/src/objects/coinNames.lua +16 -0
  34. package/dist/src/objects/heartNames.d.ts +18 -0
  35. package/dist/src/objects/heartNames.d.ts.map +1 -0
  36. package/dist/src/objects/heartNames.lua +21 -0
  37. package/dist/src/objects/keyNames.d.ts +10 -0
  38. package/dist/src/objects/keyNames.d.ts.map +1 -0
  39. package/dist/src/objects/keyNames.lua +13 -0
  40. package/dist/src/objects/{englishLevelNames.d.ts → levelNames.d.ts} +2 -2
  41. package/dist/src/objects/levelNames.d.ts.map +1 -0
  42. package/dist/src/objects/{englishLevelNames.lua → levelNames.lua} +1 -1
  43. package/dist/src/objects/sackNames.d.ts +8 -0
  44. package/dist/src/objects/sackNames.d.ts.map +1 -0
  45. package/dist/src/objects/sackNames.lua +7 -0
  46. package/package.json +1 -1
  47. package/src/functions/cards.ts +4 -1
  48. package/src/functions/collectibles.ts +2 -2
  49. package/src/functions/pickups.ts +108 -0
  50. package/src/functions/pills.ts +4 -1
  51. package/src/functions/stage.ts +26 -26
  52. package/src/functions/trinkets.ts +2 -2
  53. package/src/index.ts +2 -0
  54. package/src/objects/batteryNames.ts +12 -0
  55. package/src/objects/bombNames.ts +16 -0
  56. package/src/objects/cardNames.ts +98 -98
  57. package/src/objects/chestNames.ts +18 -0
  58. package/src/objects/coinNames.ts +15 -0
  59. package/src/objects/heartNames.ts +20 -0
  60. package/src/objects/keyNames.ts +12 -0
  61. package/src/objects/languageNames.ts +7 -7
  62. package/src/objects/{englishLevelNames.ts → levelNames.ts} +26 -1
  63. package/src/objects/pillEffectNames.ts +50 -50
  64. package/src/objects/pillEffectTypes.ts +50 -50
  65. package/src/objects/sackNames.ts +10 -0
  66. package/dist/src/objects/englishLevelNames.d.ts.map +0 -1
@@ -0,0 +1,10 @@
1
+ export declare const DEFAULT_KEY_NAME = "Unknown";
2
+ /** Taken from "entities2.xml". */
3
+ export declare const KEY_NAMES: {
4
+ readonly 0: "Unknown";
5
+ readonly 1: "Key";
6
+ readonly 2: "Golden Key";
7
+ readonly 3: "Key Ring";
8
+ readonly 4: "Charged Key";
9
+ };
10
+ //# sourceMappingURL=keyNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyNames.d.ts","sourceRoot":"","sources":["../../../src/objects/keyNames.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,kCAAkC;AAClC,eAAO,MAAM,SAAS;;;;;;CAMyB,CAAC"}
@@ -0,0 +1,13 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local KeySubType = ____isaac_2Dtypescript_2Ddefinitions.KeySubType
4
+ ____exports.DEFAULT_KEY_NAME = "Unknown"
5
+ --- Taken from "entities2.xml".
6
+ ____exports.KEY_NAMES = {
7
+ [KeySubType.NULL] = ____exports.DEFAULT_KEY_NAME,
8
+ [KeySubType.NORMAL] = "Key",
9
+ [KeySubType.GOLDEN] = "Golden Key",
10
+ [KeySubType.DOUBLE_PACK] = "Key Ring",
11
+ [KeySubType.CHARGED] = "Charged Key"
12
+ }
13
+ return ____exports
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Note that this contains "Blue Womb" instead of "???" for stage 9.
8
8
  */
9
- export declare const ENGLISH_LEVEL_NAMES: {
9
+ export declare const LEVEL_NAMES: {
10
10
  readonly 1: {
11
11
  readonly 0: "Basement 1";
12
12
  readonly 1: "Cellar 1";
@@ -112,4 +112,4 @@ export declare const ENGLISH_LEVEL_NAMES: {
112
112
  readonly 5: "Home";
113
113
  };
114
114
  };
115
- //# sourceMappingURL=englishLevelNames.d.ts.map
115
+ //# sourceMappingURL=levelNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"levelNames.d.ts","sourceRoot":"","sources":["../../../src/objects/levelNames.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkI0C,CAAC"}
@@ -8,7 +8,7 @@ local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
8
8
  -- which will not display correctly on some fonts.
9
9
  --
10
10
  -- Note that this contains "Blue Womb" instead of "???" for stage 9.
11
- ____exports.ENGLISH_LEVEL_NAMES = {
11
+ ____exports.LEVEL_NAMES = {
12
12
  [LevelStage.BASEMENT_1] = {
13
13
  [StageType.ORIGINAL] = "Basement 1",
14
14
  [StageType.WRATH_OF_THE_LAMB] = "Cellar 1",
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_SACK_NAME = "Unknown";
2
+ /** Taken from "entities2.xml". */
3
+ export declare const SACK_NAMES: {
4
+ readonly 0: "Unknown";
5
+ readonly 1: "Grab Bag";
6
+ readonly 2: "Black Sack";
7
+ };
8
+ //# sourceMappingURL=sackNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sackNames.d.ts","sourceRoot":"","sources":["../../../src/objects/sackNames.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,kCAAkC;AAClC,eAAO,MAAM,UAAU;;;;CAIyB,CAAC"}
@@ -0,0 +1,7 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local SackSubType = ____isaac_2Dtypescript_2Ddefinitions.SackSubType
4
+ ____exports.DEFAULT_SACK_NAME = "Unknown"
5
+ --- Taken from "entities2.xml".
6
+ ____exports.SACK_NAMES = {[SackSubType.NULL] = ____exports.DEFAULT_SACK_NAME, [SackSubType.NORMAL] = "Grab Bag", [SackSubType.BLACK] = "Black Sack"}
7
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "46.0.0",
3
+ "version": "47.1.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -34,7 +34,10 @@ export function getCardDescription(cardType: CardType): string {
34
34
  }
35
35
 
36
36
  /**
37
- * Helper function to get a card name from a Card.
37
+ * Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
38
+ * valid.
39
+ *
40
+ * This function works for both vanilla and modded trinkets.
38
41
  *
39
42
  * For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
40
43
  */
@@ -314,9 +314,9 @@ export function getCollectibleMaxCharges(
314
314
  * Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
315
315
  * type is not valid.
316
316
  *
317
- * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
318
- *
319
317
  * This function works for both vanilla and modded collectibles.
318
+ *
319
+ * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
320
320
  */
321
321
  export function getCollectibleName(
322
322
  collectibleOrCollectibleType: EntityPickup | CollectibleType,
@@ -1,18 +1,84 @@
1
1
  import type {
2
+ BatterySubType,
3
+ BombSubType,
2
4
  CoinSubType,
3
5
  HeartSubType,
6
+ KeySubType,
4
7
  PickupVariant,
8
+ SackSubType,
5
9
  } from "isaac-typescript-definitions";
6
10
  import { CHEST_PICKUP_VARIANTS_SET } from "../core/constants";
11
+ import { BATTERY_NAMES, DEFAULT_BATTERY_NAME } from "../objects/batteryNames";
12
+ import { BOMB_NAMES, DEFAULT_BOMB_NAME } from "../objects/bombNames";
13
+ import { CHEST_NAMES } from "../objects/chestNames";
14
+ import { COIN_NAMES, DEFAULT_COIN_NAME } from "../objects/coinNames";
7
15
  import {
8
16
  COIN_SUB_TYPE_TO_VALUE,
9
17
  DEFAULT_COIN_VALUE,
10
18
  } from "../objects/coinSubTypeToValue";
19
+ import { DEFAULT_HEART_NAME, HEART_NAMES } from "../objects/heartNames";
20
+ import { DEFAULT_KEY_NAME, KEY_NAMES } from "../objects/keyNames";
21
+ import { DEFAULT_SACK_NAME, SACK_NAMES } from "../objects/sackNames";
11
22
  import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
12
23
  import { removeEntities } from "./entities";
13
24
  import { isHeart } from "./pickupVariants";
14
25
  import { getHearts } from "./pickupsSpecific";
15
26
 
27
+ /**
28
+ * Helper function to get the name of a battery, as listed in the "entities2.xml" file. Returns
29
+ * "Unknown" if the provided battery sub-type is not valid.
30
+ *
31
+ * This function only works for vanilla battery types.
32
+ *
33
+ * For example, `getBatteryName(BatterySubType.MICRO)` would return "Micro Battery".
34
+ */
35
+ export function getBatteryName(batterySubType: BatterySubType): string {
36
+ // Handle modded hearts.
37
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
38
+ return BATTERY_NAMES[batterySubType] ?? DEFAULT_BATTERY_NAME;
39
+ }
40
+
41
+ /**
42
+ * Helper function to get the name of a bomb, as listed in the "entities2.xml" file. Returns
43
+ * "Unknown" if the provided bomb sub-type is not valid.
44
+ *
45
+ * This function only works for vanilla bomb types.
46
+ *
47
+ * For example, `getBombName(BombSubType.DOUBLE_PACK)` would return "Double Bomb".
48
+ */
49
+ export function getBombName(bombSubType: BombSubType): string {
50
+ // Handle modded bombs.
51
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
52
+ return BOMB_NAMES[bombSubType] ?? DEFAULT_BOMB_NAME;
53
+ }
54
+
55
+ /**
56
+ * Helper function to get the name of a chest, as listed in the "entities2.xml" file. Returns
57
+ * "Unknown" if the pickup variant was not a chest.
58
+ *
59
+ * This function only works for vanilla chest types.
60
+ *
61
+ * For example, `getChestName(PickupVariant.SPIKED_CHEST)` would return "Spiked Chest".
62
+ */
63
+ export function getChestName(pickupVariant: PickupVariant): string {
64
+ const chestNames = CHEST_NAMES as Partial<Record<PickupVariant, string>>;
65
+ return chestNames[pickupVariant] ?? "Unknown";
66
+ }
67
+
68
+ /**
69
+ * Helper function to get the name of a coin, as listed in the "entities2.xml" file. Returns
70
+ * "Unknown" if the provided coin sub-type is not valid.
71
+ *
72
+ * This function only works for vanilla chest types.
73
+ *
74
+ * For example, `getCoinName(CoinSubType.DOUBLE_PACK)` would return "Double Penny".
75
+ */
76
+ export function getCoinName(coinSubType: CoinSubType): string {
77
+ // Handle modded coins.
78
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
79
+ return COIN_NAMES[coinSubType] ?? DEFAULT_COIN_NAME;
80
+ }
81
+
16
82
  /**
17
83
  * Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
18
84
  * sub-types.
@@ -24,12 +90,54 @@ export function getCoinValue(coinSubType: CoinSubType): int {
24
90
  return value ?? DEFAULT_COIN_VALUE;
25
91
  }
26
92
 
93
+ /**
94
+ * Helper function to get the name of a heart, as listed in the "entities2.xml" file. Returns
95
+ * "Unknown" if the provided heart sub-type is not valid.
96
+ *
97
+ * This function only works for vanilla heart types.
98
+ *
99
+ * For example, `getHeartName(HeartSubType.ETERNAL)` would return "Heart (eternal)".
100
+ */
101
+ export function getHeartName(heartSubType: HeartSubType): string {
102
+ // Handle modded hearts.
103
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
104
+ return HEART_NAMES[heartSubType] ?? DEFAULT_HEART_NAME;
105
+ }
106
+
107
+ /**
108
+ * Helper function to get the name of a key, as listed in the "entities2.xml" file. Returns
109
+ * "Unknown" if the provided key sub-type is not valid.
110
+ *
111
+ * This function only works for vanilla key types.
112
+ *
113
+ * For example, `getKeyName(KeySubType.DOUBLE_PACK)` would return "Key Ring".
114
+ */
115
+ export function getKeyName(keySubType: KeySubType): string {
116
+ // Handle modded bombs.
117
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
118
+ return KEY_NAMES[keySubType] ?? DEFAULT_KEY_NAME;
119
+ }
120
+
27
121
  /** Helper function to get all of the red heart pickup entities in the room. */
28
122
  export function getRedHearts(): EntityPickupHeart[] {
29
123
  const hearts = getHearts();
30
124
  return hearts.filter((heart) => RED_HEART_SUB_TYPES_SET.has(heart.SubType));
31
125
  }
32
126
 
127
+ /**
128
+ * Helper function to get the name of a sack, as listed in the "entities2.xml" file. Returns
129
+ * "Unknown" if the provided sack sub-type is not valid.
130
+ *
131
+ * This function only works for vanilla sack types.
132
+ *
133
+ * For example, `getSackName(SackSubType.NORMAL)` would return "Grab Bag".
134
+ */
135
+ export function getSackName(sackSubType: SackSubType): string {
136
+ // Handle modded hearts.
137
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
138
+ return SACK_NAMES[sackSubType] ?? DEFAULT_SACK_NAME;
139
+ }
140
+
33
141
  /** Helper function to test if the provided pickup matches one of the various chest variants. */
34
142
  export function isChest(pickup: EntityPickup): boolean {
35
143
  return isChestVariant(pickup.Variant);
@@ -149,7 +149,10 @@ export function getPillEffectClass(
149
149
  }
150
150
 
151
151
  /**
152
- * Helper function to get a pill effect name from a PillEffect enum value.
152
+ * Helper function to get a pill effect name from a `PillEffect`. Returns "Unknown" if the provided
153
+ * pill effect is not valid.
154
+ *
155
+ * This function works for both vanilla and modded pill effects.
153
156
  *
154
157
  * For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
155
158
  */
@@ -6,7 +6,7 @@ import {
6
6
  StageType,
7
7
  } from "isaac-typescript-definitions";
8
8
  import { game } from "../core/cachedClasses";
9
- import { ENGLISH_LEVEL_NAMES } from "../objects/englishLevelNames";
9
+ import { LEVEL_NAMES } from "../objects/levelNames";
10
10
  import { ROOM_TYPE_SPECIAL_GOTO_PREFIXES } from "../objects/roomTypeSpecialGotoPrefixes";
11
11
  import { STAGE_TO_STAGE_ID } from "../objects/stageToStageID";
12
12
  import { STAGE_TYPE_SUFFIXES } from "../objects/stageTypeSuffixes";
@@ -90,6 +90,29 @@ export function getEffectiveStage(): LevelStage {
90
90
  return stage;
91
91
  }
92
92
 
93
+ /**
94
+ * Helper function to get the corresponding "goto" console command that would correspond to the
95
+ * provided room type and room variant.
96
+ *
97
+ * @param roomType The `RoomType` of the destination room.
98
+ * @param roomVariant The variant of the destination room.
99
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
100
+ * the `goto` command (instead of `d`) if the room type is
101
+ * `RoomType.DEFAULT` (1). False by default.
102
+ */
103
+ export function getGotoCommand(
104
+ roomType: RoomType,
105
+ roomVariant: int,
106
+ useSpecialRoomsForRoomTypeDefault = false,
107
+ ): string {
108
+ const isNormalRoom =
109
+ roomType === RoomType.DEFAULT && !useSpecialRoomsForRoomTypeDefault;
110
+ const roomTypeSpecialGotoPrefix = ROOM_TYPE_SPECIAL_GOTO_PREFIXES[roomType];
111
+ const prefix = isNormalRoom ? "d" : `s.${roomTypeSpecialGotoPrefix}`;
112
+
113
+ return `goto ${prefix}.${roomVariant}`;
114
+ }
115
+
93
116
  /**
94
117
  * Helper function to get the English name of the level. For example, "Caves 1".
95
118
  *
@@ -101,7 +124,7 @@ export function getEffectiveStage(): LevelStage {
101
124
  * @param stage Optional. If not specified, the current stage will be used.
102
125
  * @param stageType Optional. If not specified, the current stage type will be used.
103
126
  */
104
- export function getEnglishLevelName(
127
+ export function getLevelName(
105
128
  stage?: LevelStage,
106
129
  stageType?: StageType,
107
130
  ): string {
@@ -115,33 +138,10 @@ export function getEnglishLevelName(
115
138
  stageType = level.GetStageType();
116
139
  }
117
140
 
118
- const stageNames = ENGLISH_LEVEL_NAMES[stage];
141
+ const stageNames = LEVEL_NAMES[stage];
119
142
  return stageNames[stageType];
120
143
  }
121
144
 
122
- /**
123
- * Helper function to get the corresponding "goto" console command that would correspond to the
124
- * provided room type and room variant.
125
- *
126
- * @param roomType The `RoomType` of the destination room.
127
- * @param roomVariant The variant of the destination room.
128
- * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
129
- * the `goto` command (instead of `d`) if the room type is
130
- * `RoomType.DEFAULT` (1). False by default.
131
- */
132
- export function getGotoCommand(
133
- roomType: RoomType,
134
- roomVariant: int,
135
- useSpecialRoomsForRoomTypeDefault = false,
136
- ): string {
137
- const isNormalRoom =
138
- roomType === RoomType.DEFAULT && !useSpecialRoomsForRoomTypeDefault;
139
- const roomTypeSpecialGotoPrefix = ROOM_TYPE_SPECIAL_GOTO_PREFIXES[roomType];
140
- const prefix = isNormalRoom ? "d" : `s.${roomTypeSpecialGotoPrefix}`;
141
-
142
- return `goto ${prefix}.${roomVariant}`;
143
- }
144
-
145
145
  /** Alias for the `Level.GetStage` method. */
146
146
  export function getStage(): LevelStage {
147
147
  const level = game.GetLevel();
@@ -121,9 +121,9 @@ export function getTrinketGfxFilename(trinketType: TrinketType): string {
121
121
  * Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
122
122
  * not valid.
123
123
  *
124
- * For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
125
- *
126
124
  * This function works for both vanilla and modded trinkets.
125
+ *
126
+ * For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
127
127
  */
128
128
  export function getTrinketName(trinketType: TrinketType): string {
129
129
  // "ItemConfigItem.Name" is bugged with vanilla items on patch v1.7.6, so we use a hard-coded map
package/src/index.ts CHANGED
@@ -146,9 +146,11 @@ export * from "./interfaces/TSTLClassMetatable";
146
146
  export * from "./interfaces/TrinketSituation";
147
147
  export * from "./maps/cardNameToTypeMap";
148
148
  export * from "./maps/characterNameToTypeMap";
149
+ export * from "./maps/collectibleNameToTypeMap";
149
150
  export * from "./maps/pillNameToEffectMap";
150
151
  export * from "./maps/roomNameToTypeMap";
151
152
  export * from "./maps/transformationNameToPlayerFormMap";
153
+ export * from "./maps/trinketNameToTypeMap";
152
154
  export * from "./objects/colors";
153
155
  export * from "./objects/kColors";
154
156
  export * from "./types/AddSubtract";
@@ -0,0 +1,12 @@
1
+ import { BatterySubType } from "isaac-typescript-definitions";
2
+
3
+ export const DEFAULT_BATTERY_NAME = "Unknown";
4
+
5
+ /** Taken from "entities2.xml". */
6
+ export const BATTERY_NAMES = {
7
+ [BatterySubType.NULL]: DEFAULT_BATTERY_NAME, // 0
8
+ [BatterySubType.NORMAL]: "Lil' Battery", // 1
9
+ [BatterySubType.MICRO]: "Micro Battery", // 2
10
+ [BatterySubType.MEGA]: "Mega Battery", // 3
11
+ [BatterySubType.GOLDEN]: "Golden Battery", // 4
12
+ } as const satisfies Record<BatterySubType, string>;
@@ -0,0 +1,16 @@
1
+ import { BombSubType } from "isaac-typescript-definitions";
2
+
3
+ export const DEFAULT_BOMB_NAME = "Unknown";
4
+
5
+ /** Taken from "entities2.xml". */
6
+ export const BOMB_NAMES = {
7
+ [BombSubType.NULL]: DEFAULT_BOMB_NAME, // 0
8
+ [BombSubType.NORMAL]: "Bomb", // 1
9
+ [BombSubType.DOUBLE_PACK]: "Double Bomb", // 2
10
+ [BombSubType.TROLL]: "Troll Bomb", // 3
11
+ [BombSubType.GOLDEN]: "Golden Bomb", // 4
12
+ [BombSubType.MEGA_TROLL]: "Megatroll Bomb", // 5
13
+ // The entry for "Golden Troll Bomb" is absent in "entities2.xml", so we infer the name.
14
+ [BombSubType.GOLDEN_TROLL]: "Golden Troll Bomb", // 6
15
+ [BombSubType.GIGA]: "Giga Bomb", // 7
16
+ } as const satisfies Record<BombSubType, string>;
@@ -4,102 +4,102 @@ export const DEFAULT_CARD_NAME = "Unknown";
4
4
 
5
5
  /** This is a temporary map due to missing features in the vanilla API. */
6
6
  export const CARD_NAMES = {
7
- [CardType.NULL]: DEFAULT_CARD_NAME,
8
- [CardType.FOOL]: "0 - The Fool",
9
- [CardType.MAGICIAN]: "I - The Magician",
10
- [CardType.HIGH_PRIESTESS]: "II - The High Priestess",
11
- [CardType.EMPRESS]: "III - The Empress",
12
- [CardType.EMPEROR]: "IV - The Emperor",
13
- [CardType.HIEROPHANT]: "V - The Hierophant",
14
- [CardType.LOVERS]: "VI - The Lovers",
15
- [CardType.CHARIOT]: "VII - The Chariot",
16
- [CardType.JUSTICE]: "VIII - Justice",
17
- [CardType.HERMIT]: "IX - The Hermit",
18
- [CardType.WHEEL_OF_FORTUNE]: "X - Wheel of Fortune",
19
- [CardType.STRENGTH]: "XI - Strength",
20
- [CardType.HANGED_MAN]: "XII - The Hanged Man",
21
- [CardType.DEATH]: "XIII - Death",
22
- [CardType.TEMPERANCE]: "XIV - Temperance",
23
- [CardType.DEVIL]: "XV - The Devil",
24
- [CardType.TOWER]: "XVI - The Tower",
25
- [CardType.STARS]: "XVII - The Stars",
26
- [CardType.MOON]: "XVIII - The Moon",
27
- [CardType.SUN]: "XIX - The Sun",
28
- [CardType.JUDGEMENT]: "XX - Judgement",
29
- [CardType.WORLD]: "XXI - The World",
30
- [CardType.CLUBS_2]: "2 of Clubs",
31
- [CardType.DIAMONDS_2]: "2 of Diamonds",
32
- [CardType.SPADES_2]: "2 of Spades",
33
- [CardType.HEARTS_2]: "2 of Hearts",
34
- [CardType.ACE_OF_CLUBS]: "Ace of Clubs",
35
- [CardType.ACE_OF_DIAMONDS]: "Ace of Diamonds",
36
- [CardType.ACE_OF_SPADES]: "Ace of Spades",
37
- [CardType.ACE_OF_HEARTS]: "Ace of Hearts",
38
- [CardType.JOKER]: "Joker",
39
- [CardType.RUNE_HAGALAZ]: "Hagalaz",
40
- [CardType.RUNE_JERA]: "Jera",
41
- [CardType.RUNE_EHWAZ]: "Ehwaz",
42
- [CardType.RUNE_DAGAZ]: "Dagaz",
43
- [CardType.RUNE_ANSUZ]: "Ansuz",
44
- [CardType.RUNE_PERTHRO]: "Perthro",
45
- [CardType.RUNE_BERKANO]: "Berkano",
46
- [CardType.RUNE_ALGIZ]: "Algiz",
47
- [CardType.RUNE_BLANK]: "Blank Rune",
48
- [CardType.RUNE_BLACK]: "Black Rune",
49
- [CardType.CHAOS]: "Chaos Card",
50
- [CardType.CREDIT]: "Credit Card",
51
- [CardType.RULES]: "Rules Card",
52
- [CardType.AGAINST_HUMANITY]: "A Card Against Humanity",
53
- [CardType.SUICIDE_KING]: "Suicide King",
54
- [CardType.GET_OUT_OF_JAIL_FREE]: "Get Out Of Jail Free Card",
55
- [CardType.QUESTION_MARK]: "? Card",
56
- [CardType.DICE_SHARD]: "Dice Shard",
57
- [CardType.EMERGENCY_CONTACT]: "Emergency Contact",
58
- [CardType.HOLY]: "Holy Card",
59
- [CardType.HUGE_GROWTH]: "Huge Growth",
60
- [CardType.ANCIENT_RECALL]: "Ancient Recall",
61
- [CardType.ERA_WALK]: "Era Walk",
62
- [CardType.RUNE_SHARD]: "Rune Shard",
63
- [CardType.REVERSE_FOOL]: "0 - The Fool?",
64
- [CardType.REVERSE_MAGICIAN]: "I - The Magician?",
65
- [CardType.REVERSE_HIGH_PRIESTESS]: "II - The High Priestess?",
66
- [CardType.REVERSE_EMPRESS]: "III - The Empress?",
67
- [CardType.REVERSE_EMPEROR]: "IV - The Emperor?",
68
- [CardType.REVERSE_HIEROPHANT]: "V - The Hierophant?",
69
- [CardType.REVERSE_LOVERS]: "VI - The Lovers?",
70
- [CardType.REVERSE_CHARIOT]: "VII - The Chariot?",
71
- [CardType.REVERSE_JUSTICE]: "VIII - Justice?",
72
- [CardType.REVERSE_HERMIT]: "IX - The Hermit?",
73
- [CardType.REVERSE_WHEEL_OF_FORTUNE]: "X - Wheel of Fortune?",
74
- [CardType.REVERSE_STRENGTH]: "XI - Strength?",
75
- [CardType.REVERSE_HANGED_MAN]: "XII - The Hanged Man?",
76
- [CardType.REVERSE_DEATH]: "XIII - Death?",
77
- [CardType.REVERSE_TEMPERANCE]: "XIV - Temperance?",
78
- [CardType.REVERSE_DEVIL]: "XV - The Devil?",
79
- [CardType.REVERSE_TOWER]: "XVI - The Tower?",
80
- [CardType.REVERSE_STARS]: "XVII - The Stars?",
81
- [CardType.REVERSE_MOON]: "XVIII - The Moon?",
82
- [CardType.REVERSE_SUN]: "XIX - The Sun?",
83
- [CardType.REVERSE_JUDGEMENT]: "XX - Judgement?",
84
- [CardType.REVERSE_WORLD]: "XXI - The World?",
85
- [CardType.CRACKED_KEY]: "Cracked Key",
86
- [CardType.QUEEN_OF_HEARTS]: "Queen of Hearts",
87
- [CardType.WILD]: "Wild Card",
88
- [CardType.SOUL_ISAAC]: "Soul of Isaac",
89
- [CardType.SOUL_MAGDALENE]: "Soul of Magdalene",
90
- [CardType.SOUL_CAIN]: "Soul of Cain",
91
- [CardType.SOUL_JUDAS]: "Soul of Judas",
92
- [CardType.SOUL_BLUE_BABY]: "Soul of ???",
93
- [CardType.SOUL_EVE]: "Soul of Eve",
94
- [CardType.SOUL_SAMSON]: "Soul of Samson",
95
- [CardType.SOUL_AZAZEL]: "Soul of Azazel",
96
- [CardType.SOUL_LAZARUS]: "Soul of Lazarus",
97
- [CardType.SOUL_EDEN]: "Soul of Eden",
98
- [CardType.SOUL_LOST]: "Soul of the Lost",
99
- [CardType.SOUL_LILITH]: "Soul of Lilith",
100
- [CardType.SOUL_KEEPER]: "Soul of the Keeper",
101
- [CardType.SOUL_APOLLYON]: "Soul of Apollyon",
102
- [CardType.SOUL_FORGOTTEN]: "Soul of the Forgotten",
103
- [CardType.SOUL_BETHANY]: "Soul of Bethany",
104
- [CardType.SOUL_JACOB]: "Soul of Jacob and Esau",
7
+ [CardType.NULL]: DEFAULT_CARD_NAME, // 0
8
+ [CardType.FOOL]: "0 - The Fool", // 1
9
+ [CardType.MAGICIAN]: "I - The Magician", // 2
10
+ [CardType.HIGH_PRIESTESS]: "II - The High Priestess", // 3
11
+ [CardType.EMPRESS]: "III - The Empress", // 4
12
+ [CardType.EMPEROR]: "IV - The Emperor", // 5
13
+ [CardType.HIEROPHANT]: "V - The Hierophant", // 6
14
+ [CardType.LOVERS]: "VI - The Lovers", // 7
15
+ [CardType.CHARIOT]: "VII - The Chariot", // 8
16
+ [CardType.JUSTICE]: "VIII - Justice", // 9
17
+ [CardType.HERMIT]: "IX - The Hermit", // 10
18
+ [CardType.WHEEL_OF_FORTUNE]: "X - Wheel of Fortune", // 11
19
+ [CardType.STRENGTH]: "XI - Strength", // 12
20
+ [CardType.HANGED_MAN]: "XII - The Hanged Man", // 13
21
+ [CardType.DEATH]: "XIII - Death", // 14
22
+ [CardType.TEMPERANCE]: "XIV - Temperance", // 15
23
+ [CardType.DEVIL]: "XV - The Devil", // 16
24
+ [CardType.TOWER]: "XVI - The Tower", // 17
25
+ [CardType.STARS]: "XVII - The Stars", // 18
26
+ [CardType.MOON]: "XVIII - The Moon", // 19
27
+ [CardType.SUN]: "XIX - The Sun", // 20
28
+ [CardType.JUDGEMENT]: "XX - Judgement", // 21
29
+ [CardType.WORLD]: "XXI - The World", // 22
30
+ [CardType.CLUBS_2]: "2 of Clubs", // 23
31
+ [CardType.DIAMONDS_2]: "2 of Diamonds", // 24
32
+ [CardType.SPADES_2]: "2 of Spades", // 25
33
+ [CardType.HEARTS_2]: "2 of Hearts", // 26
34
+ [CardType.ACE_OF_CLUBS]: "Ace of Clubs", // 27
35
+ [CardType.ACE_OF_DIAMONDS]: "Ace of Diamonds", // 28
36
+ [CardType.ACE_OF_SPADES]: "Ace of Spades", // 29
37
+ [CardType.ACE_OF_HEARTS]: "Ace of Hearts", // 30
38
+ [CardType.JOKER]: "Joker", // 31
39
+ [CardType.RUNE_HAGALAZ]: "Hagalaz", // 32
40
+ [CardType.RUNE_JERA]: "Jera", // 33
41
+ [CardType.RUNE_EHWAZ]: "Ehwaz", // 34
42
+ [CardType.RUNE_DAGAZ]: "Dagaz", // 35
43
+ [CardType.RUNE_ANSUZ]: "Ansuz", // 36
44
+ [CardType.RUNE_PERTHRO]: "Perthro", // 37
45
+ [CardType.RUNE_BERKANO]: "Berkano", // 38
46
+ [CardType.RUNE_ALGIZ]: "Algiz", // 39
47
+ [CardType.RUNE_BLANK]: "Blank Rune", // 40
48
+ [CardType.RUNE_BLACK]: "Black Rune", // 41
49
+ [CardType.CHAOS]: "Chaos Card", // 42
50
+ [CardType.CREDIT]: "Credit Card", // 43
51
+ [CardType.RULES]: "Rules Card", // 44
52
+ [CardType.AGAINST_HUMANITY]: "A Card Against Humanity", // 45
53
+ [CardType.SUICIDE_KING]: "Suicide King", // 46
54
+ [CardType.GET_OUT_OF_JAIL_FREE]: "Get Out Of Jail Free Card", // 47
55
+ [CardType.QUESTION_MARK]: "? Card", // 48
56
+ [CardType.DICE_SHARD]: "Dice Shard", // 49
57
+ [CardType.EMERGENCY_CONTACT]: "Emergency Contact", // 50
58
+ [CardType.HOLY]: "Holy Card", // 51
59
+ [CardType.HUGE_GROWTH]: "Huge Growth", // 52
60
+ [CardType.ANCIENT_RECALL]: "Ancient Recall", // 53
61
+ [CardType.ERA_WALK]: "Era Walk", // 54
62
+ [CardType.RUNE_SHARD]: "Rune Shard", // 55
63
+ [CardType.REVERSE_FOOL]: "0 - The Fool?", // 56
64
+ [CardType.REVERSE_MAGICIAN]: "I - The Magician?", // 57
65
+ [CardType.REVERSE_HIGH_PRIESTESS]: "II - The High Priestess?", // 58
66
+ [CardType.REVERSE_EMPRESS]: "III - The Empress?", // 59
67
+ [CardType.REVERSE_EMPEROR]: "IV - The Emperor?", // 60
68
+ [CardType.REVERSE_HIEROPHANT]: "V - The Hierophant?", // 61
69
+ [CardType.REVERSE_LOVERS]: "VI - The Lovers?", // 62
70
+ [CardType.REVERSE_CHARIOT]: "VII - The Chariot?", // 63
71
+ [CardType.REVERSE_JUSTICE]: "VIII - Justice?", // 64
72
+ [CardType.REVERSE_HERMIT]: "IX - The Hermit?", // 65
73
+ [CardType.REVERSE_WHEEL_OF_FORTUNE]: "X - Wheel of Fortune?", // 66
74
+ [CardType.REVERSE_STRENGTH]: "XI - Strength?", // 67
75
+ [CardType.REVERSE_HANGED_MAN]: "XII - The Hanged Man?", // 68
76
+ [CardType.REVERSE_DEATH]: "XIII - Death?", // 69
77
+ [CardType.REVERSE_TEMPERANCE]: "XIV - Temperance?", // 70
78
+ [CardType.REVERSE_DEVIL]: "XV - The Devil?", // 71
79
+ [CardType.REVERSE_TOWER]: "XVI - The Tower?", // 72
80
+ [CardType.REVERSE_STARS]: "XVII - The Stars?", // 73
81
+ [CardType.REVERSE_MOON]: "XVIII - The Moon?", // 74
82
+ [CardType.REVERSE_SUN]: "XIX - The Sun?", // 75
83
+ [CardType.REVERSE_JUDGEMENT]: "XX - Judgement?", // 76
84
+ [CardType.REVERSE_WORLD]: "XXI - The World?", // 77
85
+ [CardType.CRACKED_KEY]: "Cracked Key", // 78
86
+ [CardType.QUEEN_OF_HEARTS]: "Queen of Hearts", // 79
87
+ [CardType.WILD]: "Wild Card", // 80
88
+ [CardType.SOUL_ISAAC]: "Soul of Isaac", // 81
89
+ [CardType.SOUL_MAGDALENE]: "Soul of Magdalene", // 82
90
+ [CardType.SOUL_CAIN]: "Soul of Cain", // 83
91
+ [CardType.SOUL_JUDAS]: "Soul of Judas", // 84
92
+ [CardType.SOUL_BLUE_BABY]: "Soul of ???", // 85
93
+ [CardType.SOUL_EVE]: "Soul of Eve", // 86
94
+ [CardType.SOUL_SAMSON]: "Soul of Samson", // 87
95
+ [CardType.SOUL_AZAZEL]: "Soul of Azazel", // 88
96
+ [CardType.SOUL_LAZARUS]: "Soul of Lazarus", // 89
97
+ [CardType.SOUL_EDEN]: "Soul of Eden", // 90
98
+ [CardType.SOUL_LOST]: "Soul of the Lost", // 91
99
+ [CardType.SOUL_LILITH]: "Soul of Lilith", // 92
100
+ [CardType.SOUL_KEEPER]: "Soul of the Keeper", // 93
101
+ [CardType.SOUL_APOLLYON]: "Soul of Apollyon", // 94
102
+ [CardType.SOUL_FORGOTTEN]: "Soul of the Forgotten", // 95
103
+ [CardType.SOUL_BETHANY]: "Soul of Bethany", // 96
104
+ [CardType.SOUL_JACOB]: "Soul of Jacob and Esau", // 97
105
105
  } as const satisfies Record<CardType, string>;
@@ -0,0 +1,18 @@
1
+ import { PickupVariant } from "isaac-typescript-definitions";
2
+ import type { CHEST_PICKUP_VARIANTS } from "../core/constants";
3
+
4
+ /** Taken from "entities2.xml". */
5
+ export const CHEST_NAMES = {
6
+ [PickupVariant.CHEST]: "Chest", // 50
7
+ [PickupVariant.BOMB_CHEST]: "Bomb Chest", // 51
8
+ [PickupVariant.SPIKED_CHEST]: "Spiked Chest", // 52
9
+ [PickupVariant.ETERNAL_CHEST]: "Eternal Chest", // 53
10
+ [PickupVariant.MIMIC_CHEST]: "Mimic Chest", // 54
11
+ [PickupVariant.OLD_CHEST]: "Old Chest", // 55
12
+ [PickupVariant.WOODEN_CHEST]: "Wooden Chest", // 56
13
+ [PickupVariant.MEGA_CHEST]: "Mega Chest", // 57
14
+ [PickupVariant.HAUNTED_CHEST]: "Haunted Chest", // 58
15
+ [PickupVariant.LOCKED_CHEST]: "Locked Chest", // 60
16
+ [PickupVariant.RED_CHEST]: "Red Chest", // 360
17
+ [PickupVariant.MOMS_CHEST]: "Mom's Chest", // 390
18
+ } as const satisfies Record<(typeof CHEST_PICKUP_VARIANTS)[number], string>;
@@ -0,0 +1,15 @@
1
+ import { CoinSubType } from "isaac-typescript-definitions";
2
+
3
+ export const DEFAULT_COIN_NAME = "Unknown";
4
+
5
+ /** Taken from "entities2.xml". */
6
+ export const COIN_NAMES = {
7
+ [CoinSubType.NULL]: DEFAULT_COIN_NAME, // 0
8
+ [CoinSubType.PENNY]: "Penny", // 1
9
+ [CoinSubType.NICKEL]: "Nickel", // 2
10
+ [CoinSubType.DIME]: "Dime", // 3
11
+ [CoinSubType.DOUBLE_PACK]: "Double Penny", // 4
12
+ [CoinSubType.LUCKY_PENNY]: "Lucky Penny", // 5
13
+ [CoinSubType.STICKY_NICKEL]: "Sticky Nickel", // 6
14
+ [CoinSubType.GOLDEN]: "Golden Penny", // 7
15
+ } as const satisfies Record<CoinSubType, string>;