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
@@ -1593,6 +1593,13 @@ export declare function closeDoorFast(door: GridEntityDoor): void;
1593
1593
  /** This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned. */
1594
1594
  export declare const COLLECTIBLE_INITIAL_WAIT = 20;
1595
1595
 
1596
+ /**
1597
+ * Maps collectible names to the values of the `CollectibleType` enum.
1598
+ *
1599
+ * For a mapping of `CollectibleType` to name, see `COLLECTIBLE_TYPE_TO_NAME_MAP`.
1600
+ */
1601
+ export declare const COLLECTIBLE_NAME_TO_TYPE_MAP: ReadonlyMap<string, CollectibleType>;
1602
+
1596
1603
  /** Helper function to check in the item config if a given collectible has a given cache flag. */
1597
1604
  export declare function collectibleHasCacheFlag(collectibleOrCollectibleType: EntityPickup | CollectibleType, cacheFlag: CacheFlag): boolean;
1598
1605
 
@@ -4803,6 +4810,16 @@ export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPla
4803
4810
  */
4804
4811
  export declare function getBatteries(batterySubType?: BatterySubType | -1): EntityPickupBattery[];
4805
4812
 
4813
+ /**
4814
+ * Helper function to get the name of a battery, as listed in the "entities2.xml" file. Returns
4815
+ * "Unknown" if the provided battery sub-type is not valid.
4816
+ *
4817
+ * This function only works for vanilla battery types.
4818
+ *
4819
+ * For example, `getBatteryName(BatterySubType.MICRO)` would return "Micro Battery".
4820
+ */
4821
+ export declare function getBatteryName(batterySubType: BatterySubType): string;
4822
+
4806
4823
  /**
4807
4824
  * Helper function to get the door that leads to the off-grid room that contains the hole to the
4808
4825
  * Blue Womb. (In vanilla, the door will only appear in the It Lives Boss Room.)
@@ -4811,6 +4828,16 @@ export declare function getBatteries(batterySubType?: BatterySubType | -1): Enti
4811
4828
  */
4812
4829
  export declare function getBlueWombDoor(): GridEntityDoor | undefined;
4813
4830
 
4831
+ /**
4832
+ * Helper function to get the name of a bomb, as listed in the "entities2.xml" file. Returns
4833
+ * "Unknown" if the provided bomb sub-type is not valid.
4834
+ *
4835
+ * This function only works for vanilla bomb types.
4836
+ *
4837
+ * For example, `getBombName(BombSubType.DOUBLE_PACK)` would return "Double Bomb".
4838
+ */
4839
+ export declare function getBombName(bombSubType: BombSubType): string;
4840
+
4814
4841
  /**
4815
4842
  * Helper function to get all of the bomb entities in the room. (Specifically, this refers to bomb
4816
4843
  * pickups, not the `EntityBomb` class.)
@@ -4882,7 +4909,10 @@ export declare function getBossSet(stage: int, stageType: StageType): ReadonlySe
4882
4909
  export declare function getCardDescription(cardType: CardType): string;
4883
4910
 
4884
4911
  /**
4885
- * Helper function to get a card name from a Card.
4912
+ * Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
4913
+ * valid.
4914
+ *
4915
+ * This function works for both vanilla and modded trinkets.
4886
4916
  *
4887
4917
  * For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
4888
4918
  */
@@ -4951,6 +4981,16 @@ export declare function getCharacterStartingTrinketType(character: PlayerType):
4951
4981
  */
4952
4982
  export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot?: ActiveSlot): int;
4953
4983
 
4984
+ /**
4985
+ * Helper function to get the name of a chest, as listed in the "entities2.xml" file. Returns
4986
+ * "Unknown" if the pickup variant was not a chest.
4987
+ *
4988
+ * This function only works for vanilla chest types.
4989
+ *
4990
+ * For example, `getChestName(PickupVariant.SPIKED_CHEST)` would return "Spiked Chest".
4991
+ */
4992
+ export declare function getChestName(pickupVariant: PickupVariant): string;
4993
+
4954
4994
  /**
4955
4995
  * Helper function to get an array of equidistant points on the circumference around a circle.
4956
4996
  * Useful for equally distributing things in a circle pattern.
@@ -5000,6 +5040,16 @@ export declare function getClosestPlayer(position: Vector): EntityPlayer;
5000
5040
  */
