isaacscript-common 51.9.2 → 51.10.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.
@@ -13287,6 +13287,7 @@ declare class ModdedElementSets extends Feature {
13287
13287
  private readonly tagToCollectibleTypesMap;
13288
13288
  private readonly edenActiveCollectibleTypesSet;
13289
13289
  private readonly edenPassiveCollectibleTypesSet;
13290
+ private readonly qualityToCollectibleTypesMap;
13290
13291
  private readonly itemConfigCardTypeToCardTypeMap;
13291
13292
  /**
13292
13293
  * The set of card types that are not:
@@ -13307,6 +13308,7 @@ declare class ModdedElementSets extends Feature {
13307
13308
  private lazyInitFlyingCollectibleTypesSet;
13308
13309
  private lazyInitFlyingTrinketTypesSet;
13309
13310
  private lazyInitEdenCollectibleTypesSet;
13311
+ private lazyInitQualityToCollectibleTypesMap;
13310
13312
  private lazyInitCardTypes;
13311
13313
  /**
13312
13314
  * Returns an array containing every valid collectible type in the game, including modded
@@ -13640,7 +13642,7 @@ declare class ModdedElementSets extends Feature {
13640
13642
  */
13641
13643
  getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
13642
13644
  /**
13643
- * Returns the number of items that a player has towards a particular transformation.
13645
+ * Returns an array of collectible types that a player has with a particular tag.
13644
13646
  *
13645
13647
  * This function can only be called if at least one callback has been executed. This is because
13646
13648
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -13667,7 +13669,8 @@ declare class ModdedElementSets extends Feature {
13667
13669
  */
13668
13670
  getCollectibleTypesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
13669
13671
  /**
13670
- * Returns the number of items that a player has towards a particular transformation.
13672
+ * Returns an array of collectible types that a player has that count towards a particular
13673
+ * transformation.
13671
13674
  *
13672
13675
  * This function can only be called if at least one callback has been executed. This is because
13673
13676
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -13731,6 +13734,26 @@ declare class ModdedElementSets extends Feature {
13731
13734
  * @param exceptions Optional. An array of runes to not select.
13732
13735
  */
13733
13736
  getRandomEdenPassiveCollectibleType(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
13737
+ /**
13738
+ * Returns a set containing every collectible type with the given quality.
13739
+ *
13740
+ * This function can only be called if at least one callback has been executed. This is because
13741
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
13742
+ * order).
13743
+ *
13744
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
13745
+ */
13746
+ getCollectibleTypesOfQuality(quality: Quality): ReadonlySet<CollectibleType>;
13747
+ /**
13748
+ * Returns an array of collectible types that a player has that are of a particular quality.
13749
+ *
13750
+ * This function can only be called if at least one callback has been executed. This is because
13751
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
13752
+ * order).
13753
+ *
13754
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
13755
+ */
13756
+ getPlayerCollectiblesOfQuality(player: EntityPlayer, quality: Quality): CollectibleType[];
13734
13757
  /**
13735
13758
  * Helper function to get a set of card types matching the `ItemConfigCardType`.
13736
13759
  *
@@ -15081,6 +15104,12 @@ export declare function PriorityCallbackCustom<T extends ModCallbackCustom>(modC
15081
15104
  /** Helper type to extract only the public interface of a class. */
15082
15105
  export declare type PublicInterface<T> = Pick<T, keyof T>;
15083
15106
 
15107
+ /**
15108
+ * An array representing every valid collectible type quality. Specifically, this is `[0, 1, 2, 3,
15109
+ * 4]`.
15110
+ */
15111
+ export declare const QUALITIES: readonly Quality[];
15112
+
15084
15113
  declare interface QueueElement {
15085
15114
  playerIndex: PlayerIndex;
15086
15115
  renderOffset: Vector;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 51.9.2
3
+ isaacscript-common 51.10.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -18089,6 +18089,13 @@ ____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
18089
18089
  ____exports.DIMENSIONS = eRange(nil, ____exports.NUM_DIMENSIONS)
18090
18090
  ____exports.NUM_PILL_COLORS_IN_POOL = NUM_NORMAL_PILL_COLORS
18091
18091
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
18092
+ ____exports.QUALITIES = {
18093
+ 0,
18094
+ 1,
18095
+ 2,
18096
+ 3,
18097
+ 4
18098
+ }
18092
18099
  ____exports.SECOND_IN_MILLISECONDS = 1000
18093
18100
  ____exports.MINUTE_IN_MILLISECONDS = 60 * ____exports.SECOND_IN_MILLISECONDS
18094
18101
  ____exports.RESOLUTION_FULL_SCREEN = Vector(480, 270)
@@ -38876,6 +38883,7 @@ local ____cachedClasses = require("src.core.cachedClasses")
38876
38883
  local itemConfig = ____cachedClasses.itemConfig
38877
38884
  local ____constants = require("src.core.constants")
38878
38885
  local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
38886
+ local QUALITIES = ____constants.QUALITIES
38879
38887
  local ____constantsVanilla = require("src.core.constantsVanilla")
38880
38888
  local VANILLA_CARD_TYPES = ____constantsVanilla.VANILLA_CARD_TYPES
38881
38889
  local VANILLA_COLLECTIBLE_TYPES = ____constantsVanilla.VANILLA_COLLECTIBLE_TYPES
@@ -38891,6 +38899,7 @@ local ____collectibleTag = require("src.functions.collectibleTag")
38891
38899
  local collectibleHasTag = ____collectibleTag.collectibleHasTag
38892
38900
  local ____collectibles = require("src.functions.collectibles")
38893
38901
  local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
38902
+ local getCollectibleQuality = ____collectibles.getCollectibleQuality
38894
38903
  local isActiveCollectible = ____collectibles.isActiveCollectible
38895
38904
  local isHiddenCollectible = ____collectibles.isHiddenCollectible
38896
38905
  local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarCollectible
@@ -38968,6 +38977,7 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
38968
38977
  self.tagToCollectibleTypesMap = __TS__New(Map)
38969
38978
  self.edenActiveCollectibleTypesSet = __TS__New(Set)
38970
38979
  self.edenPassiveCollectibleTypesSet = __TS__New(Set)
38980
+ self.qualityToCollectibleTypesMap = __TS__New(Map)
38971
38981
  self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
38972
38982
  self.cardSet = __TS__New(Set)
38973
38983
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
@@ -38988,6 +38998,7 @@ function ModdedElementSets.prototype.lazyInit(self)
38988
38998
  self:lazyInitFlyingCollectibleTypesSet()
38989
38999
  self:lazyInitFlyingTrinketTypesSet()
38990
39000
  self:lazyInitEdenCollectibleTypesSet()
39001
+ self:lazyInitQualityToCollectibleTypesMap()
38991
39002
  self:lazyInitCardTypes()
38992
39003
  end
38993
39004
  function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
@@ -39116,24 +39127,24 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
39116
39127
  end
39117
39128
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
39118
39129
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
39119
- local collectiblesSet = __TS__New(Set)
39130
+ local collectibleTypeSet = __TS__New(Set)
39120
39131
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
39121
39132
  if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
39122
- collectiblesSet:add(collectibleType)
39133
+ collectibleTypeSet:add(collectibleType)
39123
39134
  end
39124
39135
  end
39125
- self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectiblesSet)
39136
+ self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectibleTypeSet)
39126
39137
  end
39127
39138
  end
39128
39139
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
39129
39140
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
39130
- local trinketsSet = __TS__New(Set)
39141
+ local trinketTypesSet = __TS__New(Set)
39131
39142
  for ____, trinketType in ipairs(self:getTrinketTypes()) do
39132
39143
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
39133
- trinketsSet:add(trinketType)
39144
+ trinketTypesSet:add(trinketType)
39134
39145
  end
39135
39146
  end
39136
- self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketsSet)
39147
+ self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketTypesSet)
39137
39148
  end
