isaacscript-common 46.0.0 → 47.0.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 (54) hide show
  1. package/dist/index.rollup.d.ts +66 -15
  2. package/dist/isaacscript-common.lua +170 -16
  3. package/dist/src/functions/cards.d.ts +1 -1
  4. package/dist/src/functions/cards.lua +1 -1
  5. package/dist/src/functions/pickups.d.ts +45 -1
  6. package/dist/src/functions/pickups.d.ts.map +1 -1
  7. package/dist/src/functions/pickups.lua +65 -0
  8. package/dist/src/functions/pills.d.ts +1 -1
  9. package/dist/src/functions/pills.lua +1 -1
  10. package/dist/src/functions/stage.d.ts +12 -12
  11. package/dist/src/functions/stage.d.ts.map +1 -1
  12. package/dist/src/functions/stage.lua +21 -21
  13. package/dist/src/objects/batteryNames.d.ts +10 -0
  14. package/dist/src/objects/batteryNames.d.ts.map +1 -0
  15. package/dist/src/objects/batteryNames.lua +13 -0
  16. package/dist/src/objects/bombNames.d.ts +13 -0
  17. package/dist/src/objects/bombNames.d.ts.map +1 -0
  18. package/dist/src/objects/bombNames.lua +16 -0
  19. package/dist/src/objects/chestNames.d.ts +16 -0
  20. package/dist/src/objects/chestNames.d.ts.map +1 -0
  21. package/dist/src/objects/chestNames.lua +19 -0
  22. package/dist/src/objects/coinNames.d.ts +13 -0
  23. package/dist/src/objects/coinNames.d.ts.map +1 -0
  24. package/dist/src/objects/coinNames.lua +16 -0
  25. package/dist/src/objects/heartNames.d.ts +18 -0
  26. package/dist/src/objects/heartNames.d.ts.map +1 -0
  27. package/dist/src/objects/heartNames.lua +21 -0
  28. package/dist/src/objects/keyNames.d.ts +10 -0
  29. package/dist/src/objects/keyNames.d.ts.map +1 -0
  30. package/dist/src/objects/keyNames.lua +13 -0
  31. package/dist/src/objects/{englishLevelNames.d.ts → levelNames.d.ts} +2 -2
  32. package/dist/src/objects/levelNames.d.ts.map +1 -0
  33. package/dist/src/objects/{englishLevelNames.lua → levelNames.lua} +1 -1
  34. package/dist/src/objects/sackNames.d.ts +8 -0
  35. package/dist/src/objects/sackNames.d.ts.map +1 -0
  36. package/dist/src/objects/sackNames.lua +7 -0
  37. package/package.json +1 -1
  38. package/src/functions/cards.ts +1 -1
  39. package/src/functions/pickups.ts +89 -0
  40. package/src/functions/pills.ts +3 -1
  41. package/src/functions/stage.ts +26 -26
  42. package/src/objects/batteryNames.ts +12 -0
  43. package/src/objects/bombNames.ts +16 -0
  44. package/src/objects/cardNames.ts +98 -98
  45. package/src/objects/chestNames.ts +18 -0
  46. package/src/objects/coinNames.ts +15 -0
  47. package/src/objects/heartNames.ts +20 -0
  48. package/src/objects/keyNames.ts +12 -0
  49. package/src/objects/languageNames.ts +7 -7
  50. package/src/objects/{englishLevelNames.ts → levelNames.ts} +26 -1
  51. package/src/objects/pillEffectNames.ts +50 -50
  52. package/src/objects/pillEffectTypes.ts +50 -50
  53. package/src/objects/sackNames.ts +10 -0
  54. package/dist/src/objects/englishLevelNames.d.ts.map +0 -1
@@ -4803,6 +4803,14 @@ export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPla
4803
4803
  */
4804
4804
  export declare function getBatteries(batterySubType?: BatterySubType | -1): EntityPickupBattery[];
4805
4805
 
