isaacscript-common 9.13.5 → 9.15.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 (90) hide show
  1. package/dist/features/extraConsoleCommands/listCommands.d.ts +4 -0
  2. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  3. package/dist/features/extraConsoleCommands/listCommands.lua +81 -19
  4. package/dist/functions/collectibles.lua +4 -4
  5. package/dist/functions/gridEntitiesSpecific.d.ts +3 -0
  6. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
  7. package/dist/functions/gridEntitiesSpecific.lua +6 -0
  8. package/dist/functions/string.d.ts +2 -0
  9. package/dist/functions/string.d.ts.map +1 -1
  10. package/dist/functions/string.lua +5 -0
  11. package/dist/functions/trinkets.d.ts.map +1 -1
  12. package/dist/functions/trinkets.lua +4 -4
  13. package/dist/index.d.ts +13 -7
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.lua +4 -4
  16. package/dist/maps/cardNameToTypeMap.d.ts +4 -0
  17. package/dist/maps/cardNameToTypeMap.d.ts.map +1 -0
  18. package/dist/maps/{cardMap.lua → cardNameToTypeMap.lua} +2 -2
  19. package/dist/maps/characterNameToTypeMap.d.ts +4 -0
  20. package/dist/maps/characterNameToTypeMap.d.ts.map +1 -0
  21. package/dist/maps/characterNameToTypeMap.lua +92 -0
  22. package/dist/maps/collectibleDescriptionMap.d.ts +6 -0
  23. package/dist/maps/collectibleDescriptionMap.d.ts.map +1 -1
  24. package/dist/maps/collectibleDescriptionMap.lua +4 -0
  25. package/dist/maps/collectibleNameToTypeMap.d.ts +3 -0
  26. package/dist/maps/collectibleNameToTypeMap.d.ts.map +1 -0
  27. package/dist/maps/collectibleNameToTypeMap.lua +21 -0
  28. package/dist/maps/collectibleTypeToNameMap.d.ts +12 -0
  29. package/dist/maps/collectibleTypeToNameMap.d.ts.map +1 -0
  30. package/dist/maps/{collectibleNameMap.lua → collectibleTypeToNameMap.lua} +7 -1
  31. package/dist/maps/{pillEffectMap.d.ts → pillNameToEffectMap.d.ts} +2 -2
  32. package/dist/maps/pillNameToEffectMap.d.ts.map +1 -0
  33. package/dist/maps/{pillEffectMap.lua → pillNameToEffectMap.lua} +1 -1
  34. package/dist/maps/roomNameToTypeMap.d.ts +4 -0
  35. package/dist/maps/roomNameToTypeMap.d.ts.map +1 -0
  36. package/dist/maps/{roomTypeMap.lua → roomNameToTypeMap.lua} +2 -2
  37. package/dist/maps/trinketDescriptionMap.d.ts +6 -0
  38. package/dist/maps/trinketDescriptionMap.d.ts.map +1 -1
  39. package/dist/maps/trinketDescriptionMap.lua +4 -0
  40. package/dist/maps/trinketNameToTypeMap.d.ts +3 -0
  41. package/dist/maps/trinketNameToTypeMap.d.ts.map +1 -0
  42. package/dist/maps/trinketNameToTypeMap.lua +21 -0
  43. package/dist/maps/trinketTypeToNameMap.d.ts +12 -0
  44. package/dist/maps/trinketTypeToNameMap.d.ts.map +1 -0
  45. package/dist/maps/{trinketNameMap.lua → trinketTypeToNameMap.lua} +7 -1
  46. package/dist/objects/characterDamageMultipliers.lua +1 -1
  47. package/dist/objects/characterNames.lua +1 -1
  48. package/dist/objects/playerNamePNGFileNames.lua +1 -1
  49. package/dist/objects/playerPortraitPNGFileNames.lua +1 -1
  50. package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.lua +1 -1
  51. package/dist/sets/charactersWithNoRedHeartsSet.lua +1 -1
  52. package/package.json +2 -2
  53. package/src/features/extraConsoleCommands/listCommands.ts +91 -16
  54. package/src/functions/collectibles.ts +3 -3
  55. package/src/functions/gridEntitiesSpecific.ts +7 -2
  56. package/src/functions/string.ts +6 -0
  57. package/src/functions/trinkets.ts +5 -2
  58. package/src/index.ts +4 -4
  59. package/src/maps/{cardMap.ts → cardNameToTypeMap.ts} +2 -2
  60. package/src/maps/characterNameToTypeMap.ts +88 -0
  61. package/src/maps/collectibleDescriptionMap.ts +6 -2
  62. package/src/maps/collectibleNameToTypeMap.ts +19 -0
  63. package/src/maps/collectibleTypeToNameMap.ts +739 -0
  64. package/src/maps/pillNameToEffectMap.ts +90 -0
  65. package/src/maps/{roomTypeMap.ts → roomNameToTypeMap.ts} +2 -2
  66. package/src/maps/trinketDescriptionMap.ts +6 -2
  67. package/src/maps/trinketNameToTypeMap.ts +17 -0
  68. package/src/maps/trinketTypeToNameMap.ts +205 -0
  69. package/src/objects/characterDamageMultipliers.ts +1 -1
  70. package/src/objects/characterNames.ts +1 -1
  71. package/src/objects/playerNamePNGFileNames.ts +1 -1
  72. package/src/objects/playerPortraitPNGFileNames.ts +1 -1
  73. package/src/sets/charactersWithBlackHeartFromEternalHeartSet.ts +1 -1
  74. package/src/sets/charactersWithNoRedHeartsSet.ts +1 -1
  75. package/dist/maps/cardMap.d.ts +0 -4
  76. package/dist/maps/cardMap.d.ts.map +0 -1
  77. package/dist/maps/characterMap.d.ts +0 -4
  78. package/dist/maps/characterMap.d.ts.map +0 -1
  79. package/dist/maps/characterMap.lua +0 -90
  80. package/dist/maps/collectibleNameMap.d.ts +0 -4
  81. package/dist/maps/collectibleNameMap.d.ts.map +0 -1
  82. package/dist/maps/pillEffectMap.d.ts.map +0 -1
  83. package/dist/maps/roomTypeMap.d.ts +0 -4
  84. package/dist/maps/roomTypeMap.d.ts.map +0 -1
  85. package/dist/maps/trinketNameMap.d.ts +0 -4
  86. package/dist/maps/trinketNameMap.d.ts.map +0 -1
  87. package/src/maps/characterMap.ts +0 -87
  88. package/src/maps/collectibleNameMap.ts +0 -731
  89. package/src/maps/pillEffectMap.ts +0 -88
  90. package/src/maps/trinketNameMap.ts +0 -198