39138
39149
  end
39139
39150
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
@@ -39179,6 +39190,18 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
39179
39190
  ::__continue61::
39180
39191
  end
39181
39192
  end
39193
+ function ModdedElementSets.prototype.lazyInitQualityToCollectibleTypesMap(self)
39194
+ for ____, quality in ipairs(QUALITIES) do
39195
+ local collectibleTypesSet = __TS__New(Set)
39196
+ for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
39197
+ local collectibleTypeQuality = getCollectibleQuality(nil, collectibleType)
39198
+ if collectibleTypeQuality == quality then
39199
+ collectibleTypesSet:add(collectibleType)
39200
+ end
39201
+ end
39202
+ self.qualityToCollectibleTypesMap:set(quality, collectibleTypesSet)
39203
+ end
39204
+ end
39182
39205
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
39183
39206
  for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
39184
39207
  self.itemConfigCardTypeToCardTypeMap:set(
@@ -39451,6 +39474,33 @@ function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, s
39451
39474
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39452
39475
  end
39453
39476
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectibleType", true)
39477
+ function ModdedElementSets.prototype.getCollectibleTypesOfQuality(self, quality)
39478
+ self:lazyInit()
39479
+ local collectibleTypes = self.qualityToCollectibleTypesMap:get(quality)
39480
+ assertDefined(
39481
+ nil,
39482
+ collectibleTypes,
39483
+ ("The quality of " .. tostring(quality)) .. " is not a valid quality."
39484
+ )
39485
+ return collectibleTypes
39486
+ end
39487
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesOfQuality", true)
39488
+ function ModdedElementSets.prototype.getPlayerCollectiblesOfQuality(self, player, quality)
39489
+ local collectibleTypesOfQuality = self:getCollectibleTypesOfQuality(quality)
39490
+ local playerCollectibles = {}
39491
+ for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesOfQuality)) do
39492
+ local numCollectibles = player:GetCollectibleNum(collectibleType, true)
39493
+ ____repeat(
39494
+ nil,
39495
+ numCollectibles,
39496
+ function()
39497
+ playerCollectibles[#playerCollectibles + 1] = collectibleType
39498
+ end
39499
+ )
39500
+ end
39501
+ return playerCollectibles
39502
+ end
39503
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesOfQuality", true)
39454
39504
  function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
39455
39505
  local itemConfigCardTypes = {...}
39456
39506
  self:lazyInit()
@@ -35,6 +35,7 @@ export declare class ModdedElementSets extends Feature {
35
35
  private readonly tagToCollectibleTypesMap;
36
36
  private readonly edenActiveCollectibleTypesSet;
37
37
  private readonly edenPassiveCollectibleTypesSet;
38
+ private readonly qualityToCollectibleTypesMap;
38
39
  private readonly itemConfigCardTypeToCardTypeMap;
39
40
  /**
40
41
  * The set of card types that are not:
@@ -55,6 +56,7 @@ export declare class ModdedElementSets extends Feature {
55
56
  private lazyInitFlyingCollectibleTypesSet;
56
57
  private lazyInitFlyingTrinketTypesSet;
57
58
  private lazyInitEdenCollectibleTypesSet;
59
+ private lazyInitQualityToCollectibleTypesMap;
58
60
  private lazyInitCardTypes;
59
61
  /**
60
62
  * Returns an array containing every valid collectible type in the game, including modded
@@ -388,7 +390,7 @@ export declare class ModdedElementSets extends Feature {
388
390
  */
389
391
  getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
390
392
  /**
391
- * Returns the number of items that a player has towards a particular transformation.
393
+ * Returns an array of collectible types that a player has with a particular tag.
392
394
  *
393
395
  * This function can only be called if at least one callback has been executed. This is because
394
396
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -415,7 +417,8 @@ export declare class ModdedElementSets extends Feature {
415
417
  */
416
418
  getCollectibleTypesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
417
419
  /**
418
- * Returns the number of items that a player has towards a particular transformation.
420
+ * Returns an array of collectible types that a player has that count towards a particular
421
+ * transformation.
419
422
  *
420
423
  * This function can only be called if at least one callback has been executed. This is because
421
424
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -479,6 +482,26 @@ export declare class ModdedElementSets extends Feature {
479
482
  * @param exceptions Optional. An array of runes to not select.
480
483
  */
481
484
  getRandomEdenPassiveCollectibleType(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
485
+ /**
486
+ * Returns a set containing every collectible type with the given quality.
487
+ *
488
+ * This function can only be called if at least one callback has been executed. This is because
489
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
490
+ * order).
491
+ *
492
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
493
+ */
494
+ getCollectibleTypesOfQuality(quality: Quality): ReadonlySet<CollectibleType>;
495
+ /**
496
+ * Returns an array of collectible types that a player has that are of a particular quality.
497
+ *
498
+ * This function can only be called if at least one callback has been executed. This is because
499
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
500
+ * order).
501
+ *
502
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
503
+ */
504
+ getPlayerCollectiblesOfQuality(player: EntityPlayer, quality: Quality): CollectibleType[];
482
505
  /**
483
506
  * Helper function to get a set of card types matching the `ItemConfigC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vC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe;IAalB;;;;;;;;OAQG;IAEI,4BAA4B,CACjC,OAAO,EAAE,OAAO,GACf,WAAW,CAAC,eAAe,CAAC;IAY/B;;;;;;;;OAQG;IAEI,8BAA8B,CACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACf,eAAe,EAAE;IAsBpB;;;;;;;;;;OAUG;IAEI,kBAAkB,CACvB,GAAG,mBAAmB,EAAE,kBAAkB,EAAE,GAC3C,GAAG,CAAC,QAAQ,CAAC;IAoBhB;;;;;;;;;;;;;OAaG;IAEI,uBAAuB,CAC5B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,QAAQ,EAAO,GAC1B,QAAQ;IAKX;;;;;;;;;;;;;;;OAeG;IAEI,aAAa,CAClB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,QAAQ,EAAO,GAC1B,QAAQ;IAKX;;;;;;;;;;;;OAYG;IAEI,aAAa,CAClB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,QAAQ,EAAO,GAC1B,QAAQ;CAKZ"}
@@ -23,6 +23,7 @@ local ____cachedClasses = require("src.core.cachedClasses")
23
23
  local itemConfig = ____cachedClasses.itemConfig
24
24
  local ____constants = require("src.core.constants")
25
25
  local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
26
+ local QUALITIES = ____constants.QUALITIES
26
27
  local ____constantsVanilla = require("src.core.constantsVanilla")
27
28
  local VANILLA_CARD_TYPES = ____constantsVanilla.VANILLA_CARD_TYPES
28
29
  local VANILLA_COLLECTIBLE_TYPES = ____constantsVanilla.VANILLA_COLLECTIBLE_TYPES
@@ -38,6 +39,7 @@ local ____collectibleTag = require("src.functions.collectibleTag")
38
39
  local collectibleHasTag = ____collectibleTag.collectibleHasTag
39
40
  local ____collectibles = require("src.functions.collectibles")
40
41
  local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
42
+ local getCollectibleQuality = ____collectibles.getCollectibleQuality
41
43
  local isActiveCollectible = ____collectibles.isActiveCollectible
42
44
  local isHiddenCollectible = ____collectibles.isHiddenCollectible
43
45
  local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarCollectible
@@ -121,6 +123,7 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
121
123
  self.tagToCollectibleTypesMap = __TS__New(Map)
122
124
  self.edenActiveCollectibleTypesSet = __TS__New(Set)
123
125
  self.edenPassiveCollectibleTypesSet = __TS__New(Set)
126
+ self.qualityToCollectibleTypesMap = __TS__New(Map)
124
127
  self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
125
128
  self.cardSet = __TS__New(Set)
126
129
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
@@ -141,6 +144,7 @@ function ModdedElementSets.prototype.lazyInit(self)
141
144
  self:lazyInitFlyingCollectibleTypesSet()
142
145
  self:lazyInitFlyingTrinketTypesSet()
143
146
  self:lazyInitEdenCollectibleTypesSet()
147
+ self:lazyInitQualityToCollectibleTypesMap()
144
148
  self:lazyInitCardTypes()
145
149
  end
146
150
  function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
@@ -269,24 +273,24 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
269
273
  end
270
274
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
271
275
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
272
- local collectiblesSet = __TS__New(Set)
276
+ local collectibleTypeSet = __TS__New(Set)
273
277
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
274
278
  if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
275
- collectiblesSet:add(collectibleType)
279
+ collectibleTypeSet:add(collectibleType)
276
280
  end
277
281
  end
278
- self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectiblesSet)
282
+ self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectibleTypeSet)
279
283
  end
280
284
  end
281
285
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
282
286
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
283
- local trinketsSet = __TS__New(Set)
287
+ local trinketTypesSet = __TS__New(Set)
284
288
  for ____, trinketType in ipairs(self:getTrinketTypes()) do
285
289
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
286
- trinketsSet:add(trinketType)
290
+ trinketTypesSet:add(trinketType)
287
291
  end
288
292
  end
289
- self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketsSet)
293
+ self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketTypesSet)
290
294
  end
291
295
  end
292
296
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
@@ -332,6 +336,18 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
332
336
  ::__continue61::
333
337
  end
334
338
  end
339
+ function ModdedElementSets.prototype.lazyInitQualityToCollectibleTypesMap(self)
340
+ for ____, quality in ipairs(QUALITIES) do
341
+ local collectibleTypesSet = __TS__New(Set)
342
+ for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
343
+ local collectibleTypeQuality = getCollectibleQuality(nil, collectibleType)
344
+ if collectibleTypeQuality == quality then
345
+ collectibleTypesSet:add(collectibleType)
346
+ end
347
+ end
348
+ self.qualityToCollectibleTypesMap:set(quality, collectibleTypesSet)
349
+ end
350
+ end
335
351
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
336
352
  for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
337
353
  self.itemConfigCardTypeToCardTypeMap:set(
@@ -604,6 +620,33 @@ function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, s
604
620
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
605
621
  end
606
622
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectibleType", true)
623
+ function ModdedElementSets.prototype.getCollectibleTypesOfQuality(self, quality)
624
+ self:lazyInit()
625
+ local collectibleTypes = self.qualityToCollectibleTypesMap:get(quality)
626
+ assertDefined(
627
+ nil,
628
+ collectibleTypes,
629
+ ("The quality of " .. tostring(quality)) .. " is not a valid quality."
630
+ )
631
+ return collectibleTypes
632
+ end
633
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesOfQuality", true)
634
+ function ModdedElementSets.prototype.getPlayerCollectiblesOfQuality(self, player, quality)
635
+ local collectibleTypesOfQuality = self:getCollectibleTypesOfQuality(quality)
636
+ local playerCollectibles = {}
637
+ for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesOfQuality)) do
638
+ local numCollectibles = player:GetCollectibleNum(collectibleType, true)
639
+ ____repeat(
640
+ nil,
641
+ numCollectibles,
642
+ function()
643
+ playerCollectibles[#playerCollectibles + 1] = collectibleType
644
+ end
645
+ )
646
+ end
647
+ return playerCollectibles
648
+ end
649
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesOfQuality", true)
607
650
  function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
608
651
  local itemConfigCardTypes = {...}
609
652
  self:lazyInit()
@@ -151,6 +151,11 @@ export declare const DIMENSIONS: readonly Dimension[];
151
151
  */
152
152
  export declare const NUM_PILL_COLORS_IN_POOL: number;
153
153
  export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
154
+ /**
155
+ * An array representing every valid collectible type quality. Specifically, this is `[0, 1, 2, 3,
156
+ * 4]`.
157
+ */
158
+ export declare const QUALITIES: readonly Quality[];
154
159
  export declare const SECOND_IN_MILLISECONDS = 1000;
155
160
  export declare const MINUTE_IN_MILLISECONDS: number;
156
161
  /** This is equivalent to the bottom-right screen position when the game is in full screen mode. */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ILL_COLORS_IN_POOL = NUM_NORMAL_PILL_COLORS
203
203
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
204
+ --- An array representing every valid collectible type quality. Specifically, this is `[0, 1, 2, 3,
205
+ -- 4]`.
206
+ ____exports.QUALITIES = {
207
+ 0,
208
+ 1,
209
+ 2,
210
+ 3,
211
+ 4
212
+ }
204
213
  ____exports.SECOND_IN_MILLISECONDS = 1000
205
214
  ____exports.MINUTE_IN_MILLISECONDS = 60 * ____exports.SECOND_IN_MILLISECONDS
206
215
  --- This is equivalent to the bottom-right screen position when the game is in full screen mode.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "51.9.2",
3
+ "version": "51.10.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,6 +25,6 @@
25
25
  "main": "dist/src/index",
26
26
  "types": "dist/index.rollup.d.ts",
27
27
  "dependencies": {
28
- "isaac-typescript-definitions": "^21.0.3"
28
+ "isaac-typescript-definitions": "^21.1.0"
29
29
  }
30
30
  }
@@ -14,7 +14,10 @@ import {
14
14
  ITEM_CONFIG_TAG_VALUES,
15
15
  } from "../../../arrays/cachedEnumValues";
16
16
  import { itemConfig } from "../../../core/cachedClasses";
17
- import { FIRST_GLITCHED_COLLECTIBLE_TYPE } from "../../../core/constants";
17
+ import {
18
+ FIRST_GLITCHED_COLLECTIBLE_TYPE,
19
+ QUALITIES,
20
+ } from "../../../core/constants";
18
21
  import {
19
22
  VANILLA_CARD_TYPES,
20
23
  VANILLA_COLLECTIBLE_TYPES,
@@ -27,6 +30,7 @@ import { getItemConfigCardType } from "../../../functions/cards";
27
30
  import { collectibleHasTag } from "../../../functions/collectibleTag";
28
31
  import {
29
32
  collectibleHasCacheFlag,
33
+ getCollectibleQuality,
30
34
  isActiveCollectible,
31
35
  isHiddenCollectible,
32
36
  isPassiveOrFamiliarCollectible,
@@ -88,6 +92,10 @@ const TRANSFORMATION_TO_TAG_MAP = new ReadonlyMap<PlayerForm, ItemConfigTag>([
88
92
  export class ModdedElementSets extends Feature {
89
93
  private arraysInitialized = false;
90
94
 
95
+ // ----------------
96
+ // Main collections
97
+ // ----------------
98
+
91
99
  private readonly allCollectibleTypesArray: CollectibleType[] = [];
92
100
  private readonly allCollectibleTypesSet = new Set<CollectibleType>();
93
101
 
@@ -112,6 +120,10 @@ export class ModdedElementSets extends Feature {
112
120
  private readonly moddedPillEffectsArray: PillEffect[] = [];
113
121
  private readonly moddedPillEffectsSet = new Set<PillEffect>();
114
122
 
123
+ // -----------------
124
+ // Other collections
125
+ // -----------------
126
+
115
127
  private readonly cacheFlagToCollectibleTypesMap = new Map<
116
128
  CacheFlag,
117
129
  Set<CollectibleType>
@@ -136,6 +148,11 @@ export class ModdedElementSets extends Feature {
136
148
  private readonly edenActiveCollectibleTypesSet = new Set<CollectibleType>();
137
149
  private readonly edenPassiveCollectibleTypesSet = new Set<CollectibleType>();
138
150
 
151
+ private readonly qualityToCollectibleTypesMap = new Map<
152
+ Quality,
153
+ Set<CollectibleType>
154
+ >();
155
+
139
156
  private readonly itemConfigCardTypeToCardTypeMap = new Map<
140
157
  ItemConfigCardType,
141
158
  Set<CardType>
@@ -176,6 +193,7 @@ export class ModdedElementSets extends Feature {
176
193
  this.lazyInitFlyingCollectibleTypesSet();
177
194
  this.lazyInitFlyingTrinketTypesSet();
178
195
  this.lazyInitEdenCollectibleTypesSet();
196
+ this.lazyInitQualityToCollectibleTypesMap();
179
197
  this.lazyInitCardTypes();
180
198
  }
181
199
 
@@ -327,29 +345,29 @@ export class ModdedElementSets extends Feature {
327
345
 
328
346
  private lazyInitCacheFlagToCollectibleTypesMap() {
329
347
  for (const cacheFlag of CACHE_FLAG_VALUES) {
330
- const collectiblesSet = new Set<CollectibleType>();
348
+ const collectibleTypeSet = new Set<CollectibleType>();
331
349
 
332
350
  for (const collectibleType of this.getCollectibleTypes()) {
333
351
  if (collectibleHasCacheFlag(collectibleType, cacheFlag)) {
334
- collectiblesSet.add(collectibleType);
352
+ collectibleTypeSet.add(collectibleType);
335
353
  }
336
354
  }
337
355
 
338
- this.cacheFlagToCollectibleTypesMap.set(cacheFlag, collectiblesSet);
356
+ this.cacheFlagToCollectibleTypesMap.set(cacheFlag, collectibleTypeSet);
339
357
  }
340
358
  }
341
359
 
342
360
  private lazyInitCacheFlagToTrinketTypesMap() {
343
361
  for (const cacheFlag of CACHE_FLAG_VALUES) {
344
- const trinketsSet = new Set<TrinketType>();
362
+ const trinketTypesSet = new Set<TrinketType>();
345
363
 
346
364
  for (const trinketType of this.getTrinketTypes()) {
347
365
  if (trinketHasCacheFlag(trinketType, cacheFlag)) {
348
- trinketsSet.add(trinketType);
366
+ trinketTypesSet.add(trinketType);
349
367
  }
350
368
  }
351
369
 
352
- this.cacheFlagToTrinketTypesMap.set(cacheFlag, trinketsSet);
370
+ this.cacheFlagToTrinketTypesMap.set(cacheFlag, trinketTypesSet);
353
371
  }
354
372
  }
355
373
 
@@ -419,6 +437,21 @@ export class ModdedElementSets extends Feature {
419
437
  }
420
438
  }
421
439
 
440
+ private lazyInitQualityToCollectibleTypesMap() {
441
+ for (const quality of QUALITIES) {
442
+ const collectibleTypesSet = new Set<CollectibleType>();
443
+
444
+ for (const collectibleType of this.getCollectibleTypes()) {
445
+ const collectibleTypeQuality = getCollectibleQuality(collectibleType);
446
+ if (collectibleTypeQuality === quality) {
447
+ collectibleTypesSet.add(collectibleType);
448
+ }
449
+ }
450
+
451
+ this.qualityToCollectibleTypesMap.set(quality, collectibleTypesSet);
452
+ }
453
+ }
454
+
422
455
  private lazyInitCardTypes() {
423
456
  // The card type to cards map should be valid for every card type, so we initialize it with
424
457
  // empty sets.
@@ -1016,7 +1049,7 @@ export class ModdedElementSets extends Feature {
1016
1049
  }
1017
1050
 
1018
1051
  /**
1019
- * Returns the number of items that a player has towards a particular transformation.
1052
+ * Returns an array of collectible types that a player has with a particular tag.
1020
1053
  *
1021
1054
  * This function can only be called if at least one callback has been executed. This is because
1022
1055
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -1074,7 +1107,8 @@ export class ModdedElementSets extends Feature {
1074
1107
  }
1075
1108
 
1076
1109
  /**
1077
- * Returns the number of items that a player has towards a particular transformation.
1110
+ * Returns an array of collectible types that a player has that count towards a particular
1111
+ * transformation.
1078
1112
  *
1079
1113
  * This function can only be called if at least one callback has been executed. This is because
1080
1114
  * not all collectible types will necessarily be present when a mod first loads (due to mod load
@@ -1193,6 +1227,65 @@ export class ModdedElementSets extends Feature {
1193
1227
  );
1194
1228
  }
1195
1229
 
1230
+ // -------------------
1231
+ // Collectible Quality
1232
+ // -------------------
1233
+
1234
+ /**
1235
+ * Returns a set containing every collectible type with the given quality.
1236
+ *
1237
+ * This function can only be called if at least one callback has been executed. This is because
1238
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
1239
+ * order).
1240
+ *
1241
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
1242
+ */
1243
+ @Exported
1244
+ public getCollectibleTypesOfQuality(
1245
+ quality: Quality,
1246
+ ): ReadonlySet<CollectibleType> {
1247
+ this.lazyInit();
1248
+
1249
+ const collectibleTypes = this.qualityToCollectibleTypesMap.get(quality);
1250
+ assertDefined(
1251
+ collectibleTypes,
1252
+ `The quality of ${quality} is not a valid quality.`,
1253
+ );
1254
+
1255
+ return collectibleTypes;
1256
+ }
1257
+
1258
+ /**
1259
+ * Returns an array of collectible types that a player has that are of a particular quality.
1260
+ *
1261
+ * This function can only be called if at least one callback has been executed. This is because
1262
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
1263
+ * order).
1264
+ *
1265
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
1266
+ */
1267
+ @Exported
1268
+ public getPlayerCollectiblesOfQuality(
1269
+ player: EntityPlayer,
1270
+ quality: Quality,
1271
+ ): CollectibleType[] {
1272
+ const collectibleTypesOfQuality =
1273
+ this.getCollectibleTypesOfQuality(quality);
1274
+
1275
+ const playerCollectibles: CollectibleType[] = [];
1276
+ for (const collectibleType of getSortedSetValues(
1277
+ collectibleTypesOfQuality,
1278
+ )) {
1279
+ // We specify "true" as the second argument to filter out things like Lilith's Incubus.
1280
+ const numCollectibles = player.GetCollectibleNum(collectibleType, true);
1281
+ repeat(numCollectibles, () => {
1282
+ playerCollectibles.push(collectibleType);
1283
+ });
1284
+ }
1285
+
1286
+ return playerCollectibles;
1287
+ }
1288
+
1196
1289
  // ----------------------
1197
1290
  // Item Config Card Types
1198
1291
  // ----------------------
@@ -291,6 +291,13 @@ export const NUM_PILL_COLORS_IN_POOL = NUM_NORMAL_PILL_COLORS;
291
291
 
292
292
  export const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
293
293
 
294
+ /**
295
+ * An array representing every valid collectible type quality. Specifically, this is `[0, 1, 2, 3,
296
+ * 4]`.
297
+ */
298
+ // eslint-disable-next-line isaacscript/require-capital-const-assertions
299
+ export const QUALITIES: readonly Quality[] = [0, 1, 2, 3, 4];
300
+
294
301
  export const SECOND_IN_MILLISECONDS = 1000;
295
302
  export const MINUTE_IN_MILLISECONDS = 60 * SECOND_IN_MILLISECONDS;
296
303
 
@@ -16,7 +16,7 @@ export function arrayToBitFlags<T extends BitFlag | BitFlag128>(
16
16
  /** Helper function to convert an array of bits to the resulting decimal number. */
17
17
  export function convertBinaryToDecimal(bits: int[]): number {
18
18
  const bitsString = bits.join("");
19
- return parseInt(bitsString, 2);
19
+ return Number.parseInt(bitsString, 2);
20
20
  }
21
21
 
22
22
  /**