4806
+ /**
4807
+ * Helper function to get a battery name from a `BatterySubType`, as listed in the "entities2.xml"
4808
+ * file.
4809
+ *
4810
+ * For example, `getBatteryName(BatterySubType.MICRO)` would return "Micro Battery".
4811
+ */
4812
+ export declare function getBatteryName(batterySubType: BatterySubType): string;
4813
+
4806
4814
  /**
4807
4815
  * Helper function to get the door that leads to the off-grid room that contains the hole to the
4808
4816
  * Blue Womb. (In vanilla, the door will only appear in the It Lives Boss Room.)
@@ -4811,6 +4819,13 @@ export declare function getBatteries(batterySubType?: BatterySubType | -1): Enti
4811
4819
  */
4812
4820
  export declare function getBlueWombDoor(): GridEntityDoor | undefined;
4813
4821
 
4822
+ /**
4823
+ * Helper function to get a bomb name from a `BombSubType`, as listed in the "entities2.xml" file.
4824
+ *
4825
+ * For example, `getBombName(BombSubType.DOUBLE_PACK)` would return "Double Bomb".
4826
+ */
4827
+ export declare function getBombName(bombSubType: BombSubType): string;
4828
+
4814
4829
  /**
4815
4830
  * Helper function to get all of the bomb entities in the room. (Specifically, this refers to bomb
4816
4831
  * pickups, not the `EntityBomb` class.)
@@ -4882,7 +4897,7 @@ export declare function getBossSet(stage: int, stageType: StageType): ReadonlySe
4882
4897
  export declare function getCardDescription(cardType: CardType): string;
4883
4898
 
4884
4899
  /**
4885
- * Helper function to get a card name from a Card.
4900
+ * Helper function to get a card name from a `CardType`.
4886
4901
  *
4887
4902
  * For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
4888
4903
  */
@@ -4951,6 +4966,14 @@ export declare function getCharacterStartingTrinketType(character: PlayerType):
4951
4966
  */
4952
4967
  export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot?: ActiveSlot): int;
4953
4968
 
4969
+ /**
4970
+ * Helper function to get a chest name from a `PickupVariant`, as listed in the "entities2.xml"
4971
+ * file. Returns "Unknown" if the pickup variant was not a chest.
4972
+ *
4973
+ * For example, `getChestName(PickupVariant.SPIKED_CHEST)` would return "Spiked Chest".
4974
+ */
4975
+ export declare function getChestName(pickupVariant: PickupVariant): string;
4976
+
4954
4977
  /**
4955
4978
  * Helper function to get an array of equidistant points on the circumference around a circle.
4956
4979
  * Useful for equally distributing things in a circle pattern.
@@ -5000,6 +5023,13 @@ export declare function getClosestPlayer(position: Vector): EntityPlayer;
5000
5023
  */
5001
5024
  export declare function getClosestVectorTo(referenceVector: Vector, vectors: Vector[]): Vector | undefined;
5002
5025
 
5026
+ /**
5027
+ * Helper function to get a coin name from a `CoinSubType`, as listed in the "entities2.xml" file.
5028
+ *
5029
+ * For example, `getCoinName(CoinSubType.DOUBLE_PACK)` would return "Double Penny".
5030
+ */
5031
+ export declare function getCoinName(coinSubType: CoinSubType): string;
5032
+
5003
5033
  /**
5004
5034
  * Helper function to get all of the coin pickup entities in the room.
5005
5035
  *
@@ -5278,19 +5308,6 @@ export declare function getEffects(effectVariant?: EffectVariant | -1, subType?:
5278
5308
  */
5279
5309
  export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
5280
5310
 
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
5311
  /**
5295
5312
  * Helper function to get all of the entities in the room or all of the entities that match a
5296
5313
  * specific entity type / variant / sub-type.
@@ -5602,6 +5619,13 @@ export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSl
5602
5619
  */
5603
5620
  export declare function getGridIndexesBetween(gridIndex1: int, gridIndex2: int, roomShape: RoomShape): int[];
5604
5621
 