@@ -0,0 +1,3 @@
1
+ import { CollectibleType } from "isaac-typescript-definitions";
2
+ export declare const COLLECTIBLE_NAME_TO_TYPE_MAP: ReadonlyMap<string, CollectibleType>;
3
+ //# sourceMappingURL=collectibleNameToTypeMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectibleNameToTypeMap.d.ts","sourceRoot":"","sources":["../../src/maps/collectibleNameToTypeMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAe/D,eAAO,MAAM,4BAA4B,EAAE,WAAW,CACpD,MAAM,EACN,eAAe,CACW,CAAC"}
@@ -0,0 +1,21 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__Iterator = ____lualib.__TS__Iterator
5
+ local ____exports = {}
6
+ local ____string = require("functions.string")
7
+ local removeNonAlphanumericCharacters = ____string.removeNonAlphanumericCharacters
8
+ local ____collectibleTypeToNameMap = require("maps.collectibleTypeToNameMap")
9
+ local COLLECTIBLE_TYPE_TO_NAME_MAP = ____collectibleTypeToNameMap.COLLECTIBLE_TYPE_TO_NAME_MAP
10
+ --- Maps collectible names to the values of the `CollectibleType` enum.
11
+ --
12
+ -- For a mapping of `CollectibleType` to name, see `COLLECTIBLE_TYPE_TO_NAME_MAP`.
13
+ local collectibleNameToTypeMap = __TS__New(Map)
14
+ for ____, ____value in __TS__Iterator(COLLECTIBLE_TYPE_TO_NAME_MAP) do
15
+ local collectibleType = ____value[1]
16
+ local name = ____value[2]
17
+ local simpleString = removeNonAlphanumericCharacters(nil, name)
18
+ collectibleNameToTypeMap:set(simpleString, collectibleType)
19
+ end
20
+ ____exports.COLLECTIBLE_NAME_TO_TYPE_MAP = collectibleNameToTypeMap
21
+ return ____exports
@@ -0,0 +1,12 @@
1
+ import { CollectibleType } from "isaac-typescript-definitions";
2
+ export declare const DEFAULT_COLLECTIBLE_NAME = "Unknown";
3
+ /**
4
+ * Maps collectible types to the real English names from the "stringtable.sta" file.
5
+ *
6
+ * This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
7
+ * converted to a type-safe object.)
8
+ *
9
+ * For a mapping of name to `CollectibleType`, see `COLLECTIBLE_NAME_TO_TYPE_MAP`.
10
+ */
11
+ export declare const COLLECTIBLE_TYPE_TO_NAME_MAP: ReadonlyMap<CollectibleType, string>;
12
+ //# sourceMappingURL=collectibleTypeToNameMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectibleTypeToNameMap.d.ts","sourceRoot":"","sources":["../../src/maps/collectibleTypeToNameMap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CACpD,eAAe,EACf,MAAM,CAktBN,CAAC"}
@@ -3,7 +3,13 @@ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  ____exports.DEFAULT_COLLECTIBLE_NAME = "Unknown"
6
- ____exports.COLLECTIBLE_NAME_MAP = __TS__New(Map, {
6
+ --- Maps collectible types to the real English names from the "stringtable.sta" file.
7
+ --
8
+ -- This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
9
+ -- converted to a type-safe object.)
10
+ --
11
+ -- For a mapping of name to `CollectibleType`, see `COLLECTIBLE_NAME_TO_TYPE_MAP`.
12
+ ____exports.COLLECTIBLE_TYPE_TO_NAME_MAP = __TS__New(Map, {
7
13
  {1, "The Sad Onion"},
8
14
  {2, "The Inner Eye"},
9
15
  {3, "Spoon Bender"},
@@ -1,4 +1,4 @@
1
1
  import { PillEffect } from "isaac-typescript-definitions";
2
2
  /** Maps pill effect names to the values of the `PillEffect` enum. */
3
- export declare const PILL_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
4
- //# sourceMappingURL=pillEffectMap.d.ts.map
3
+ export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
4
+ //# sourceMappingURL=pillNameToEffectMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pillNameToEffectMap.d.ts","sourceRoot":"","sources":["../../src/maps/pillNameToEffectMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAsFnE,CAAC"}
@@ -5,7 +5,7 @@ local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local PillEffect = ____isaac_2Dtypescript_2Ddefinitions.PillEffect
7
7
  --- Maps pill effect names to the values of the `PillEffect` enum.
8
- ____exports.PILL_EFFECT_MAP = __TS__New(Map, {
8
+ ____exports.PILL_NAME_TO_EFFECT_MAP = __TS__New(Map, {
9
9
  {"badGas", PillEffect.BAD_GAS},
10
10
  {"gas", PillEffect.BAD_GAS},
11
11
  {"badTrip", PillEffect.BAD_TRIP},
@@ -0,0 +1,4 @@
1
+ import { RoomType } from "isaac-typescript-definitions";
2
+ /** Maps room names to the values of the `RoomType` enum. */
3
+ export declare const ROOM_NAME_TO_TYPE_MAP: ReadonlyMap<string, RoomType>;
4
+ //# sourceMappingURL=roomNameToTypeMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roomNameToTypeMap.d.ts","sourceRoot":"","sources":["../../src/maps/roomNameToTypeMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAmC9D,CAAC"}
@@ -4,8 +4,8 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
7
- --- Maps room type names to room types.
8
- ____exports.ROOM_TYPE_MAP = __TS__New(Map, {
7
+ --- Maps room names to the values of the `RoomType` enum.
8
+ ____exports.ROOM_NAME_TO_TYPE_MAP = __TS__New(Map, {
9
9
  {"default", RoomType.DEFAULT},
10
10
  {"shop", RoomType.SHOP},
11
11
  {"error", RoomType.ERROR},
@@ -1,4 +1,10 @@
1
1
  import { TrinketType } from "isaac-typescript-definitions";
2
2
  export declare const DEFAULT_TRINKET_DESCRIPTION = "Unknown";
3
+ /**
4
+ * Maps trinket types to the real English descriptions from the "stringtable.sta" file.
5
+ *
6
+ * This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
7
+ * converted to a type-safe object.)
8
+ */
3
9
  export declare const TRINKET_DESCRIPTION_MAP: ReadonlyMap<TrinketType, string>;
4
10
  //# sourceMappingURL=trinketDescriptionMap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trinketDescriptionMap.d.ts","sourceRoot":"","sources":["../../src/maps/trinketDescriptionMap.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAIrD,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CA8LjE,CAAC"}
1
+ {"version":3,"file":"trinketDescriptionMap.d.ts","sourceRoot":"","sources":["../../src/maps/trinketDescriptionMap.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CA8LjE,CAAC"}
@@ -3,6 +3,10 @@ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  ____exports.DEFAULT_TRINKET_DESCRIPTION = "Unknown"
6
+ --- Maps trinket types to the real English descriptions from the "stringtable.sta" file.
7
+ --
8
+ -- This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
9
+ -- converted to a type-safe object.)
6
10
  ____exports.TRINKET_DESCRIPTION_MAP = __TS__New(Map, {
7
11
  {1, "Gulp!"},
8
12
  {2, "It feels lucky?"},
@@ -0,0 +1,3 @@
1
+ import { TrinketType } from "isaac-typescript-definitions";
2
+ export declare const TRINKET_NAME_TO_TYPE_MAP: ReadonlyMap<string, TrinketType>;
3
+ //# sourceMappingURL=trinketNameToTypeMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trinketNameToTypeMap.d.ts","sourceRoot":"","sources":["../../src/maps/trinketNameToTypeMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAe3D,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAChD,CAAC"}
@@ -0,0 +1,21 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__Iterator = ____lualib.__TS__Iterator
5
+ local ____exports = {}
6
+ local ____string = require("functions.string")
7
+ local removeNonAlphanumericCharacters = ____string.removeNonAlphanumericCharacters
8
+ local ____trinketTypeToNameMap = require("maps.trinketTypeToNameMap")
9
+ local TRINKET_TYPE_TO_NAME_MAP = ____trinketTypeToNameMap.TRINKET_TYPE_TO_NAME_MAP
10
+ --- Maps trinket names to the values of the `TrinketType` enum.
11
+ --
12
+ -- For a mapping of `TrinketType` to name, see `TRINKET_TYPE_TO_NAME_MAP`.
13
+ local trinketNameToTypeMap = __TS__New(Map)
14
+ for ____, ____value in __TS__Iterator(TRINKET_TYPE_TO_NAME_MAP) do
15
+ local trinketType = ____value[1]
16
+ local name = ____value[2]
17
+ local simpleString = removeNonAlphanumericCharacters(nil, name)
18
+ trinketNameToTypeMap:set(simpleString, trinketType)
19
+ end
20
+ ____exports.TRINKET_NAME_TO_TYPE_MAP = trinketNameToTypeMap
21
+ return ____exports
@@ -0,0 +1,12 @@
1
+ import { TrinketType } from "isaac-typescript-definitions";
2
+ export declare const DEFAULT_TRINKET_NAME = "Unknown";
3
+ /**
4
+ * Maps trinket types to the real English names from the "stringtable.sta" file.
5
+ *
6
+ * This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
7
+ * converted to a type-safe object.)
8
+ *
9
+ * For a mapping of name to `TrinketType`, see `TRINKET_NAME_TO_TYPE_MAP`.
10
+ */
11
+ export declare const TRINKET_TYPE_TO_NAME_MAP: ReadonlyMap<TrinketType, string>;
12
+ //# sourceMappingURL=trinketTypeToNameMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trinketTypeToNameMap.d.ts","sourceRoot":"","sources":["../../src/maps/trinketTypeToNameMap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CA8LlE,CAAC"}
@@ -3,7 +3,13 @@ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  ____exports.DEFAULT_TRINKET_NAME = "Unknown"
6
- ____exports.TRINKET_NAME_MAP = __TS__New(Map, {
6
+ --- Maps trinket types to the real English names from the "stringtable.sta" file.
7
+ --
8
+ -- This is a temporary map due to missing features in the vanilla API. (Otherwise, this would be
9
+ -- converted to a type-safe object.)
10
+ --
11
+ -- For a mapping of name to `TrinketType`, see `TRINKET_NAME_TO_TYPE_MAP`.
12
+ ____exports.TRINKET_TYPE_TO_NAME_MAP = __TS__New(Map, {
7
13
  {1, "Swallowed Penny"},
8
14
  {2, "Petrified Poop"},
9
15
  {3, "AAA Battery"},
@@ -16,7 +16,7 @@ ____exports.CHARACTER_DAMAGE_MULTIPLIERS = {
16
16
  [PlayerType.EDEN] = 1,
17
17
  [PlayerType.THE_LOST] = 1,
18
18
  [PlayerType.LAZARUS_2] = 1.4,
19
- [PlayerType.BLACK_JUDAS] = 2,
19
+ [PlayerType.DARK_JUDAS] = 2,
20
20
  [PlayerType.LILITH] = 1,
21
21
  [PlayerType.KEEPER] = 1.2,
22
22
  [PlayerType.APOLLYON] = 1,
@@ -15,7 +15,7 @@ ____exports.CHARACTER_NAMES = {
15
15
  [PlayerType.EDEN] = "Eden",
16
16
  [PlayerType.THE_LOST] = "The Lost",
17
17
  [PlayerType.LAZARUS_2] = "Lazarus II",
18
- [PlayerType.BLACK_JUDAS] = "Dark Judas",
18
+ [PlayerType.DARK_JUDAS] = "Dark Judas",
19
19
  [PlayerType.LILITH] = "Lilith",
20
20
  [PlayerType.KEEPER] = "Keeper",
21
21
  [PlayerType.APOLLYON] = "Apollyon",
@@ -16,7 +16,7 @@ ____exports.PLAYER_NAME_PNG_FILE_NAMES = {
16
16
  [PlayerType.EDEN] = "playername_09_eden.png",
17
17
  [PlayerType.THE_LOST] = "playername_12_thelost.png",
18
18
  [PlayerType.LAZARUS_2] = "playername_10_lazarus.png",
19
- [PlayerType.BLACK_JUDAS] = "playername_04_judas.png",
19
+ [PlayerType.DARK_JUDAS] = "playername_04_judas.png",
20
20
  [PlayerType.LILITH] = "playername_13_lilith.png",
21
21
  [PlayerType.KEEPER] = "playername_14_thekeeper.png",
22
22
  [PlayerType.APOLLYON] = "playername_15_apollyon.png",
@@ -16,7 +16,7 @@ ____exports.PLAYER_PORTRAIT_PNG_FILE_NAMES = {
16
16
  [PlayerType.EDEN] = "playerportrait_eden.png",
17
17
  [PlayerType.THE_LOST] = "playerportrait_thelost.png",
18
18
  [PlayerType.LAZARUS_2] = "playerportrait_lazarus2.png",
19
- [PlayerType.BLACK_JUDAS] = "playerportrait_darkjudas.png",
19
+ [PlayerType.DARK_JUDAS] = "playerportrait_darkjudas.png",
20
20
  [PlayerType.LILITH] = "playerportrait_lilith.png",
21
21
  [PlayerType.KEEPER] = "playerportrait_keeper.png",
22
22
  [PlayerType.APOLLYON] = "playerportrait_apollyon.png",
@@ -4,5 +4,5 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
7
- ____exports.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART_SET = __TS__New(Set, {PlayerType.BLACK_JUDAS, PlayerType.JUDAS_B})
7
+ ____exports.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART_SET = __TS__New(Set, {PlayerType.DARK_JUDAS, PlayerType.JUDAS_B})
8
8
  return ____exports
@@ -9,7 +9,7 @@ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
9
9
  ____exports.CHARACTERS_WITH_NO_RED_HEARTS_SET = __TS__New(Set, {
10
10
  PlayerType.BLUE_BABY,
11
11
  PlayerType.THE_LOST,
12
- PlayerType.BLACK_JUDAS,
12
+ PlayerType.DARK_JUDAS,
13
13
  PlayerType.JUDAS_B,
14
14
  PlayerType.BLUE_BABY_B,
15
15
  PlayerType.THE_LOST_B,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "9.13.5",
3
+ "version": "9.15.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^4.0.6"
25
+ "isaac-typescript-definitions": "^4.0.7"
26
26
  }
27
27
  }
@@ -85,7 +85,7 @@ import { runMergeTests } from "../../functions/mergeTests";
85
85
  import {
86
86
  spawnCard,
87
87
  spawnPill,
88
- spawnTrinket,
88
+ spawnTrinket as spawnTrinketFunction,
89
89
  } from "../../functions/pickupsSpecific";
90
90
  import { getPillEffectName } from "../../functions/pills";
91
91
  import { getPlayers } from "../../functions/playerIndex";
@@ -99,14 +99,21 @@ import { gridCoordinatesToWorldPosition } from "../../functions/roomGrid";
99
99
  import { changeRoom } from "../../functions/rooms";
100
100
  import { reloadRoom as reloadRoomFunction } from "../../functions/roomTransition";
101
101
  import { onSetSeed, restart, setUnseeded } from "../../functions/run";
102
+ import { spawnCollectible as spawnCollectibleFunction } from "../../functions/spawnCollectible";
102
103
  import { setStage } from "../../functions/stage";
103
104
  import { getGoldenTrinketType } from "../../functions/trinkets";
104
- import { asCardType } from "../../functions/types";
105
+ import {
106
+ asCardType,
107
+ asCollectibleType,
108
+ asTrinketType,
109
+ } from "../../functions/types";
105
110
  import { irange, printConsole, printEnabled } from "../../functions/utils";
106
- import { CARD_MAP } from "../../maps/cardMap";
107
- import { CHARACTER_MAP } from "../../maps/characterMap";
108
- import { PILL_EFFECT_MAP } from "../../maps/pillEffectMap";
109
- import { ROOM_TYPE_MAP } from "../../maps/roomTypeMap";
111
+ import { CARD_NAME_TO_TYPE_MAP } from "../../maps/cardNameToTypeMap";
112
+ import { CHARACTER_NAME_TO_TYPE_MAP } from "../../maps/characterNameToTypeMap";
113
+ import { COLLECTIBLE_NAME_TO_TYPE_MAP } from "../../maps/collectibleNameToTypeMap";
114
+ import { PILL_NAME_TO_EFFECT_MAP } from "../../maps/pillNameToEffectMap";
115
+ import { ROOM_NAME_TO_TYPE_MAP } from "../../maps/roomNameToTypeMap";
116
+ import { TRINKET_NAME_TO_TYPE_MAP } from "../../maps/trinketNameToTypeMap";
110
117
  import { getLastCardType, getLastPillEffect } from "../firstLast";
111
118
  import {
112
119
  addHeart,
@@ -343,7 +350,7 @@ export function card(params: string): void {
343
350
  let cardType: CardType;
344
351
  const num = tonumber(params) as CardType | undefined;
345
352
  if (num === undefined) {
346
- const match = getMapPartialMatch(params, CARD_MAP);
353
+ const match = getMapPartialMatch(params, CARD_NAME_TO_TYPE_MAP);
347
354
  if (match === undefined) {
348
355
  printConsole(`Unknown card: ${params}`);
349
356
  return;
@@ -414,7 +421,7 @@ export function character(params: string): void {
414
421
  let playerType: PlayerType;
415
422
  const num = tonumber(params) as PlayerType | undefined;
416
423
  if (num === undefined) {
417
- const match = getMapPartialMatch(params, CHARACTER_MAP);
424
+ const match = getMapPartialMatch(params, CHARACTER_NAME_TO_TYPE_MAP);
418
425
  if (match === undefined) {
419
426
  printConsole(`Unknown character: ${params}`);
420
427
  return;
@@ -744,6 +751,12 @@ export function hitboxes(): void {
744
751
  Isaac.ExecuteCommand("debug 6");
745
752
  }
746
753
 
754
+ /** Warps to the Blue Womb Boss Room. */
755
+ export function hush(): void {
756
+ setStage(LevelStage.BLUE_WOMB, StageType.ORIGINAL);
757
+ bossRoom();
758
+ }
759
+
747
760
  /** Warps to the I AM ERROR room for the floor. */
748
761
  export function iAmErrorRoom(): void {
749
762
  changeRoom(GridRoom.ERROR);
@@ -934,7 +947,7 @@ export function pill(params: string): void {
934
947
  let pillEffect: PillEffect;
935
948
  const num = tonumber(params) as PillEffect | undefined;
936
949
  if (num === undefined) {
937
- const match = getMapPartialMatch(params, PILL_EFFECT_MAP);
950
+ const match = getMapPartialMatch(params, PILL_NAME_TO_EFFECT_MAP);
938
951
  if (match === undefined) {
939
952
  printConsole(`Unknown pill effect: ${params}`);
940
953
  return;
@@ -1309,25 +1322,87 @@ export function spam(): void {
1309
1322
  printEnabled(v.run.spamBloodRights, "spamming Blood Rights");
1310
1323
  }
1311
1324
 
1325
+ export function spawnCollectible(params: string): void {
1326
+ if (params === "") {
1327
+ printConsole(
1328
+ "You must specify the name or number corresponding to the collectible type.",
1329
+ );
1330
+ return;
1331
+ }
1332
+
1333
+ const collectibleTypeNumber = tonumber(params);
1334
+ let collectibleType: CollectibleType;
1335
+ if (collectibleTypeNumber === undefined) {
1336
+ const match = getMapPartialMatch(params, COLLECTIBLE_NAME_TO_TYPE_MAP);
1337
+ if (match === undefined) {
1338
+ printConsole(`Unknown collectible: ${params}`);
1339
+ return;
1340
+ }
1341
+
1342
+ collectibleType = match[1];
1343
+ } else {
1344
+ collectibleType = asCollectibleType(collectibleTypeNumber);
1345
+ }
1346
+
1347
+ const roomClass = game.GetRoom();
1348
+ const centerPos = roomClass.GetCenterPos();
1349
+ spawnCollectibleFunction(collectibleType, centerPos);
1350
+ }
1351
+
1312
1352
  /** Spawns a golden version of the specified trinket type. */
1313
1353
  export function spawnGoldenTrinket(params: string): void {
1314
1354
  if (params === "") {
1315
1355
  printConsole(
1316
- "You must specify the number corresponding to the trinket type.",
1356
+ "You must specify the name or number corresponding to the trinket type.",
1317
1357
  );
1318
1358
  return;
1319
1359
  }
1320
1360
 
1321
- const trinketType = tonumber(params) as TrinketType | undefined;
1322
- if (trinketType === undefined) {
1323
- printConsole(`That is an invalid trinket type: ${params}`);
1324
- return;
1361
+ const trinketTypeNumber = tonumber(params);
1362
+ let trinketType: TrinketType;
1363
+ if (trinketTypeNumber === undefined) {
1364
+ const match = getMapPartialMatch(params, TRINKET_NAME_TO_TYPE_MAP);
1365
+ if (match === undefined) {
1366
+ printConsole(`Unknown trinket: ${params}`);
1367
+ return;
1368
+ }
1369
+
1370
+ trinketType = match[1];
1371
+ } else {
1372
+ trinketType = asTrinketType(trinketTypeNumber);
1325
1373
  }
1326
1374
 
1375
+ const roomClass = game.GetRoom();
1376
+ const centerPos = roomClass.GetCenterPos();
1327
1377
  const goldenTrinketType = getGoldenTrinketType(trinketType);
1378
+ spawnTrinketFunction(goldenTrinketType, centerPos);
1379
+ }
1380
+
1381
+ export function spawnTrinket(params: string): void {
1382
+ if (params === "") {
1383
+ printConsole(
1384
+ "You must specify the name or number corresponding to the trinket type.",
1385
+ );
1386
+ return;
1387
+ }
1388
+
1389
+ const trinketTypeNumber = tonumber(params);
1390
+ let trinketType: TrinketType;
1391
+ if (trinketTypeNumber === undefined) {
1392
+ const match = getMapPartialMatch(params, TRINKET_NAME_TO_TYPE_MAP);
1393
+ if (match === undefined) {
1394
+ printConsole(`Unknown trinket: ${params}`);
1395
+ return;
1396
+ }
1397
+
1398
+ trinketType = match[1];
1399
+ } else {
1400
+ trinketType = asTrinketType(trinketTypeNumber);
1401
+ }
1402
+
1328
1403
  const roomClass = game.GetRoom();
1329
1404
  const centerPos = roomClass.GetCenterPos();
1330
- spawnTrinket(goldenTrinketType, centerPos);
1405
+ spawnTrinketFunction(trinketType, centerPos);
1331
1406
  }
1332
1407
 
1333
1408
  /** Toggles maximum movement speed and flight for the player. */
@@ -1435,7 +1510,7 @@ export function warp(params: string): void {
1435
1510
  let roomType: RoomType;
1436
1511
  const num = tonumber(params) as RoomType | undefined;
1437
1512
  if (num === undefined) {
1438
- const match = getMapPartialMatch(params, ROOM_TYPE_MAP);
1513
+ const match = getMapPartialMatch(params, ROOM_NAME_TO_TYPE_MAP);
1439
1514
  if (match === undefined) {
1440
1515
  printConsole(`Unknown room type: ${params}`);
1441
1516
  return;
@@ -20,9 +20,9 @@ import {
20
20
  DEFAULT_COLLECTIBLE_DESCRIPTION,
21
21
  } from "../maps/collectibleDescriptionMap";
22
22
  import {
23
- COLLECTIBLE_NAME_MAP,
23
+ COLLECTIBLE_TYPE_TO_NAME_MAP,
24
24
  DEFAULT_COLLECTIBLE_NAME,
25
- } from "../maps/collectibleNameMap";
25
+ } from "../maps/collectibleTypeToNameMap";
26
26
  import { SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET } from "../sets/singleUseActiveCollectibleTypesSet";
27
27
  import { CollectibleIndex } from "../types/CollectibleIndex";
28
28
  import { getEntityID } from "./entities";
@@ -308,7 +308,7 @@ export function getCollectibleMaxCharges(
308
308
  export function getCollectibleName(collectibleType: CollectibleType): string {
309
309
  // "ItemConfigItem.Name" is bugged with vanilla items on patch v1.7.6, so we use a hard-coded map
310
310
  // as a workaround.
311
- const collectibleName = COLLECTIBLE_NAME_MAP.get(collectibleType);
311
+ const collectibleName = COLLECTIBLE_TYPE_TO_NAME_MAP.get(collectibleType);
312
312
  if (collectibleName !== undefined) {
313
313
  return collectibleName;
314
314
  }
@@ -191,9 +191,14 @@ export function getTeleporters(variant = -1): GridEntity[] {
191
191
  /**
192
192
  * Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
193
193
  * room. Specify a specific trapdoor variant to select only trapdoors of that variant.
194
+ *
195
+ * @param trapdoorVariant Optional. If specified, will only get the trapdoors that match the
196
+ * variant. Default is -1, which matches every variant.
194
197
  */
195
- export function getTrapdoors(trapdoorVariant?: TrapdoorVariant): GridEntity[] {
196
- if (trapdoorVariant === undefined) {
198
+ export function getTrapdoors(
199
+ trapdoorVariant: TrapdoorVariant = -1,
200
+ ): GridEntity[] {
201
+ if (asNumber(trapdoorVariant) === -1) {
197
202
  return getGridEntities(GridEntityType.TRAPDOOR);
198
203
  }
199
204
 
@@ -55,6 +55,12 @@ export function removeCharactersBefore(
55
55
  return string.slice(index);
56
56
  }
57
57
 
58
+ /** Helper function to remove all characters from a string that are not letters or numbers. */
59
+ export function removeNonAlphanumericCharacters(str: string): string {
60
+ const [returnValue, _] = string.gsub(str, "%W", "");
61
+ return returnValue;
62
+ }
63
+
58
64
  /**
59
65
  * Helper function to remove one or more substrings from a string, if they exist. Returns the
60
66
  * modified string.
@@ -13,7 +13,10 @@ import {
13
13
  DEFAULT_TRINKET_DESCRIPTION,
14
14
  TRINKET_DESCRIPTION_MAP,
15
15
  } from "../maps/trinketDescriptionMap";
16
- import { DEFAULT_TRINKET_NAME, TRINKET_NAME_MAP } from "../maps/trinketNameMap";
16
+ import {
17
+ DEFAULT_TRINKET_NAME,
18
+ TRINKET_TYPE_TO_NAME_MAP,
19
+ } from "../maps/trinketTypeToNameMap";
17
20
  import { getEntityID } from "./entities";
18
21
  import { isTrinket } from "./pickupVariants";
19
22
  import { isCharacter } from "./players";
@@ -123,7 +126,7 @@ export function getTrinketGfxFilename(trinketType: TrinketType): string {
123
126
  export function getTrinketName(trinketType: TrinketType): string {
124
127
  // "ItemConfigItem.Name" is bugged with vanilla items on patch v1.7.6, so we use a hard-coded map
125
128
  // as a workaround.
126
- const trinketName = TRINKET_NAME_MAP.get(trinketType);
129
+ const trinketName = TRINKET_TYPE_TO_NAME_MAP.get(trinketType);
127
130
  if (trinketName !== undefined) {
128
131
  return trinketName;
129
132
  }
package/src/index.ts CHANGED
@@ -159,10 +159,10 @@ export * from "./interfaces/RoomDescription";
159
159
  export * from "./interfaces/SaveData";
160
160
  export * from "./interfaces/StatTypeType";
161
161
  export * from "./interfaces/TrinketSituation";
162
- export * from "./maps/cardMap";
163
- export * from "./maps/characterMap";
164
- export * from "./maps/pillEffectMap";
165
- export * from "./maps/roomTypeMap";
162
+ export * from "./maps/cardNameToTypeMap";
163
+ export * from "./maps/characterNameToTypeMap";
164
+ export * from "./maps/pillNameToEffectMap";
165
+ export * from "./maps/roomNameToTypeMap";
166
166
  export * from "./objects/colors";
167
167
  export * from "./types/AnyEntity";
168
168
  export * from "./types/AnyGridEntity";
@@ -2,8 +2,8 @@ import { CardType } from "isaac-typescript-definitions";
2
2
 
3
3
  // cspell:ignore hiero
4
4
 
5
- /** Maps card names to card sub-types. */
6
- export const CARD_MAP: ReadonlyMap<string, CardType> = new Map([
5
+ /** Maps card names to the values of the `CardType` enum. */
6
+ export const CARD_NAME_TO_TYPE_MAP: ReadonlyMap<string, CardType> = new Map([
7
7
  ["fool", CardType.FOOL], // 1
8
8
  ["magician", CardType.MAGICIAN], // 2
9
9
  ["mag", CardType.MAGICIAN], // 2 - Needed since we have "mag?"