isaacscript-common 38.0.1 → 39.0.1

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.
@@ -12655,6 +12655,9 @@ declare class ModdedElementDetection extends Feature {
12655
12655
  * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
12656
12656
  * 666. We subtract one to account for `CollectibleType.NULL`.)
12657
12657
  *
12658
+ * If there are no mods present that add any custom items, this function will return
12659
+ * `CollectibleType.MOMS_RING` (732).
12660
+ *
12658
12661
  * This function can only be called if at least one callback has been executed. This is because
12659
12662
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
12660
12663
  * order).
@@ -12664,7 +12667,7 @@ declare class ModdedElementDetection extends Feature {
12664
12667
  */
12665
12668
  getLastCollectibleType(): CollectibleType;
12666
12669
  /**
12667
- * Helper function to get an array that represents the all modded collectible types.
12670
+ * Helper function to get an array that represents every modded collectible type.
12668
12671
  *
12669
12672
  * Returns an empty array if there are no modded collectible types.
12670
12673
  *
@@ -12685,6 +12688,10 @@ declare class ModdedElementDetection extends Feature {
12685
12688
  */
12686
12689
  getModdedCollectibleTypes(): CollectibleType[];
12687
12690
  /**
12691
+ * Returns the total number of collectibles in the item config, including both vanilla and modded
12692
+ * items. If you just need the number of vanilla collectible types, use the
12693
+ * `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
12694
+ *
12688
12695
  * This function can only be called if at least one callback has been executed. This is because
12689
12696
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
12690
12697
  * order).
@@ -12717,8 +12724,11 @@ declare class ModdedElementDetection extends Feature {
12717
12724
  /**
12718
12725
  * Will change depending on how many modded trinkets there are.
12719
12726
  *
12720
- * This is equal to the number of trinket types, since all trinket types are contiguous (unlike
12721
- * collectibles).
12727
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
12728
+ * subtract one to account for `TrinketType.NULL`.)
12729
+ *
12730
+ * If there are no mods present that add any custom trinkets, this function will return
12731
+ * `TrinketType.SIGIL_OF_BAPHOMET` (189).
12722
12732
  *
12723
12733
  * This function can only be called if at least one callback has been executed. This is because
12724
12734
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -12732,9 +12742,11 @@ declare class ModdedElementDetection extends Feature {
12732
12742
  *
12733
12743
  * Returns an empty array if there are no modded trinket types.
12734
12744
  *
12735
- * This function is only useful when building collectible type objects. For most purposes, you
12736
- * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
12737
- * instead.
12745
+ * This function is only useful when building trinket type objects. For most purposes, you should
12746
+ * use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
12747
+ *
12748
+ * (This function is named differently from the `getVanillaTrinketTypeRange` function because all
12749
+ * modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
12738
12750
  *
12739
12751
  * This function can only be called if at least one callback has been executed. This is because
12740
12752
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -12744,10 +12756,9 @@ declare class ModdedElementDetection extends Feature {
12744
12756
  */
12745
12757
  getModdedTrinketTypes(): TrinketType[];
12746
12758
  /**
12747
- * Will change depending on how many modded trinkets there are.
12748
- *
12749
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
12750
- * `TrinketType.NULL`.)
12759
+ * Returns the total number of trinkets in the item config, including both vanilla and modded
12760
+ * items. If you just need the number of vanilla trinket types, use the
12761
+ * `NUM_VANILLA_TRINKET_TYPES` constant.
12751
12762
  *
12752
12763
  * This function can only be called if at least one callback has been executed. This is because
12753
12764
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -12757,15 +12768,7 @@ declare class ModdedElementDetection extends Feature {
12757
12768
  */
12758
12769
  getNumTrinketTypes(): int;
12759
12770
  /**
12760
- * This function can only be called if at least one callback has been executed. This is because
12761
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
12762
- *
12763
- * In order to use this function, you must upgrade your mod with
12764
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
12765
- */
12766
- getNumModdedTrinketTypes(): int;
12767
- /**
12768
- * Helper function to get an array that contains every trinket type.
12771
+ * Unlike vanilla trinket types, modded trinket types are always contiguous.
12769
12772
  *
12770
12773
  * This function can only be called if at least one callback has been executed. This is because
12771
12774
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -12773,7 +12776,7 @@ declare class ModdedElementDetection extends Feature {
12773
12776
  * In order to use this function, you must upgrade your mod with
12774
12777
  * `ISCFeature.MODDED_ELEMENT_DETECTION`.
12775
12778
  */
12776
- getTrinketTypes(): TrinketType[];
12779
+ getNumModdedTrinketTypes(): int;
12777
12780
  /**
12778
12781
  * Helper function to get an array with every valid card sub-type. This includes modded cards.
12779
12782
  *
@@ -12915,6 +12918,7 @@ declare class ModdedElementDetection extends Feature {
12915
12918
  }
12916
12919
 
12917
12920
  declare class ModdedElementSets extends Feature {
12921
+ private arraysInitialized;
12918
12922
  private readonly allCollectibleTypesArray;
12919
12923
  private readonly allCollectibleTypesSet;
12920
12924
  private readonly vanillaCollectibleTypesArray;
@@ -12950,6 +12954,7 @@ declare class ModdedElementSets extends Feature {
12950
12954
  */
12951
12955
  private readonly cardSet;
12952
12956
  private readonly moddedElementDetection;
12957
+ private lazyInit;
12953
12958
  private lazyInitVanillaCollectibleTypes;
12954
12959
  private lazyInitModdedCollectibleTypes;
12955
12960
  private lazyInitVanillaTrinketTypes;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 38.0.1
3
+ isaacscript-common 39.0.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -38327,7 +38327,6 @@ local itemConfig = ____cachedClasses.itemConfig
38327
38327
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
38328
38328
  local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
38329
38329
  local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
38330
- local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
38331
38330
  local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
38332
38331
  local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
38333
38332
  local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
@@ -38426,8 +38425,7 @@ end
38426
38425
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedTrinketType", true)
38427
38426
  function ModdedElementDetection.prototype.getLastTrinketType(self)
38428
38427
  self:errorIfNoCallbacksFired("trinket")
38429
- local numTrinketTypes = self:getNumTrinketTypes()
38430
- return asTrinketType(nil, numTrinketTypes)
38428
+ return itemConfig:GetTrinkets().Size - 1
38431
38429
  end
38432
38430
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
38433
38431
  function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
@@ -38442,21 +38440,16 @@ end
38442
38440
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
38443
38441
  function ModdedElementDetection.prototype.getNumTrinketTypes(self)
38444
38442
  self:errorIfNoCallbacksFired("trinket")
38445
- return itemConfig:GetTrinkets().Size - 1
38443
+ local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
38444
+ return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes
38446
38445
  end
38447
38446
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumTrinketTypes", true)
38448
38447
  function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
38449
- self:errorIfNoCallbacksFired("trinket")
38450
- local numTrinketTypes = self:getNumTrinketTypes()
38451
- return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES
38452
- end
38453
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
38454
- function ModdedElementDetection.prototype.getTrinketTypes(self)
38455
38448
  self:errorIfNoCallbacksFired("trinket")
38456
38449
  local lastTrinketType = self:getLastTrinketType()
38457
- return iRange(nil, FIRST_TRINKET_TYPE, lastTrinketType)
38450
+ return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
38458
38451
  end
38459
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getTrinketTypes", true)
38452
+ __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
38460
38453
  function ModdedElementDetection.prototype.getAllCardTypes(self)
38461
38454
  self:errorIfNoCallbacksFired("card")
38462
38455
  local lastCardType = self:getLastCardType()
@@ -38642,6 +38635,7 @@ ModdedElementSets.name = "ModdedElementSets"
38642
38635
  __TS__ClassExtends(ModdedElementSets, Feature)
38643
38636
  function ModdedElementSets.prototype.____constructor(self, moddedElementDetection)
38644
38637
  Feature.prototype.____constructor(self)
38638
+ self.arraysInitialized = false
38645
38639
  self.allCollectibleTypesArray = {}
38646
38640
  self.allCollectibleTypesSet = __TS__New(Set)
38647
38641
  self.vanillaCollectibleTypesArray = {}
@@ -38673,10 +38667,26 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
38673
38667
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
38674
38668
  self.moddedElementDetection = moddedElementDetection
38675
38669
  end
38676
- function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
38677
- if #self.vanillaCollectibleTypesArray > 0 then
38670
+ function ModdedElementSets.prototype.lazyInit(self)
38671
+ if self.arraysInitialized then
38678
38672
  return
38679
38673
  end
38674
+ self.arraysInitialized = true
38675
+ self:lazyInitVanillaCollectibleTypes()
38676
+ self:lazyInitModdedCollectibleTypes()
38677
+ self:lazyInitVanillaTrinketTypes()
38678
+ self:lazyInitModdedTrinketTypes()
38679
+ self:lazyInitVanillaCardTypes()
38680
+ self:lazyInitModdedCardTypes()
38681
+ self:lazyInitTagToCollectibleTypesMap()
38682
+ self:lazyInitCacheFlagToCollectibleTypesMap()
38683
+ self:lazyInitCacheFlagToTrinketTypesMap()
38684
+ self:lazyInitFlyingCollectibleTypesSet()
38685
+ self:lazyInitFlyingTrinketTypesSet()
38686
+ self:lazyInitEdenCollectibleTypesSet()
38687
+ self:lazyInitCardTypes()
38688
+ end
38689
+ function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
38680
38690
  local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
38681
38691
  for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
38682
38692
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
@@ -38688,10 +38698,6 @@ function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
38688
38698
  end
38689
38699
  end
38690
38700
  function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
38691
- if #self.moddedCollectibleTypesArray > 0 then
38692
- return
38693
- end
38694
- self:lazyInitVanillaCollectibleTypes()
38695
38701
  for ____, collectibleType in ipairs(self.vanillaCollectibleTypesArray) do
38696
38702
  local ____self_allCollectibleTypesArray_1 = self.allCollectibleTypesArray
38697
38703
  ____self_allCollectibleTypesArray_1[#____self_allCollectibleTypesArray_1 + 1] = collectibleType
@@ -38711,9 +38717,6 @@ function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
38711
38717
  end
38712
38718
  end
38713
38719
  function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
38714
- if #self.vanillaTrinketTypesArray > 0 then
38715
- return
38716
- end
38717
38720
  local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
38718
38721
  for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
38719
38722
  local itemConfigItem = itemConfig:GetTrinket(trinketType)
@@ -38725,10 +38728,6 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
38725
38728
  end
38726
38729
  end
38727
38730
  function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
38728
- if #self.moddedTrinketTypesArray > 0 then
38729
- return
38730
- end
38731
- self:lazyInitVanillaTrinketTypes()
38732
38731
  for ____, trinketType in ipairs(self.vanillaTrinketTypesArray) do
38733
38732
  local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
38734
38733
  ____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
@@ -38748,9 +38747,6 @@ function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
38748
38747
  end
38749
38748
  end
38750
38749
  function ModdedElementSets.prototype.lazyInitVanillaCardTypes(self)
38751
- if #self.vanillaCardTypesArray > 0 then
38752
- return
38753
- end
38754
38750
  local vanillaCardTypes = getVanillaCardTypes(nil)
38755
38751
  for ____, cardType in ipairs(vanillaCardTypes) do
38756
38752
  local itemConfigCard = itemConfig:GetCard(cardType)
@@ -38762,10 +38758,6 @@ function ModdedElementSets.prototype.lazyInitVanillaCardTypes(self)
38762
38758
  end
38763
38759
  end
38764
38760
  function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
38765
- if #self.moddedCardTypesArray > 0 then
38766
- return
38767
- end
38768
- self:lazyInitVanillaCardTypes()
38769
38761
  for ____, cardType in ipairs(self.vanillaCardTypesArray) do
38770
38762
  local ____self_allCardTypesArray_9 = self.allCardTypesArray
38771
38763
  ____self_allCardTypesArray_9[#____self_allCardTypesArray_9 + 1] = cardType
@@ -38785,9 +38777,6 @@ function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
38785
38777
  end
38786
38778
  end
38787
38779
  function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
38788
- if self.tagToCollectibleTypesMap.size > 0 then
38789
- return
38790
- end
38791
38780
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
38792
38781
  self.tagToCollectibleTypesMap:set(
38793
38782
  itemConfigTag,
@@ -38798,7 +38787,7 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
38798
38787
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
38799
38788
  do
38800
38789
  if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
38801
- goto __continue44
38790
+ goto __continue39
38802
38791
  end
38803
38792
  local collectibleTypesSet = self.tagToCollectibleTypesMap:get(itemConfigTag)
38804
38793
  if collectibleTypesSet == nil then
@@ -38807,14 +38796,11 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
38807
38796
  end
38808
38797
  collectibleTypesSet:add(collectibleType)
38809
38798
  end
38810
- ::__continue44::
38799
+ ::__continue39::
38811
38800
  end
38812
38801
  end
38813
38802
  end
38814
38803
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
38815
- if self.cacheFlagToCollectibleTypesMap.size > 0 then
38816
- return
38817
- end
38818
38804
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
38819
38805
  local collectiblesSet = __TS__New(Set)
38820
38806
  for ____, collectibleType in ipairs(self:getCollectibleArray()) do
@@ -38826,12 +38812,9 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self
38826
38812
  end
38827
38813
  end
38828
38814
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
38829
- if self.cacheFlagToTrinketTypesMap.size > 0 then
38830
- return
38831
- end
38832
38815
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
38833
38816
  local trinketsSet = __TS__New(Set)
38834
- for ____, trinketType in ipairs(self.moddedElementDetection:getTrinketTypes()) do
38817
+ for ____, trinketType in ipairs(self:getTrinketArray()) do
38835
38818
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
38836
38819
  trinketsSet:add(trinketType)
38837
38820
  end
@@ -38840,9 +38823,6 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
38840
38823
  end
38841
38824
  end
38842
38825
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
38843
- if self.flyingCollectibleTypesSet.size > 0 then
38844
- return
38845
- end
38846
38826
  self.flyingCollectibleTypesSet = copySet(
38847
38827
  nil,
38848
38828
  self:getCollectiblesWithCacheFlag(CacheFlag.FLYING)
@@ -38858,9 +38838,6 @@ function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
38858
38838
  end
38859
38839
  end
38860
38840
  function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
38861
- if self.flyingTrinketTypesSet.size > 0 then
38862
- return
38863
- end
38864
38841
  self.flyingTrinketTypesSet = copySet(
38865
38842
  nil,
38866
38843
  self:getTrinketsWithCacheFlag(CacheFlag.FLYING)
@@ -38873,13 +38850,10 @@ function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
38873
38850
  deleteSetsFromSet(nil, self.flyingTrinketTypesSet, trinketsWithAllCacheFlag)
38874
38851
  end
38875
38852
  function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
38876
- if self.edenActiveCollectibleTypesSet.size > 0 then
38877
- return
38878
- end
38879
38853
  for ____, collectibleType in ipairs(self:getCollectibleArray()) do
38880
38854
  do
38881
38855
  if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
38882
- goto __continue73
38856
+ goto __continue63
38883
38857
  end
38884
38858
  if isActiveCollectible(nil, collectibleType) then
38885
38859
  self.edenActiveCollectibleTypesSet:add(collectibleType)
@@ -38888,13 +38862,10 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
38888
38862
  self.edenPassiveCollectibleTypesSet:add(collectibleType)
38889
38863
  end
38890
38864
  end
38891
- ::__continue73::
38865
+ ::__continue63::
38892
38866
  end
38893
38867
  end
38894
38868
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
38895
- if self.itemConfigCardTypeToCardTypeMap.size > 0 then
38896
- return
38897
- end
38898
38869
  for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
38899
38870
  self.itemConfigCardTypeToCardTypeMap:set(
38900
38871
  itemConfigCardType,
@@ -38918,20 +38889,18 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
38918
38889
  end
38919
38890
  end
38920
38891
  function ModdedElementSets.prototype.getCardArray(self)
38921
- self:lazyInitModdedCardTypes()
38892
+ self:lazyInit()
38922
38893
  return self.allCardTypesArray
38923
38894
  end
38924
38895
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardArray", true)
38925
38896
  function ModdedElementSets.prototype.getCardSet(self)
38926
- self:lazyInitModdedCardTypes()
38897
+ self:lazyInit()
38927
38898
  return self.allCardTypesSet
38928
38899
  end
38929
38900
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardSet", true)
38930
38901
  function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
38931
38902
  local itemConfigCardTypes = {...}
38932
- if self.itemConfigCardTypeToCardTypeMap.size == 0 then
38933
- self:lazyInitCardTypes()
38934
- end
38903
+ self:lazyInit()
38935
38904
  local matchingCardTypes = __TS__New(Set)
38936
38905
  for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
38937
38906
  local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
@@ -38948,12 +38917,12 @@ function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
38948
38917
  end
38949
38918
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
38950
38919
  function ModdedElementSets.prototype.getCollectibleArray(self)
38951
- self:lazyInitModdedCollectibleTypes()
38920
+ self:lazyInit()
38952
38921
  return self.allCollectibleTypesArray
38953
38922
  end
38954
38923
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleArray", true)
38955
38924
  function ModdedElementSets.prototype.getCollectibleSet(self)
38956
- self:lazyInitModdedCollectibleTypes()
38925
+ self:lazyInit()
38957
38926
  return self.allCollectibleTypesSet
38958
38927
  end
38959
38928
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleSet", true)
@@ -38968,7 +38937,7 @@ function ModdedElementSets.prototype.getCollectiblesForTransformation(self, play
38968
38937
  end
38969
38938
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesForTransformation", true)
38970
38939
  function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFlag)
38971
- self:lazyInitCacheFlagToCollectibleTypesMap()
38940
+ self:lazyInit()
38972
38941
  local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
38973
38942
  if collectiblesSet == nil then
38974
38943
  return __TS__New(ReadonlySet)
@@ -38977,7 +38946,7 @@ function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFla
38977
38946
  end
38978
38947
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithCacheFlag", true)
38979
38948
  function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
38980
- self:lazyInitTagToCollectibleTypesMap()
38949
+ self:lazyInit()
38981
38950
  local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
38982
38951
  assertDefined(
38983
38952
  nil,
@@ -38988,52 +38957,52 @@ function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
38988
38957
  end
38989
38958
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithTag", true)
38990
38959
  function ModdedElementSets.prototype.getEdenActiveCollectibles(self)
38991
- self:lazyInitEdenCollectibleTypesSet()
38960
+ self:lazyInit()
38992
38961
  return self.edenActiveCollectibleTypesSet
38993
38962
  end
38994
38963
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibles", true)
38995
38964
  function ModdedElementSets.prototype.getEdenPassiveCollectibles(self)
38996
- self:lazyInitEdenCollectibleTypesSet()
38965
+ self:lazyInit()
38997
38966
  return self.edenPassiveCollectibleTypesSet
38998
38967
  end
38999
38968
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibles", true)
39000
38969
  function ModdedElementSets.prototype.getFlyingCollectibles(self, includeConditionalItems)
39001
- self:lazyInitFlyingCollectibleTypesSet()
38970
+ self:lazyInit()
39002
38971
  return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
39003
38972
  end
39004
38973
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibles", true)
39005
38974
  function ModdedElementSets.prototype.getFlyingTrinkets(self)
39006
- self:lazyInitFlyingTrinketTypesSet()
38975
+ self:lazyInit()
39007
38976
  return self.flyingTrinketTypesSet
39008
38977
  end
39009
38978
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinkets", true)
39010
38979
  function ModdedElementSets.prototype.getModdedCardArray(self)
39011
- self:lazyInitModdedCardTypes()
38980
+ self:lazyInit()
39012
38981
  return self.moddedCardTypesArray
39013
38982
  end
39014
38983
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardArray", true)
39015
38984
  function ModdedElementSets.prototype.getModdedCardSet(self)
39016
- self:lazyInitModdedCardTypes()
38985
+ self:lazyInit()
39017
38986
  return self.moddedCardTypesSet
39018
38987
  end
39019
38988
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardSet", true)
39020
38989
  function ModdedElementSets.prototype.getModdedCollectibleArray(self)
39021
- self:lazyInitModdedCollectibleTypes()
38990
+ self:lazyInit()
39022
38991
  return self.moddedCollectibleTypesArray
39023
38992
  end
39024
38993
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleArray", true)
39025
38994
  function ModdedElementSets.prototype.getModdedCollectibleSet(self)
39026
- self:lazyInitModdedCollectibleTypes()
38995
+ self:lazyInit()
39027
38996
  return self.moddedCollectibleTypesSet
39028
38997
  end
39029
38998
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleSet", true)
39030
38999
  function ModdedElementSets.prototype.getModdedTrinketArray(self)
39031
- self:lazyInitModdedTrinketTypes()
39000
+ self:lazyInit()
39032
39001
  return self.moddedTrinketTypesArray
39033
39002
  end
39034
39003
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketArray", true)
39035
39004
  function ModdedElementSets.prototype.getModdedTrinketSet(self)
39036
- self:lazyInitModdedTrinketTypes()
39005
+ self:lazyInit()
39037
39006
  return self.moddedTrinketTypesSet
39038
39007
  end
39039
39008
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketSet", true)
@@ -39132,7 +39101,7 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
39132
39101
  if exceptions == nil then
39133
39102
  exceptions = {}
39134
39103
  end
39135
- self:lazyInitCardTypes()
39104
+ self:lazyInit()
39136
39105
  return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
39137
39106
  end
39138
39107
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
@@ -39166,7 +39135,7 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectible(self, seedOr
39166
39135
  if exceptions == nil then
39167
39136
  exceptions = {}
39168
39137
  end
39169
- self:lazyInitEdenCollectibleTypesSet()
39138
+ self:lazyInit()
39170
39139
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39171
39140
  end
39172
39141
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectible", true)
@@ -39177,22 +39146,22 @@ function ModdedElementSets.prototype.getRandomEdenPassiveCollectible(self, seedO
39177
39146
  if exceptions == nil then
39178
39147
  exceptions = {}
39179
39148
  end
39180
- self:lazyInitEdenCollectibleTypesSet()
39149
+ self:lazyInit()
39181
39150
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39182
39151
  end
39183
39152
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectible", true)
39184
39153
  function ModdedElementSets.prototype.getTrinketArray(self)
39185
- self:lazyInitModdedTrinketTypes()
39154
+ self:lazyInit()
39186
39155
  return self.allTrinketTypesArray
39187
39156
  end
39188
39157
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketArray", true)
39189
39158
  function ModdedElementSets.prototype.getTrinketSet(self)
39190
- self:lazyInitModdedTrinketTypes()
39159
+ self:lazyInit()
39191
39160
  return self.allTrinketTypesSet
39192
39161
  end
39193
39162
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketSet", true)
39194
39163
  function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
39195
- self:lazyInitCacheFlagToTrinketTypesMap()
39164
+ self:lazyInit()
39196
39165
  local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
39197
39166
  if trinketsSet == nil then
39198
39167
  return __TS__New(ReadonlySet)
@@ -39201,32 +39170,32 @@ function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
39201
39170
  end
39202
39171
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsWithCacheFlag", true)
39203
39172
  function ModdedElementSets.prototype.getVanillaCardArray(self)
39204
- self:lazyInitVanillaCardTypes()
39173
+ self:lazyInit()
39205
39174
  return self.vanillaCardTypesArray
39206
39175
  end
39207
39176
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardArray", true)
39208
39177
  function ModdedElementSets.prototype.getVanillaCardSet(self)
39209
- self:lazyInitVanillaCardTypes()
39178
+ self:lazyInit()
39210
39179
  return self.vanillaCardTypesSet
39211
39180
  end
39212
39181
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardSet", true)
39213
39182
  function ModdedElementSets.prototype.getVanillaCollectibleArray(self)
39214
- self:lazyInitVanillaCollectibleTypes()
39183
+ self:lazyInit()
39215
39184
  return self.vanillaCollectibleTypesArray
39216
39185
  end
39217
39186
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleArray", true)
39218
39187
  function ModdedElementSets.prototype.getVanillaCollectibleSet(self)
39219
- self:lazyInitVanillaCollectibleTypes()
39188
+ self:lazyInit()
39220
39189
  return self.vanillaCollectibleTypesSet
39221
39190
  end
39222
39191
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleSet", true)
39223
39192
  function ModdedElementSets.prototype.getVanillaTrinketArray(self)
39224
- self:lazyInitVanillaTrinketTypes()
39193
+ self:lazyInit()
39225
39194
  return self.vanillaTrinketTypesArray
39226
39195
  end
39227
39196
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketArray", true)
39228
39197
  function ModdedElementSets.prototype.getVanillaTrinketSet(self)
39229
- self:lazyInitVanillaTrinketTypes()
39198
+ self:lazyInit()
39230
39199
  return self.vanillaTrinketTypesSet
39231
39200
  end
39232
39201
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketSet", true)
@@ -31,6 +31,9 @@ export declare class ModdedElementDetection extends Feature {
31
31
  * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
32
32
  * 666. We subtract one to account for `CollectibleType.NULL`.)
33
33
  *
34
+ * If there are no mods present that add any custom items, this function will return
35
+ * `CollectibleType.MOMS_RING` (732).
36
+ *
34
37
  * This function can only be called if at least one callback has been executed. This is because
35
38
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
36
39
  * order).
@@ -40,7 +43,7 @@ export declare class ModdedElementDetection extends Feature {
40
43
  */
41
44
  getLastCollectibleType(): CollectibleType;
42
45
  /**
43
- * Helper function to get an array that represents the all modded collectible types.
46
+ * Helper function to get an array that represents every modded collectible type.
44
47
  *
45
48
  * Returns an empty array if there are no modded collectible types.
46
49
  *
@@ -61,6 +64,10 @@ export declare class ModdedElementDetection extends Feature {
61
64
  */
62
65
  getModdedCollectibleTypes(): CollectibleType[];
63
66
  /**
67
+ * Returns the total number of collectibles in the item config, including both vanilla and modded
68
+ * items. If you just need the number of vanilla collectible types, use the
69
+ * `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
70
+ *
64
71
  * This function can only be called if at least one callback has been executed. This is because
65
72
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
66
73
  * order).
@@ -93,8 +100,11 @@ export declare class ModdedElementDetection extends Feature {
93
100
  /**
94
101
  * Will change depending on how many modded trinkets there are.
95
102
  *
96
- * This is equal to the number of trinket types, since all trinket types are contiguous (unlike
97
- * collectibles).
103
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
104
+ * subtract one to account for `TrinketType.NULL`.)
105
+ *
106
+ * If there are no mods present that add any custom trinkets, this function will return
107
+ * `TrinketType.SIGIL_OF_BAPHOMET` (189).
98
108
  *
99
109
  * This function can only be called if at least one callback has been executed. This is because
100
110
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -108,9 +118,11 @@ export declare class ModdedElementDetection extends Feature {
108
118
  *
109
119
  * Returns an empty array if there are no modded trinket types.
110
120
  *
111
- * This function is only useful when building collectible type objects. For most purposes, you
112
- * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
113
- * instead.
121
+ * This function is only useful when building trinket type objects. For most purposes, you should
122
+ * use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
123
+ *
124
+ * (This function is named differently from the `getVanillaTrinketTypeRange` function because all
125
+ * modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
114
126
  *
115
127
  * This function can only be called if at least one callback has been executed. This is because
116
128
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -120,10 +132,9 @@ export declare class ModdedElementDetection extends Feature {
120
132
  */
121
133
  getModdedTrinketTypes(): TrinketType[];
122
134
  /**
123
- * Will change depending on how many modded trinkets there are.
124
- *
125
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
126
- * `TrinketType.NULL`.)
135
+ * Returns the total number of trinkets in the item config, including both vanilla and modded
136
+ * items. If you just need the number of vanilla trinket types, use the
137
+ * `NUM_VANILLA_TRINKET_TYPES` constant.
127
138
  *
128
139
  * This function can only be called if at least one callback has been executed. This is because
129
140
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -133,15 +144,7 @@ export declare class ModdedElementDetection extends Feature {
133
144
  */
134
145
  getNumTrinketTypes(): int;
135
146
  /**
136
- * This function can only be called if at least one callback has been executed. This is because
137
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
138
- *
139
- * In order to use this function, you must upgrade your mod with
140
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
141
- */
142
- getNumModdedTrinketTypes(): int;
143
- /**
144
- * Helper function to get an array that contains every trinket type.
147
+ * Unlike vanilla trinket types, modded trinket types are always contiguous.
145
148
  *
146
149
  * This function can only be called if at least one callback has been executed. This is because
147
150
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -149,7 +152,7 @@ export declare class ModdedElementDetection extends Feature {
149
152
  * In order to use this function, you must upgrade your mod with
150
153
  * `ISCFeature.MODDED_ELEMENT_DETECTION`.
151
154
  */
152
- getTrinketTypes(): TrinketType[];
155
+ getNumModdedTrinketTypes(): int;
153
156
  /**
154
157
  * Helper function to get an array with every valid card sub-type. This includes modded cards.
155
158
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ModdedElementDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAyBtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,uBAAuB,CAAS;IAaxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;IAEF,O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