5622
+ /**
5623
+ * Helper function to get a heart name from a `HeartSubType`, as listed in the "entities2.xml" file.
5624
+ *
5625
+ * For example, `getHeartName(HeartSubType.ETERNAL)` would return "Heart (eternal)".
5626
+ */
5627
+ export declare function getHeartName(heartSubType: HeartSubType): string;
5628
+
5605
5629
  /**
5606
5630
  * Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this
5607
5631
  * function will return 6.
@@ -5717,6 +5741,13 @@ export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[] | readonly J
5717
5741
  /** Helper function to get the value of a specific but in a binary representation of a number. */
5718
5742
  export declare function getKBitOfN(k: int, n: int): int;
5719
5743
 
5744
+ /**
5745
+ * Helper function to get a key name from a `KeySubType`, as listed in the "entities2.xml" file.
5746
+ *
5747
+ * For example, `getKeyName(KeySubType.DOUBLE_PACK)` would return "Key Ring".
5748
+ */
5749
+ export declare function getKeyName(keySubType: KeySubType): string;
5750
+
5720
5751
  /**
5721
5752
  * Helper function to get all of the key pickup entities in the room.
5722
5753
  *
@@ -5794,6 +5825,19 @@ export declare function getLastFrameOfAnimation(sprite: Sprite, animation?: stri
5794
5825
  */
5795
5826
  export declare function getLevelBossIDs(): BossID[];
5796
5827
 
5828
+ /**
5829
+ * Helper function to get the English name of the level. For example, "Caves 1".
5830
+ *
5831
+ * This is useful because the `Level.GetName` method returns a localized version of the level name,
5832
+ * which will not display correctly on some fonts.
5833
+ *
5834
+ * Note that this returns "Blue Womb" instead of "???" for stage 9.
5835
+ *
5836
+ * @param stage Optional. If not specified, the current stage will be used.
5837
+ * @param stageType Optional. If not specified, the current stage type will be used.
5838
+ */
5839
+ export declare function getLevelName(stage?: LevelStage, stageType?: StageType): string;
5840
+
5797
5841
  /**
5798
5842
  * Helper function to get the lowest value in an array. Returns undefined if there were no elements
5799
5843
  * in the array.
@@ -6154,7 +6198,7 @@ export declare function getPillColorFromEffect(pillEffect: PillEffect): PillColo
6154
6198
  export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPillEffectClass;
6155
6199
 
6156
6200
  /**
6157
- * Helper function to get a pill effect name from a PillEffect enum value.
6201
+ * Helper function to get a pill effect name from a `PillEffect`.
6158
6202
  *
6159
6203
  * For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
6160
6204
  */
@@ -7184,6 +7228,13 @@ export declare function getRoomVariant(roomGridIndex?: int): int | undefined;
7184
7228
  */
7185
7229
  export declare function getRoomVisitedCount(roomGridIndex?: int): int;
7186
7230
 
7231
+ /**
7232
+ * Helper function to get a sack name from a `SackSubType`, as listed in the "entities2.xml" file.
7233
+ *
7234
+ * For example, `getSackName(SackSubType.NORMAL)` would return "Grab Bag".
7235
+ */
7236
+ export declare function getSackName(sackSubType: SackSubType): string;
7237
+
7187
7238
  /**
7188
7239
  * Helper function to get all of the sack (i.e. grab bag) entities in the room.
7189
7240
  *
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 46.0.0
3
+ isaacscript-common 47.0.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
@@ -7,7 +7,7 @@ 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 a card name from a `CardType`.
11
11
  *
12
12
  * For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
13
13
  */
@@ -34,7 +34,7 @@ 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 a card name from a `CardType`.
38
38
  --
39
39
  -- For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
40
40
  function ____exports.getCardName(self, cardType)