5001
5041
  export declare function getClosestVectorTo(referenceVector: Vector, vectors: Vector[]): Vector | undefined;
5002
5042
 
5043
+ /**
5044
+ * Helper function to get the name of a coin, as listed in the "entities2.xml" file. Returns
5045
+ * "Unknown" if the provided coin sub-type is not valid.
5046
+ *
5047
+ * This function only works for vanilla chest types.
5048
+ *
5049
+ * For example, `getCoinName(CoinSubType.DOUBLE_PACK)` would return "Double Penny".
5050
+ */
5051
+ export declare function getCoinName(coinSubType: CoinSubType): string;
5052
+
5003
5053
  /**
5004
5054
  * Helper function to get all of the coin pickup entities in the room.
5005
5055
  *
@@ -5074,9 +5124,9 @@ export declare function getCollectibleMaxCharges(collectibleOrCollectibleType: E
5074
5124
  * Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
5075
5125
  * type is not valid.
5076
5126
  *
5077
- * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
5078
- *
5079
5127
  * This function works for both vanilla and modded collectibles.
5128
+ *
5129
+ * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
5080
5130
  */
5081
5131
  export declare function getCollectibleName(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
5082
5132
 
@@ -5278,19 +5328,6 @@ export declare function getEffects(effectVariant?: EffectVariant | -1, subType?:
5278
5328
  */
5279
5329
  export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
5280
5330
 
5281
- /**
5282
- * Helper function to get the English name of the level. For example, "Caves 1".
5283
- *
5284
- * This is useful because the `Level.GetName` method returns a localized version of the level name,
5285
- * which will not display correctly on some fonts.
5286
- *
5287
- * Note that this returns "Blue Womb" instead of "???" for stage 9.
5288
- *
5289
- * @param stage Optional. If not specified, the current stage will be used.
5290
- * @param stageType Optional. If not specified, the current stage type will be used.
5291
- */
5292
- export declare function getEnglishLevelName(stage?: LevelStage, stageType?: StageType): string;
5293
-
5294
5331
  /**
5295
5332
  * Helper function to get all of the entities in the room or all of the entities that match a
5296
5333
  * specific entity type / variant / sub-type.
@@ -5602,6 +5639,16 @@ export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSl
5602
5639
  */
5603
5640
  export declare function getGridIndexesBetween(gridIndex1: int, gridIndex2: int, roomShape: RoomShape): int[];
5604
5641
 
5642
+ /**
5643
+ * Helper function to get the name of a heart, as listed in the "entities2.xml" file. Returns
5644
+ * "Unknown" if the provided heart sub-type is not valid.
5645
+ *
5646
+ * This function only works for vanilla heart types.
5647
+ *
5648
+ * For example, `getHeartName(HeartSubType.ETERNAL)` would return "Heart (eternal)".
5649
+ */
5650
+ export declare function getHeartName(heartSubType: HeartSubType): string;
5651
+
5605
5652
  /**
5606
5653
  * Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this
5607
5654
  * function will return 6.
@@ -5717,6 +5764,16 @@ export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[] | readonly J
5717
5764
  /** Helper function to get the value of a specific but in a binary representation of a number. */
5718
5765
  export declare function getKBitOfN(k: int, n: int): int;
5719
5766
 
5767
+ /**
5768
+ * Helper function to get the name of a key, as listed in the "entities2.xml" file. Returns
5769
+ * "Unknown" if the provided key sub-type is not valid.
5770
+ *
5771
+ * This function only works for vanilla key types.
5772
+ *
5773
+ * For example, `getKeyName(KeySubType.DOUBLE_PACK)` would return "Key Ring".
5774
+ */
5775
+ export declare function getKeyName(keySubType: KeySubType): string;
5776
+
5720
5777
  /**
5721
5778
  * Helper function to get all of the key pickup entities in the room.
5722
5779
  *
@@ -5794,6 +5851,19 @@ export declare function getLastFrameOfAnimation(sprite: Sprite, animation?: stri
5794
5851
  */
5795
5852
  export declare function getLevelBossIDs(): BossID[];
5796
5853
 
5854
+ /**
5855
+ * Helper function to get the English name of the level. For example, "Caves 1".
5856
+ *
5857
+ * This is useful because the `Level.GetName` method returns a localized version of the level name,
5858
+ * which will not display correctly on some fonts.
5859
+ *
5860
+ * Note that this returns "Blue Womb" instead of "???" for stage 9.
5861
+ *
5862
+ * @param stage Optional. If not specified, the current stage will be used.
5863
+ * @param stageType Optional. If not specified, the current stage type will be used.
5864
+ */
5865
+ export declare function getLevelName(stage?: LevelStage, stageType?: StageType): string;
5866
+
5797
5867
  /**
5798
5868
  * Helper function to get the lowest value in an array. Returns undefined if there were no elements
5799
5869
  * in the array.
@@ -6154,7 +6224,10 @@ export declare function getPillColorFromEffect(pillEffect: PillEffect): PillColo
6154
6224
  export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPillEffectClass;
6155
6225
 
6156
6226
  /**
6157
- * Helper function to get a pill effect name from a PillEffect enum value.
6227
+ * Helper function to get a pill effect name from a `PillEffect`. Returns "Unknown" if the provided
6228
+ * pill effect is not valid.
6229
+ *
6230
+ * This function works for both vanilla and modded pill effects.
6158
6231
  *
6159
6232
  * For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
6160
6233
  */
@@ -7184,6 +7257,16 @@ export declare function getRoomVariant(roomGridIndex?: int): int | undefined;
7184
7257
  */
7185
7258
  export declare function getRoomVisitedCount(roomGridIndex?: int): int;
7186
7259
 
7260
+ /**
7261
+ * Helper function to get the name of a sack, as listed in the "entities2.xml" file. Returns
7262
+ * "Unknown" if the provided sack sub-type is not valid.
7263
+ *
7264
+ * This function only works for vanilla sack types.
7265
+ *
7266
+ * For example, `getSackName(SackSubType.NORMAL)` would return "Grab Bag".
7267
+ */
7268
+ export declare function getSackName(sackSubType: SackSubType): string;
7269
+
7187
7270
  /**
7188
7271
  * Helper function to get all of the sack (i.e. grab bag) entities in the room.
7189
7272
  *
@@ -7492,9 +7575,9 @@ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
7492
7575
  * Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
7493
7576
  * not valid.
7494
7577
  *
7495
- * For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
7496
- *
7497
7578
  * This function works for both vanilla and modded trinkets.
7579
+ *
7580
+ * For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
7498
7581
  */
7499
7582
  export declare function getTrinketName(trinketType: TrinketType): string;
7500
7583
 
@@ -17524,6 +17607,13 @@ export declare function trimPrefix(string: string, prefix: string): string;
17524
17607
  /** Helper function to trim a suffix from a string, if it exists. Returns the trimmed string. */
17525
17608
  export declare function trimSuffix(string: string, prefix: string): string;
17526
17609
 
17610
+ /**
17611
+ * Maps trinket names to the values of the `TrinketType` enum.
17612
+ *
17613
+ * For a mapping of `TrinketType` to name, see `TRINKET_TYPE_TO_NAME_MAP`.
17614
+ */
17615
+ export declare const TRINKET_NAME_TO_TYPE_MAP: ReadonlyMap<string, TrinketType>;
17616
+
17527
17617
  /** Helper function to check in the item config if a given trinket has a given cache flag. */
17528
17618
  export declare function trinketHasCacheFlag(trinketType: TrinketType, cacheFlag: CacheFlag): boolean;
17529
17619
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 46.0.0
3
+ isaacscript-common 47.1.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -27229,12 +27229,12 @@ function ____exports.reloadRoom(self)
27229
27229
  end
27230
27230
  return ____exports
27231
27231
  end,
27232
- ["src.objects.englishLevelNames"] = function(...)
27232
+ ["src.objects.levelNames"] = function(...)
27233
27233
  local ____exports = {}
27234
27234
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
27235
27235
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
27236
27236
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
27237
- ____exports.ENGLISH_LEVEL_NAMES = {
27237
+ ____exports.LEVEL_NAMES = {
27238
27238
  [LevelStage.BASEMENT_1] = {
27239
27239
  [StageType.ORIGINAL] = "Basement 1",
27240
27240
  [StageType.WRATH_OF_THE_LAMB] = "Cellar 1",
@@ -27513,8 +27513,8 @@ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
27513
27513
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
27514
27514
  local ____cachedClasses = require("src.core.cachedClasses")
27515
27515
  local game = ____cachedClasses.game
27516
- local ____englishLevelNames = require("src.objects.englishLevelNames")
27517
- local ENGLISH_LEVEL_NAMES = ____englishLevelNames.ENGLISH_LEVEL_NAMES
27516
+ local ____levelNames = require("src.objects.levelNames")
27517
+ local LEVEL_NAMES = ____levelNames.LEVEL_NAMES
27518
27518
  local ____roomTypeSpecialGotoPrefixes = require("src.objects.roomTypeSpecialGotoPrefixes")
27519
27519
  local ROOM_TYPE_SPECIAL_GOTO_PREFIXES = ____roomTypeSpecialGotoPrefixes.ROOM_TYPE_SPECIAL_GOTO_PREFIXES
27520
27520
  local ____stageToStageID = require("src.objects.stageToStageID")
@@ -27577,17 +27577,6 @@ function ____exports.getEffectiveStage(self)
27577
27577
  end
27578
27578
  return stage
27579
27579
  end
27580
- function ____exports.getEnglishLevelName(self, stage, stageType)
27581
- local level = game:GetLevel()
27582
- if stage == nil then
27583
- stage = level:GetStage()
27584
- end
27585
- if stageType == nil then
27586
- stageType = level:GetStageType()
27587
- end
27588
- local stageNames = ENGLISH_LEVEL_NAMES[stage]
27589
- return stageNames[stageType]
27590
- end
27591
27580
  function ____exports.getGotoCommand(self, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault)
27592
27581
  if useSpecialRoomsForRoomTypeDefault == nil then
27593
27582
  useSpecialRoomsForRoomTypeDefault = false
@@ -27597,6 +27586,17 @@ function ____exports.getGotoCommand(self, roomType, roomVariant, useSpecialRooms
27597
27586
  local prefix = isNormalRoom and "d" or "s." .. roomTypeSpecialGotoPrefix
27598
27587
  return (("goto " .. prefix) .. ".") .. tostring(roomVariant)
27599
27588
  end
27589
+ function ____exports.getLevelName(self, stage, stageType)
27590
+ local level = game:GetLevel()
27591
+ if stage == nil then
27592
+ stage = level:GetStage()
27593
+ end
27594
+ if stageType == nil then
27595
+ stageType = level:GetStageType()
27596
+ end
27597
+ local stageNames = LEVEL_NAMES[stage]
27598
+ return stageNames[stageType]
27599
+ end
27600
27600
  function ____exports.getStage(self)
27601
27601
  local level = game:GetLevel()
27602
27602
  return level:GetStage()
@@ -39775,6 +39775,74 @@ function SlotUpdateDetection.prototype.checkNewEntity(self, slot)
39775
39775
  self.postSlotInit:fire(slot)
39776
39776
  end
39777
39777
  end
39778
+ return ____exports
39779
+ end,
39780
+ ["src.objects.batteryNames"] = function(...)
39781
+ local ____exports = {}
39782
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39783
+ local BatterySubType = ____isaac_2Dtypescript_2Ddefinitions.BatterySubType
39784
+ ____exports.DEFAULT_BATTERY_NAME = "Unknown"
39785
+ ____exports.BATTERY_NAMES = {
39786
+ [BatterySubType.NULL] = ____exports.DEFAULT_BATTERY_NAME,
39787
+ [BatterySubType.NORMAL] = "Lil' Battery",
39788
+ [BatterySubType.MICRO] = "Micro Battery",
39789
+ [BatterySubType.MEGA] = "Mega Battery",
39790
+ [BatterySubType.GOLDEN] = "Golden Battery"
39791
+ }
39792
+ return ____exports
39793
+ end,
39794
+ ["src.objects.bombNames"] = function(...)
39795
+ local ____exports = {}
39796
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39797
+ local BombSubType = ____isaac_2Dtypescript_2Ddefinitions.BombSubType
39798
+ ____exports.DEFAULT_BOMB_NAME = "Unknown"
39799
+ ____exports.BOMB_NAMES = {
39800
+ [BombSubType.NULL] = ____exports.DEFAULT_BOMB_NAME,
39801
+ [BombSubType.NORMAL] = "Bomb",
39802
+ [BombSubType.DOUBLE_PACK] = "Double Bomb",
39803
+ [BombSubType.TROLL] = "Troll Bomb",
39804
+ [BombSubType.GOLDEN] = "Golden Bomb",
39805
+ [BombSubType.MEGA_TROLL] = "Megatroll Bomb",
39806
+ [BombSubType.GOLDEN_TROLL] = "Golden Troll Bomb",
39807
+ [BombSubType.GIGA] = "Giga Bomb"
39808
+ }
39809
+ return ____exports
39810
+ end,
39811
+ ["src.objects.chestNames"] = function(...)
39812
+ local ____exports = {}
39813
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39814
+ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
39815
+ ____exports.CHEST_NAMES = {
39816
+ [PickupVariant.CHEST] = "Chest",
39817
+ [PickupVariant.BOMB_CHEST] = "Bomb Chest",
39818
+ [PickupVariant.SPIKED_CHEST] = "Spiked Chest",
39819
+ [PickupVariant.ETERNAL_CHEST] = "Eternal Chest",
39820
+ [PickupVariant.MIMIC_CHEST] = "Mimic Chest",
39821
+ [PickupVariant.OLD_CHEST] = "Old Chest",
39822
+ [PickupVariant.WOODEN_CHEST] = "Wooden Chest",
39823
+ [PickupVariant.MEGA_CHEST] = "Mega Chest",
39824
+ [PickupVariant.HAUNTED_CHEST] = "Haunted Chest",
39825
+ [PickupVariant.LOCKED_CHEST] = "Locked Chest",
39826
+ [PickupVariant.RED_CHEST] = "Red Chest",
39827
+ [PickupVariant.MOMS_CHEST] = "Mom's Chest"
39828
+ }
39829
+ return ____exports
39830
+ end,
39831
+ ["src.objects.coinNames"] = function(...)
39832
+ local ____exports = {}
39833
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39834
+ local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
39835
+ ____exports.DEFAULT_COIN_NAME = "Unknown"
39836
+ ____exports.COIN_NAMES = {
39837
+ [CoinSubType.NULL] = ____exports.DEFAULT_COIN_NAME,
39838
+ [CoinSubType.PENNY] = "Penny",
39839
+ [CoinSubType.NICKEL] = "Nickel",
39840
+ [CoinSubType.DIME] = "Dime",
39841
+ [CoinSubType.DOUBLE_PACK] = "Double Penny",
39842
+ [CoinSubType.LUCKY_PENNY] = "Lucky Penny",
39843
+ [CoinSubType.STICKY_NICKEL] = "Sticky Nickel",
39844
+ [CoinSubType.GOLDEN] = "Golden Penny"
39845
+ }
39778
39846
  return ____exports
39779
39847
  end,
39780
39848
  ["src.objects.coinSubTypeToValue"] = function(...)
@@ -39792,6 +39860,50 @@ ____exports.COIN_SUB_TYPE_TO_VALUE = {
39792
39860
  [CoinSubType.STICKY_NICKEL] = 5,
39793
39861
  [CoinSubType.GOLDEN] = 1
39794
39862
  }
39863
+ return ____exports
39864
+ end,
39865
+ ["src.objects.heartNames"] = function(...)
39866
+ local ____exports = {}
39867
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39868
+ local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
39869
+ ____exports.DEFAULT_HEART_NAME = "Unknown"
39870
+ ____exports.HEART_NAMES = {
39871
+ [HeartSubType.NULL] = ____exports.DEFAULT_HEART_NAME,
39872
+ [HeartSubType.FULL] = "Heart",
39873
+ [HeartSubType.HALF] = "Heart (half)",
39874
+ [HeartSubType.SOUL] = "Heart (soul)",
39875
+ [HeartSubType.ETERNAL] = "Heart (eternal)",
39876
+ [HeartSubType.DOUBLE_PACK] = "Heart (double)",
39877
+ [HeartSubType.BLACK] = "Black Heart",
39878
+ [HeartSubType.GOLDEN] = "Gold Heart",
39879
+ [HeartSubType.HALF_SOUL] = "Heart (half soul)",
39880
+ [HeartSubType.SCARED] = "Scared Heart",
39881
+ [HeartSubType.BLENDED] = "Blended Heart",
39882
+ [HeartSubType.BONE] = "Bone Heart",
39883
+ [HeartSubType.ROTTEN] = "Rotten Heart"
39884
+ }
39885
+ return ____exports
39886
+ end,
39887
+ ["src.objects.keyNames"] = function(...)
39888
+ local ____exports = {}
39889
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39890
+ local KeySubType = ____isaac_2Dtypescript_2Ddefinitions.KeySubType
39891
+ ____exports.DEFAULT_KEY_NAME = "Unknown"
39892
+ ____exports.KEY_NAMES = {
39893
+ [KeySubType.NULL] = ____exports.DEFAULT_KEY_NAME,
39894
+ [KeySubType.NORMAL] = "Key",
39895
+ [KeySubType.GOLDEN] = "Golden Key",
39896
+ [KeySubType.DOUBLE_PACK] = "Key Ring",
39897
+ [KeySubType.CHARGED] = "Charged Key"
39898
+ }
39899
+ return ____exports
39900
+ end,
39901
+ ["src.objects.sackNames"] = function(...)
39902
+ local ____exports = {}
39903
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
39904
+ local SackSubType = ____isaac_2Dtypescript_2Ddefinitions.SackSubType
39905
+ ____exports.DEFAULT_SACK_NAME = "Unknown"
39906
+ ____exports.SACK_NAMES = {[SackSubType.NULL] = ____exports.DEFAULT_SACK_NAME, [SackSubType.NORMAL] = "Grab Bag", [SackSubType.BLACK] = "Black Sack"}
39795
39907
  return ____exports
39796
39908
  end,
39797
39909
  ["src.sets.redHeartSubTypesSet"] = function(...)
@@ -40165,9 +40277,29 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
40165
40277
  local ____exports = {}
40166
40278
  local ____constants = require("src.core.constants")
40167
40279
  local CHEST_PICKUP_VARIANTS_SET = ____constants.CHEST_PICKUP_VARIANTS_SET
40280
+ local ____batteryNames = require("src.objects.batteryNames")
40281
+ local BATTERY_NAMES = ____batteryNames.BATTERY_NAMES
40282
+ local DEFAULT_BATTERY_NAME = ____batteryNames.DEFAULT_BATTERY_NAME
40283
+ local ____bombNames = require("src.objects.bombNames")
40284
+ local BOMB_NAMES = ____bombNames.BOMB_NAMES
40285
+ local DEFAULT_BOMB_NAME = ____bombNames.DEFAULT_BOMB_NAME
40286
+ local ____chestNames = require("src.objects.chestNames")
40287
+ local CHEST_NAMES = ____chestNames.CHEST_NAMES
40288
+ local ____coinNames = require("src.objects.coinNames")
40289
+ local COIN_NAMES = ____coinNames.COIN_NAMES
40290
+ local DEFAULT_COIN_NAME = ____coinNames.DEFAULT_COIN_NAME
40168
40291
  local ____coinSubTypeToValue = require("src.objects.coinSubTypeToValue")
40169
40292
  local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
40170
40293
  local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
40294
+ local ____heartNames = require("src.objects.heartNames")
40295
+ local DEFAULT_HEART_NAME = ____heartNames.DEFAULT_HEART_NAME
40296
+ local HEART_NAMES = ____heartNames.HEART_NAMES
40297
+ local ____keyNames = require("src.objects.keyNames")
40298
+ local DEFAULT_KEY_NAME = ____keyNames.DEFAULT_KEY_NAME
40299
+ local KEY_NAMES = ____keyNames.KEY_NAMES
40300
+ local ____sackNames = require("src.objects.sackNames")
40301
+ local DEFAULT_SACK_NAME = ____sackNames.DEFAULT_SACK_NAME
40302
+ local SACK_NAMES = ____sackNames.SACK_NAMES
40171
40303
  local ____redHeartSubTypesSet = require("src.sets.redHeartSubTypesSet")
40172
40304
  local RED_HEART_SUB_TYPES_SET = ____redHeartSubTypesSet.RED_HEART_SUB_TYPES_SET
40173
40305
  local ____entities = require("src.functions.entities")
@@ -40179,10 +40311,29 @@ local getHearts = ____pickupsSpecific.getHearts
40179
40311
  function ____exports.isChestVariant(self, pickupVariant)
40180
40312
  return CHEST_PICKUP_VARIANTS_SET:has(pickupVariant)
40181
40313
  end
40314
+ function ____exports.getBatteryName(self, batterySubType)
40315
+ return BATTERY_NAMES[batterySubType] or DEFAULT_BATTERY_NAME
40316
+ end
40317
+ function ____exports.getBombName(self, bombSubType)
40318
+ return BOMB_NAMES[bombSubType] or DEFAULT_BOMB_NAME
40319
+ end
40320
+ function ____exports.getChestName(self, pickupVariant)
40321
+ local chestNames = CHEST_NAMES
40322
+ return chestNames[pickupVariant] or "Unknown"
40323
+ end
40324
+ function ____exports.getCoinName(self, coinSubType)
40325
+ return COIN_NAMES[coinSubType] or DEFAULT_COIN_NAME
40326
+ end
40182
40327
  function ____exports.getCoinValue(self, coinSubType)
40183
40328
  local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
40184
40329
  return value or DEFAULT_COIN_VALUE
40185
40330
  end
40331
+ function ____exports.getHeartName(self, heartSubType)
40332
+ return HEART_NAMES[heartSubType] or DEFAULT_HEART_NAME
40333
+ end
40334
+ function ____exports.getKeyName(self, keySubType)
40335
+ return KEY_NAMES[keySubType] or DEFAULT_KEY_NAME
40336
+ end
40186
40337
  function ____exports.getRedHearts(self)
40187
40338
  local hearts = getHearts(nil)
40188
40339
  return __TS__ArrayFilter(
@@ -40190,6 +40341,9 @@ function ____exports.getRedHearts(self)
40190
40341
  function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
40191
40342
  )
40192
40343
  end
40344
+ function ____exports.getSackName(self, sackSubType)
40345
+ return SACK_NAMES[sackSubType] or DEFAULT_SACK_NAME
40346
+ end
40193
40347
  function ____exports.isChest(self, pickup)
40194
40348
  return ____exports.isChestVariant(nil, pickup.Variant)
40195
40349
  end
@@ -55725,6 +55879,14 @@ do
55725
55879
  end
55726
55880
  end
55727
55881
  end
55882
+ do
55883
+ local ____export = require("src.maps.collectibleNameToTypeMap")
55884
+ for ____exportKey, ____exportValue in pairs(____export) do
55885
+ if ____exportKey ~= "default" then
55886
+ ____exports[____exportKey] = ____exportValue
55887
+ end
55888
+ end
55889
+ end
55728
55890
  do
55729
55891
  local ____export = require("src.maps.pillNameToEffectMap")
55730
55892
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -55749,6 +55911,14 @@ do
55749
55911
  end
55750
55912
  end
55751
55913
  end
55914
+ do
55915
+ local ____export = require("src.maps.trinketNameToTypeMap")
55916
+ for ____exportKey, ____exportValue in pairs(____export) do
55917
+ if ____exportKey ~= "default" then
55918
+ ____exports[____exportKey] = ____exportValue
55919
+ end
55920
+ end
55921
+ end
55752
55922
  do
55753
55923
  local ____export = require("src.objects.colors")
55754
55924
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -56873,6 +57043,14 @@ do
56873
57043
  end
56874
57044
  end
56875
57045
  end
57046
+ do
57047
+ local ____export = require("src.maps.collectibleNameToTypeMap")
57048
+ for ____exportKey, ____exportValue in pairs(____export) do
57049
+ if ____exportKey ~= "default" then
57050
+ ____exports[____exportKey] = ____exportValue
57051
+ end
57052
+ end
57053
+ end
56876
57054
  do
56877
57055
  local ____export = require("src.maps.pillNameToEffectMap")
56878
57056
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -56897,6 +57075,14 @@ do
56897
57075
  end
56898
57076
  end
56899
57077
  end
57078
+ do
57079
+ local ____export = require("src.maps.trinketNameToTypeMap")
57080
+ for ____exportKey, ____exportValue in pairs(____export) do
57081
+ if ____exportKey ~= "default" then
57082
+ ____exports[____exportKey] = ____exportValue
57083
+ end
57084
+ end
57085
+ end
56900
57086
  do
56901
57087
  local ____export = require("src.objects.colors")
56902
57088
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -7,7 +7,10 @@ import { ItemConfigCardType } from "isaac-typescript-definitions";
7
7
  */
8
8
  export declare function getCardDescription(cardType: CardType): string;
9
9
  /**
10
- * Helper function to get a card name from a Card.
10
+ * Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
11
+ * valid.
12
+ *
13
+ * This function works for both vanilla and modded trinkets.
11
14
  *
12
15
  * For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
13
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../../src/functions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAW,MAAM,8BAA8B,CAAC;AAW3E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAgB7D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAgBtD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,GACjB,kBAAkB,GAAG,SAAS,CAOhC;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAOlD;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAET;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE9D;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE9D;AAED,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAElD;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEvD;AAED,iDAAiD;AACjD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAG1E"}
1
+ {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../../src/functions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAW,MAAM,8BAA8B,CAAC;AAW3E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAgB7D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAgBtD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,GACjB,kBAAkB,GAAG,SAAS,CAOhC;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAOlD;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAET;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE9D;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE9D;AAED,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAElD;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEvD;AAED,iDAAiD;AACjD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAG1E"}
@@ -34,7 +34,10 @@ function ____exports.getCardDescription(self, cardType)
34
34
  end
35
35
  return DEFAULT_CARD_DESCRIPTION
36
36
  end
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
  function ____exports.getCardName(self, cardType)
@@ -57,9 +57,9 @@ export declare function getCollectibleMaxCharges(collectibleOrCollectibleType: E
57
57
  * Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
58
58
  * type is not valid.
59
59
  *
60
- * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
61
- *
62
60
  * This function works for both vanilla and modded collectibles.
61
+ *
62
+ * For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
63
63
  */
64
64
  export declare function getCollectibleName(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
65
65
  /**
@@ -265,9 +265,9 @@ end
265
265
  --- Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
266
266
  -- type is not valid.
267
267
  --
268
- -- For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
269
- --
270
268
  -- This function works for both vanilla and modded collectibles.
269
+ --
270
+ -- For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
271
271
  function ____exports.getCollectibleName(self, collectibleOrCollectibleType)
272
272
  local collectibleType = getCollectibleTypeFromArg(nil, collectibleOrCollectibleType, "getCollectibleName")
273
273
  local collectibleName = COLLECTIBLE_TYPE_TO_NAME_MAP:get(collectibleType)