@@ -1,11 +1,55 @@
1
- import type { CoinSubType, HeartSubType, PickupVariant } from "isaac-typescript-definitions";
1
+ import type { BatterySubType, BombSubType, CoinSubType, HeartSubType, KeySubType, PickupVariant, SackSubType } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function to get a battery name from a `BatterySubType`, as listed in the "entities2.xml"
4
+ * file.
5
+ *
6
+ * For example, `getBatteryName(BatterySubType.MICRO)` would return "Micro Battery".
7
+ */
8
+ export declare function getBatteryName(batterySubType: BatterySubType): string;
9
+ /**
10
+ * Helper function to get a bomb name from a `BombSubType`, as listed in the "entities2.xml" file.
11
+ *
12
+ * For example, `getBombName(BombSubType.DOUBLE_PACK)` would return "Double Bomb".
13
+ */
14
+ export declare function getBombName(bombSubType: BombSubType): string;
15
+ /**
16
+ * Helper function to get a chest name from a `PickupVariant`, as listed in the "entities2.xml"
17
+ * file. Returns "Unknown" if the pickup variant was not a chest.
18
+ *
19
+ * For example, `getChestName(PickupVariant.SPIKED_CHEST)` would return "Spiked Chest".
20
+ */
21
+ export declare function getChestName(pickupVariant: PickupVariant): string;
22
+ /**
23
+ * Helper function to get a coin name from a `CoinSubType`, as listed in the "entities2.xml" file.
24
+ *
25
+ * For example, `getCoinName(CoinSubType.DOUBLE_PACK)` would return "Double Penny".
26
+ */
27
+ export declare function getCoinName(coinSubType: CoinSubType): string;
2
28
  /**
3
29
  * Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
4
30
  * sub-types.
5
31
  */
6
32
  export declare function getCoinValue(coinSubType: CoinSubType): int;
33
+ /**
34
+ * Helper function to get a heart name from a `HeartSubType`, as listed in the "entities2.xml" file.
35
+ *
36
+ * For example, `getHeartName(HeartSubType.ETERNAL)` would return "Heart (eternal)".
37
+ */
38
+ export declare function getHeartName(heartSubType: HeartSubType): string;
39
+ /**
40
+ * Helper function to get a key name from a `KeySubType`, as listed in the "entities2.xml" file.
41
+ *
42
+ * For example, `getKeyName(KeySubType.DOUBLE_PACK)` would return "Key Ring".
43
+ */
44
+ export declare function getKeyName(keySubType: KeySubType): string;
7
45
  /** Helper function to get all of the red heart pickup entities in the room. */
8
46
  export declare function getRedHearts(): EntityPickupHeart[];
47
+ /**
48
+ * Helper function to get a sack name from a `SackSubType`, as listed in the "entities2.xml" file.
49
+ *
50
+ * For example, `getSackName(SackSubType.NORMAL)` would return "Grab Bag".
51
+ */
52
+ export declare function getSackName(sackSubType: SackSubType): string;
9
53
  /** Helper function to test if the provided pickup matches one of the various chest variants. */
10
54
  export declare function isChest(pickup: EntityPickup): boolean;
11
55
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,8BAA8B,CAAC;AAWtC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAErD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAEpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
1
+ {"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAkBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAIrE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAGjE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAI5D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAI/D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAIzD;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAI5D;AAED,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAErD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAEpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
@@ -3,9 +3,29 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
3
3
  local ____exports = {}
4
4
  local ____constants = require("src.core.constants")
5
5
  local CHEST_PICKUP_VARIANTS_SET = ____constants.CHEST_PICKUP_VARIANTS_SET
6
+ local ____batteryNames = require("src.objects.batteryNames")
7
+ local BATTERY_NAMES = ____batteryNames.BATTERY_NAMES
8
+ local DEFAULT_BATTERY_NAME = ____batteryNames.DEFAULT_BATTERY_NAME
9
+ local ____bombNames = require("src.objects.bombNames")
10
+ local BOMB_NAMES = ____bombNames.BOMB_NAMES
11
+ local DEFAULT_BOMB_NAME = ____bombNames.DEFAULT_BOMB_NAME
12
+ local ____chestNames = require("src.objects.chestNames")
13
+ local CHEST_NAMES = ____chestNames.CHEST_NAMES
14
+ local ____coinNames = require("src.objects.coinNames")
15
+ local COIN_NAMES = ____coinNames.COIN_NAMES
16
+ local DEFAULT_COIN_NAME = ____coinNames.DEFAULT_COIN_NAME
6
17
  local ____coinSubTypeToValue = require("src.objects.coinSubTypeToValue")
7
18
  local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
8
19
  local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
20
+ local ____heartNames = require("src.objects.heartNames")
21
+ local DEFAULT_HEART_NAME = ____heartNames.DEFAULT_HEART_NAME
22
+ local HEART_NAMES = ____heartNames.HEART_NAMES
23
+ local ____keyNames = require("src.objects.keyNames")
24
+ local DEFAULT_KEY_NAME = ____keyNames.DEFAULT_KEY_NAME
25
+ local KEY_NAMES = ____keyNames.KEY_NAMES
26
+ local ____sackNames = require("src.objects.sackNames")
27
+ local DEFAULT_SACK_NAME = ____sackNames.DEFAULT_SACK_NAME
28
+ local SACK_NAMES = ____sackNames.SACK_NAMES
9
29
  local ____redHeartSubTypesSet = require("src.sets.redHeartSubTypesSet")
10
30
  local RED_HEART_SUB_TYPES_SET = ____redHeartSubTypesSet.RED_HEART_SUB_TYPES_SET
11
31
  local ____entities = require("src.functions.entities")
@@ -18,12 +38,51 @@ local getHearts = ____pickupsSpecific.getHearts
18
38
  function ____exports.isChestVariant(self, pickupVariant)
19
39
  return CHEST_PICKUP_VARIANTS_SET:has(pickupVariant)
20
40
  end
41
+ --- Helper function to get a battery name from a `BatterySubType`, as listed in the "entities2.xml"
42
+ -- file.
43
+ --
44
+ -- For example, `getBatteryName(BatterySubType.MICRO)` would return "Micro Battery".
45
+ function ____exports.getBatteryName(self, batterySubType)
46
+ return BATTERY_NAMES[batterySubType] or DEFAULT_BATTERY_NAME
47
+ end
48
+ --- Helper function to get a bomb name from a `BombSubType`, as listed in the "entities2.xml" file.
49
+ --
50
+ -- For example, `getBombName(BombSubType.DOUBLE_PACK)` would return "Double Bomb".
51
+ function ____exports.getBombName(self, bombSubType)
52
+ return BOMB_NAMES[bombSubType] or DEFAULT_BOMB_NAME
53
+ end
54
+ --- Helper function to get a chest name from a `PickupVariant`, as listed in the "entities2.xml"
55
+ -- file. Returns "Unknown" if the pickup variant was not a chest.
56
+ --
57
+ -- For example, `getChestName(PickupVariant.SPIKED_CHEST)` would return "Spiked Chest".
58
+ function ____exports.getChestName(self, pickupVariant)
59
+ local chestNames = CHEST_NAMES
60
+ return chestNames[pickupVariant] or "Unknown"
61
+ end
62
+ --- Helper function to get a coin name from a `CoinSubType`, as listed in the "entities2.xml" file.
63
+ --
64
+ -- For example, `getCoinName(CoinSubType.DOUBLE_PACK)` would return "Double Penny".
65
+ function ____exports.getCoinName(self, coinSubType)
66
+ return COIN_NAMES[coinSubType] or DEFAULT_COIN_NAME
67
+ end
21
68
  --- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
22
69
  -- sub-types.
23
70
  function ____exports.getCoinValue(self, coinSubType)
24
71
  local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
25
72
  return value or DEFAULT_COIN_VALUE
26
73
  end
74
+ --- Helper function to get a heart name from a `HeartSubType`, as listed in the "entities2.xml" file.
75
+ --
76
+ -- For example, `getHeartName(HeartSubType.ETERNAL)` would return "Heart (eternal)".
77
+ function ____exports.getHeartName(self, heartSubType)
78
+ return HEART_NAMES[heartSubType] or DEFAULT_HEART_NAME
79
+ end
80
+ --- Helper function to get a key name from a `KeySubType`, as listed in the "entities2.xml" file.
81
+ --
82
+ -- For example, `getKeyName(KeySubType.DOUBLE_PACK)` would return "Key Ring".
83
+ function ____exports.getKeyName(self, keySubType)
84
+ return KEY_NAMES[keySubType] or DEFAULT_KEY_NAME
85
+ end
27
86
  --- Helper function to get all of the red heart pickup entities in the room.
28
87
  function ____exports.getRedHearts(self)
29
88
  local hearts = getHearts(nil)
@@ -32,6 +91,12 @@ function ____exports.getRedHearts(self)
32
91
  function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
33
92
  )
34
93
  end
94
+ --- Helper function to get a sack name from a `SackSubType`, as listed in the "entities2.xml" file.
95
+ --
96
+ -- For example, `getSackName(SackSubType.NORMAL)` would return "Grab Bag".
97
+ function ____exports.getSackName(self, sackSubType)
98
+ return SACK_NAMES[sackSubType] or DEFAULT_SACK_NAME
99
+ end
35
100
  --- Helper function to test if the provided pickup matches one of the various chest variants.
36
101
  function ____exports.isChest(self, pickup)
37
102
  return ____exports.isChestVariant(nil, pickup.Variant)
@@ -60,7 +60,7 @@ export declare function getPillColorFromEffect(pillEffect: PillEffect): PillColo
60
60
  */
61
61
  export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPillEffectClass;
62
62
  /**
63
- * Helper function to get a pill effect name from a PillEffect enum value.
63
+ * Helper function to get a pill effect name from a `PillEffect`.
64
64
  *
65
65
  * For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
66
66
  */
@@ -119,7 +119,7 @@ function ____exports.getPillEffectClass(self, pillEffect)
119
119
  local pillEffectClass = PILL_EFFECT_CLASSES[pillEffect]
120
120
  return pillEffectClass or DEFAULT_PILL_EFFECT_CLASS
121
121
  end
122
- --- Helper function to get a pill effect name from a PillEffect enum value.
122
+ --- Helper function to get a pill effect name from a `PillEffect`.
123
123
  --
124
124
  -- For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
125
125
  function ____exports.getPillEffectName(self, pillEffect)
@@ -16,18 +16,6 @@ export declare function calculateStageTypeRepentance(stage: LevelStage): StageTy
16
16
  * consider Downpour 2 to have a stage of 3.
17
17
  */
18
18
  export declare function getEffectiveStage(): LevelStage;
19
- /**
20
- * Helper function to get the English name of the level. For example, "Caves 1".
21
- *
22
- * This is useful because the `Level.GetName` method returns a localized version of the level name,
23
- * which will not display correctly on some fonts.
24
- *
25
- * Note that this returns "Blue Womb" instead of "???" for stage 9.
26
- *
27
- * @param stage Optional. If not specified, the current stage will be used.
28
- * @param stageType Optional. If not specified, the current stage type will be used.
29
- */
30
- export declare function getEnglishLevelName(stage?: LevelStage, stageType?: StageType): string;
31
19
  /**
32
20
  * Helper function to get the corresponding "goto" console command that would correspond to the
33
21
  * provided room type and room variant.
@@ -39,6 +27,18 @@ export declare function getEnglishLevelName(stage?: LevelStage, stageType?: Stag
39
27
  * `RoomType.DEFAULT` (1). False by default.
40
28
  */
41
29
  export declare function getGotoCommand(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean): string;
30
+ /**
31
+ * Helper function to get the English name of the level. For example, "Caves 1".
32
+ *
33
+ * This is useful because the `Level.GetName` method returns a localized version of the level name,
34
+ * which will not display correctly on some fonts.
35
+ *
36
+ * Note that this returns "Blue Womb" instead of "???" for stage 9.
37
+ *
38
+ * @param stage Optional. If not specified, the current stage will be used.
39
+ * @param stageType Optional. If not specified, the current stage type will be used.
40
+ */
41
+ export declare function getLevelName(stage?: LevelStage, stageType?: StageType): string;
42
42
  /** Alias for the `Level.GetStage` method. */
43
43
  export declare function getStage(): LevelStage;
44
44
  /**