isaacscript-common 40.0.0 → 41.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 +364 -334
  2. package/dist/isaacscript-common.lua +379 -378
  3. package/dist/src/classes/features/other/FlyingDetection.lua +2 -2
  4. package/dist/src/classes/features/other/ItemPoolDetection.lua +2 -2
  5. package/dist/src/classes/features/other/ModdedElementDetection.d.ts +0 -86
  6. package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
  7. package/dist/src/classes/features/other/ModdedElementDetection.lua +1 -57
  8. package/dist/src/classes/features/other/ModdedElementSets.d.ts +250 -210
  9. package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
  10. package/dist/src/classes/features/other/ModdedElementSets.lua +285 -284
  11. package/dist/src/core/constants.d.ts +17 -2
  12. package/dist/src/core/constants.d.ts.map +1 -1
  13. package/dist/src/core/constants.lua +8 -1
  14. package/dist/src/core/constantsFirstLast.d.ts +5 -0
  15. package/dist/src/core/constantsFirstLast.d.ts.map +1 -1
  16. package/dist/src/core/constantsVanilla.d.ts +93 -0
  17. package/dist/src/core/constantsVanilla.d.ts.map +1 -0
  18. package/dist/src/core/constantsVanilla.lua +115 -0
  19. package/dist/src/core/upgradeMod.lua +3 -0
  20. package/dist/src/functions/cards.d.ts +0 -7
  21. package/dist/src/functions/cards.d.ts.map +1 -1
  22. package/dist/src/functions/cards.lua +0 -10
  23. package/dist/src/functions/collectibles.d.ts +0 -10
  24. package/dist/src/functions/collectibles.d.ts.map +1 -1
  25. package/dist/src/functions/collectibles.lua +0 -13
  26. package/dist/src/functions/dimensions.d.ts +0 -4
  27. package/dist/src/functions/dimensions.d.ts.map +1 -1
  28. package/dist/src/functions/dimensions.lua +2 -8
  29. package/dist/src/functions/pills.d.ts +0 -2
  30. package/dist/src/functions/pills.d.ts.map +1 -1
  31. package/dist/src/functions/pills.lua +0 -5
  32. package/dist/src/functions/rooms.lua +2 -2
  33. package/dist/src/functions/trinkets.d.ts +0 -9
  34. package/dist/src/functions/trinkets.d.ts.map +1 -1
  35. package/dist/src/functions/trinkets.lua +0 -12
  36. package/dist/src/index.d.ts +1 -0
  37. package/dist/src/index.d.ts.map +1 -1
  38. package/dist/src/index.lua +8 -0
  39. package/package.json +1 -1
  40. package/src/classes/features/other/FlyingDetection.ts +2 -2
  41. package/src/classes/features/other/ItemPoolDetection.ts +2 -2
  42. package/src/classes/features/other/ModdedElementDetection.ts +4 -156
  43. package/src/classes/features/other/ModdedElementSets.ts +552 -486
  44. package/src/core/constants.ts +15 -2
  45. package/src/core/constantsFirstLast.ts +5 -1
  46. package/src/core/constantsVanilla.ts +183 -0
  47. package/src/core/upgradeMod.ts +6 -1
  48. package/src/functions/cards.ts +1 -15
  49. package/src/functions/collectibles.ts +1 -18
  50. package/src/functions/dimensions.ts +2 -10
  51. package/src/functions/pills.ts +0 -6
  52. package/src/functions/rooms.ts +3 -3
  53. package/src/functions/trinkets.ts +1 -17
  54. package/src/index.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 40.0.0
3
+ isaacscript-common 41.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -17950,6 +17950,8 @@ local newReadonlyKColor = ____readOnly.newReadonlyKColor
17950
17950
  local newReadonlyVector = ____readOnly.newReadonlyVector
17951
17951
  local ____types = require("src.functions.types")
17952
17952
  local asCollectibleType = ____types.asCollectibleType
17953
+ local ____utils = require("src.functions.utils")
17954
+ local eRange = ____utils.eRange
17953
17955
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
17954
17956
  local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
17955
17957
  ____exports.ALL_DISPLAY_FLAGS = addFlag(nil, DisplayFlag.VISIBLE, DisplayFlag.SHADOW, DisplayFlag.SHOW_ICON)
@@ -18041,7 +18043,8 @@ ____exports.NEW_FLOOR_STARTING_POSITION_GREED_MODE = newReadonlyVector(nil, 320,
18041
18043
  ____exports.NEW_RUN_PLAYER_STARTING_POSITION = newReadonlyVector(nil, 320, 380)
18042
18044
  ____exports.MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000
18043
18045
  ____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
18044
- ____exports.NUM_PILLS_IN_POOL = NUM_NORMAL_PILL_COLORS
18046
+ ____exports.DIMENSIONS = eRange(nil, ____exports.NUM_DIMENSIONS)
18047
+ ____exports.NUM_PILL_COLORS_IN_POOL = NUM_NORMAL_PILL_COLORS
18045
18048
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
18046
18049
  ____exports.SECOND_IN_MILLISECONDS = 1000
18047
18050
  ____exports.MINUTE_IN_MILLISECONDS = 60 * ____exports.SECOND_IN_MILLISECONDS
@@ -21563,7 +21566,6 @@ local ____constants = require("src.core.constants")
21563
21566
  local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
21564
21567
  local DEFAULT_ITEM_POOL_TYPE = ____constants.DEFAULT_ITEM_POOL_TYPE
21565
21568
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
21566
- local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
21567
21569
  local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
21568
21570
  local ____collectibleDescriptionMap = require("src.maps.collectibleDescriptionMap")
21569
21571
  local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
@@ -21584,8 +21586,6 @@ local clearSprite = ____sprites.clearSprite
21584
21586
  local spriteEquals = ____sprites.spriteEquals
21585
21587
  local ____types = require("src.functions.types")
21586
21588
  local isInteger = ____types.isInteger
21587
- local ____utils = require("src.functions.utils")
21588
- local iRange = ____utils.iRange
21589
21589
  function initQuestionMarkSprite(self)
21590
21590
  local sprite = Sprite()
21591
21591
  sprite:Load("gfx/005.100_collectible.anm2", false)
@@ -21801,9 +21801,6 @@ function ____exports.getCollectibleTags(self, collectibleOrCollectibleType)
21801
21801
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
21802
21802
  return itemConfigItem == nil and ItemConfigTagZero or itemConfigItem.Tags
21803
21803
  end
21804
- function ____exports.getVanillaCollectibleTypeRange(self)
21805
- return iRange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
21806
- end
21807
21804
  function ____exports.isActiveCollectible(self, collectibleType)
21808
21805
  local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
21809
21806
  return itemType == ItemType.ACTIVE
@@ -27011,20 +27008,15 @@ local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
27011
27008
  local ____cachedClasses = require("src.core.cachedClasses")
27012
27009
  local game = ____cachedClasses.game
27013
27010
  local ____constants = require("src.core.constants")
27014
- local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
27011
+ local DIMENSIONS = ____constants.DIMENSIONS
27015
27012
  local ____roomData = require("src.functions.roomData")
27016
27013
  local getRoomGridIndex = ____roomData.getRoomGridIndex
27017
- local ____utils = require("src.functions.utils")
27018
- local eRange = ____utils.eRange
27019
- function ____exports.getAllDimensions(self)
27020
- return eRange(nil, NUM_DIMENSIONS)
27021
- end
27022
27014
  function ____exports.getDimension(self)
27023
27015
  local level = game:GetLevel()
27024
27016
  local roomGridIndex = getRoomGridIndex(nil)
27025
27017
  local roomDescription = level:GetRoomByIdx(roomGridIndex, Dimension.CURRENT)
27026
27018
  local currentRoomHash = GetPtrHash(roomDescription)
27027
- for ____, dimension in ipairs(____exports.getAllDimensions(nil)) do
27019
+ for ____, dimension in ipairs(DIMENSIONS) do
27028
27020
  local dimensionRoomDescription = level:GetRoomByIdx(roomGridIndex, dimension)
27029
27021
  local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
27030
27022
  if dimensionRoomHash == currentRoomHash then
@@ -27752,6 +27744,7 @@ local ____cachedClasses = require("src.core.cachedClasses")
27752
27744
  local game = ____cachedClasses.game
27753
27745
  local sfxManager = ____cachedClasses.sfxManager
27754
27746
  local ____constants = require("src.core.constants")
27747
+ local DIMENSIONS = ____constants.DIMENSIONS
27755
27748
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
27756
27749
  local ____roomTypeNames = require("src.objects.roomTypeNames")
27757
27750
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
@@ -27760,7 +27753,6 @@ local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROO
27760
27753
  local ____ReadonlySet = require("src.types.ReadonlySet")
27761
27754
  local ReadonlySet = ____ReadonlySet.ReadonlySet
27762
27755
  local ____dimensions = require("src.functions.dimensions")
27763
- local getAllDimensions = ____dimensions.getAllDimensions
27764
27756
  local inDimension = ____dimensions.inDimension
27765
27757
  local ____doors = require("src.functions.doors")
27766
27758
  local closeAllDoors = ____doors.closeAllDoors
@@ -27813,7 +27805,7 @@ function ____exports.getRoomsInsideGrid(self, includeExtraDimensionalRooms)
27813
27805
  includeExtraDimensionalRooms = false
27814
27806
  end
27815
27807
  local level = game:GetLevel()
27816
- local dimensions = includeExtraDimensionalRooms and getAllDimensions(nil) or ({Dimension.CURRENT})
27808
+ local dimensions = includeExtraDimensionalRooms and DIMENSIONS or ({Dimension.CURRENT})
27817
27809
  local roomDescriptorMap = __TS__New(Map)
27818
27810
  for ____, dimension in ipairs(dimensions) do
27819
27811
  for ____, roomGridIndex in ipairs(iRange(nil, MAX_LEVEL_GRID_INDEX)) do
@@ -29602,7 +29594,6 @@ local itemConfig = ____cachedClasses.itemConfig
29602
29594
  local ____constants = require("src.core.constants")
29603
29595
  local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
29604
29596
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
29605
- local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
29606
29597
  local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
29607
29598
  local ____MysteriousPaperEffect = require("src.enums.MysteriousPaperEffect")
29608
29599
  local MysteriousPaperEffect = ____MysteriousPaperEffect.MysteriousPaperEffect
@@ -29626,8 +29617,6 @@ local ____sprites = require("src.functions.sprites")
29626
29617
  local clearSprite = ____sprites.clearSprite
29627
29618
  local ____types = require("src.functions.types")
29628
29619
  local asNumber = ____types.asNumber
29629
- local ____utils = require("src.functions.utils")
29630
- local iRange = ____utils.iRange
29631
29620
  function ____exports.isVanillaTrinketType(self, trinketType)
29632
29621
  return trinketType <= LAST_VANILLA_TRINKET_TYPE
29633
29622
  end
@@ -29691,9 +29680,6 @@ function ____exports.getTrinketName(self, trinketType)
29691
29680
  end
29692
29681
  return DEFAULT_TRINKET_NAME
29693
29682
  end
29694
- function ____exports.getVanillaTrinketTypeRange(self)
29695
- return iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
29696
- end
29697
29683
  function ____exports.hasAnyTrinket(self, player)
29698
29684
  local playerTrinketTypes = __TS__ArrayMap(
29699
29685
  TRINKET_SLOT_VALUES,
@@ -33179,7 +33165,6 @@ local itemConfig = ____cachedClasses.itemConfig
33179
33165
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
33180
33166
  local FIRST_HORSE_PILL_COLOR = ____constantsFirstLast.FIRST_HORSE_PILL_COLOR
33181
33167
  local FIRST_PILL_COLOR = ____constantsFirstLast.FIRST_PILL_COLOR
33182
- local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
33183
33168
  local LAST_HORSE_PILL_COLOR = ____constantsFirstLast.LAST_HORSE_PILL_COLOR
33184
33169
  local LAST_NORMAL_PILL_COLOR = ____constantsFirstLast.LAST_NORMAL_PILL_COLOR
33185
33170
  local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
@@ -33262,9 +33247,6 @@ function ____exports.getPillEffectType(self, pillEffect)
33262
33247
  local pillEffectClass = PILL_EFFECT_TYPES[pillEffect]
33263
33248
  return pillEffectClass or DEFAULT_PILL_EFFECT_TYPE
33264
33249
  end
33265
- function ____exports.getVanillaPillEffects(self)
33266
- return iRange(nil, FIRST_PILL_EFFECT, LAST_VANILLA_PILL_EFFECT)
33267
- end
33268
33250
  function ____exports.isGoldPill(self, pillColor)
33269
33251
  return pillColor == PillColor.GOLD or pillColor == PillColor.HORSE_GOLD
33270
33252
  end
@@ -38099,6 +38081,73 @@ function PickupChangeDetection.prototype.____constructor(self, postPickupChanged
38099
38081
  self.postPickupChanged = postPickupChanged
38100
38082
  self.pickupIndexCreation = pickupIndexCreation
38101
38083
  end
38084
+ return ____exports
38085
+ end,
38086
+ ["src.core.constantsVanilla"] = function(...)
38087
+ local ____lualib = require("lualib_bundle")
38088
+ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
38089
+ local __TS__New = ____lualib.__TS__New
38090
+ local ____exports = {}
38091
+ local ____types = require("src.functions.types")
38092
+ local asCardType = ____types.asCardType
38093
+ local asCollectibleType = ____types.asCollectibleType
38094
+ local asPillEffect = ____types.asPillEffect
38095
+ local asTrinketType = ____types.asTrinketType
38096
+ local ____utils = require("src.functions.utils")
38097
+ local iRange = ____utils.iRange
38098
+ local ____ReadonlySet = require("src.types.ReadonlySet")
38099
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
38100
+ local ____cachedClasses = require("src.core.cachedClasses")
38101
+ local itemConfig = ____cachedClasses.itemConfig
38102
+ local ____constantsFirstLast = require("src.core.constantsFirstLast")
38103
+ local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
38104
+ local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
38105
+ local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
38106
+ local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
38107
+ local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
38108
+ local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
38109
+ local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
38110
+ local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
38111
+ ____exports.VANILLA_COLLECTIBLE_TYPE_RANGE = iRange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
38112
+ ____exports.VANILLA_COLLECTIBLE_TYPES = __TS__ArrayFilter(
38113
+ ____exports.VANILLA_COLLECTIBLE_TYPE_RANGE,
38114
+ function(____, potentialCollectibleType)
38115
+ local collectibleType = asCollectibleType(nil, potentialCollectibleType)
38116
+ local itemConfigItem = itemConfig:GetCollectible(collectibleType)
38117
+ return itemConfigItem ~= nil
38118
+ end
38119
+ )
38120
+ ____exports.VANILLA_COLLECTIBLE_TYPES_SET = __TS__New(ReadonlySet, ____exports.VANILLA_COLLECTIBLE_TYPES)
38121
+ ____exports.VANILLA_TRINKET_TYPE_RANGE = iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
38122
+ ____exports.VANILLA_TRINKET_TYPES = __TS__ArrayFilter(
38123
+ ____exports.VANILLA_TRINKET_TYPE_RANGE,
38124
+ function(____, potentialTrinketType)
38125
+ local trinketType = asTrinketType(nil, potentialTrinketType)
38126
+ local itemConfigTrinket = itemConfig:GetTrinket(trinketType)
38127
+ return itemConfigTrinket ~= nil
38128
+ end
38129
+ )
38130
+ ____exports.VANILLA_TRINKET_TYPES_SET = __TS__New(ReadonlySet, ____exports.VANILLA_TRINKET_TYPES)
38131
+ ____exports.VANILLA_CARD_TYPE_RANGE = iRange(nil, FIRST_CARD_TYPE, LAST_VANILLA_CARD_TYPE)
38132
+ ____exports.VANILLA_CARD_TYPES = __TS__ArrayFilter(
38133
+ ____exports.VANILLA_CARD_TYPE_RANGE,
38134
+ function(____, potentialCardType)
38135
+ local cardType = asCardType(nil, potentialCardType)
38136
+ local itemConfigCard = itemConfig:GetCard(cardType)
38137
+ return itemConfigCard ~= nil
38138
+ end
38139
+ )
38140
+ ____exports.VANILLA_CARD_TYPES_SET = __TS__New(ReadonlySet, ____exports.VANILLA_CARD_TYPES)
38141
+ ____exports.VANILLA_PILL_EFFECT_RANGE = iRange(nil, FIRST_PILL_EFFECT, LAST_VANILLA_PILL_EFFECT)
38142
+ ____exports.VANILLA_PILL_EFFECTS = __TS__ArrayFilter(
38143
+ ____exports.VANILLA_PILL_EFFECT_RANGE,
38144
+ function(____, potentialPillEffect)
38145
+ local pillEffect = asPillEffect(nil, potentialPillEffect)
38146
+ local itemConfigPillEffect = itemConfig:GetPillEffect(pillEffect)
38147
+ return itemConfigPillEffect ~= nil
38148
+ end
38149
+ )
38150
+ ____exports.VANILLA_PILL_EFFECTS_SET = __TS__New(ReadonlySet, ____exports.VANILLA_PILL_EFFECTS)
38102
38151
  return ____exports
38103
38152
  end,
38104
38153
  ["src.objects.cardDescriptions"] = function(...)
@@ -38334,7 +38383,6 @@ local UseFlag = ____isaac_2Dtypescript_2Ddefinitions.UseFlag
38334
38383
  local ____cachedClasses = require("src.core.cachedClasses")
38335
38384
  local itemConfig = ____cachedClasses.itemConfig
38336
38385
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
38337
- local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
38338
38386
  local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
38339
38387
  local ____cardDescriptions = require("src.objects.cardDescriptions")
38340
38388
  local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
@@ -38346,8 +38394,6 @@ local ____itemConfigCardTypesForCardsSet = require("src.sets.itemConfigCardTypes
38346
38394
  local ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = ____itemConfigCardTypesForCardsSet.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET
38347
38395
  local ____flag = require("src.functions.flag")
38348
38396
  local addFlag = ____flag.addFlag
38349
- local ____utils = require("src.functions.utils")
38350
- local iRange = ____utils.iRange
38351
38397
  function ____exports.isVanillaCardType(self, cardType)
38352
38398
  return cardType <= LAST_VANILLA_CARD_TYPE
38353
38399
  end
@@ -38380,9 +38426,6 @@ function ____exports.getItemConfigCardType(self, cardType)
38380
38426
  end
38381
38427
  return itemConfigCard.CardType
38382
38428
  end
38383
- function ____exports.getVanillaCardTypes(self)
38384
- return iRange(nil, FIRST_CARD_TYPE, LAST_VANILLA_CARD_TYPE)
38385
- end
38386
38429
  function ____exports.isCard(self, cardType)
38387
38430
  local itemConfigCardType = ____exports.getItemConfigCardType(nil, cardType)
38388
38431
  if itemConfigCardType == nil then
@@ -38453,8 +38496,6 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
38453
38496
  local ____cachedClasses = require("src.core.cachedClasses")
38454
38497
  local itemConfig = ____cachedClasses.itemConfig
38455
38498
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
38456
- local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
38457
- local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
38458
38499
  local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
38459
38500
  local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
38460
38501
  local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
@@ -38471,8 +38512,6 @@ local asCollectibleType = ____types.asCollectibleType
38471
38512
  local asNumber = ____types.asNumber
38472
38513
  local asPillEffect = ____types.asPillEffect
38473
38514
  local asTrinketType = ____types.asTrinketType
38474
- local ____utils = require("src.functions.utils")
38475
- local iRange = ____utils.iRange
38476
38515
  local ____Feature = require("src.classes.private.Feature")
38477
38516
  local Feature = ____Feature.Feature
38478
38517
  ____exports.ModdedElementDetection = __TS__Class()
@@ -38482,7 +38521,7 @@ __TS__ClassExtends(ModdedElementDetection, Feature)
38482
38521
  function ModdedElementDetection.prototype.____constructor(self)
38483
38522
  Feature.prototype.____constructor(self)
38484
38523
  self.atLeastOneCallbackFired = false
38485
- self.postPlayerInit = function(____, _player)
38524
+ self.postPlayerInit = function()
38486
38525
  self.atLeastOneCallbackFired = true
38487
38526
  end
38488
38527
  self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
@@ -38513,16 +38552,6 @@ function ModdedElementDetection.prototype.getLastCollectibleType(self)
38513
38552
  return itemConfig:GetCollectibles().Size - 1
38514
38553
  end
38515
38554
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCollectibleType", true)
38516
- function ModdedElementDetection.prototype.getModdedCollectibleTypes(self)
38517
- self:errorIfNoCallbacksFired("collectible")
38518
- local firstModdedCollectibleType = self:getFirstModdedCollectibleType()
38519
- if firstModdedCollectibleType == nil then
38520
- return {}
38521
- end
38522
- local lastCollectibleType = self:getLastCollectibleType()
38523
- return iRange(nil, firstModdedCollectibleType, lastCollectibleType)
38524
- end
38525
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedCollectibleTypes", true)
38526
38555
  function ModdedElementDetection.prototype.getNumCollectibleTypes(self)
38527
38556
  self:errorIfNoCallbacksFired("collectible")
38528
38557
  local numModdedCollectibleTypes = self:getNumModdedCollectibleTypes()
@@ -38556,16 +38585,6 @@ function ModdedElementDetection.prototype.getLastTrinketType(self)
38556
38585
  return itemConfig:GetTrinkets().Size - 1
38557
38586
  end
38558
38587
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
38559
- function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
38560
- self:errorIfNoCallbacksFired("trinket")
38561
- local firstModdedTrinketType = self:getFirstModdedTrinketType()
38562
- if firstModdedTrinketType == nil then
38563
- return {}
38564
- end
38565
- local lastTrinketType = self:getLastTrinketType()
38566
- return iRange(nil, firstModdedTrinketType, lastTrinketType)
38567
- end
38568
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
38569
38588
  function ModdedElementDetection.prototype.getNumTrinketTypes(self)
38570
38589
  self:errorIfNoCallbacksFired("trinket")
38571
38590
  local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
@@ -38578,12 +38597,6 @@ function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
38578
38597
  return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
38579
38598
  end
38580
38599
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
38581
- function ModdedElementDetection.prototype.getAllCardTypes(self)
38582
- self:errorIfNoCallbacksFired("card")
38583
- local lastCardType = self:getLastCardType()
38584
- return iRange(nil, FIRST_CARD_TYPE, lastCardType)
38585
- end
38586
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getAllCardTypes", true)
38587
38600
  function ModdedElementDetection.prototype.getFirstModdedCardType(self)
38588
38601
  self:errorIfNoCallbacksFired("card")
38589
38602
  local firstModdedCardType = asCardType(
@@ -38606,16 +38619,6 @@ function ModdedElementDetection.prototype.getLastCardType(self)
38606
38619
  return asCardType(nil, numCards)
38607
38620
  end
38608
38621
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCardType", true)
38609
- function ModdedElementDetection.prototype.getModdedCardTypes(self)
38610
- self:errorIfNoCallbacksFired("card")
38611
- local firstModdedCardType = self:getFirstModdedCardType()
38612
- if firstModdedCardType == nil then
38613
- return {}
38614
- end
38615
- local lastCardType = self:getLastCardType()
38616
- return iRange(nil, firstModdedCardType, lastCardType)
38617
- end
38618
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedCardTypes", true)
38619
38622
  function ModdedElementDetection.prototype.getNumCardTypes(self)
38620
38623
  self:errorIfNoCallbacksFired("card")
38621
38624
  return itemConfig:GetCards().Size - 1
@@ -38627,12 +38630,6 @@ function ModdedElementDetection.prototype.getNumModdedCardTypes(self)
38627
38630
  return numCardTypes - NUM_VANILLA_CARD_TYPES
38628
38631
  end
38629
38632
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedCardTypes", true)
38630
- function ModdedElementDetection.prototype.getAllPillEffects(self)
38631
- self:errorIfNoCallbacksFired("pill")
38632
- local lastPillEffect = self:getLastPillEffect()
38633
- return iRange(nil, FIRST_PILL_EFFECT, lastPillEffect)
38634
- end
38635
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getAllPillEffects", true)
38636
38633
  function ModdedElementDetection.prototype.getFirstModdedPillEffect(self)
38637
38634
  self:errorIfNoCallbacksFired("pill")
38638
38635
  local firstModdedPillEffect = asPillEffect(
@@ -38655,16 +38652,6 @@ function ModdedElementDetection.prototype.getLastPillEffect(self)
38655
38652
  return asPillEffect(nil, numPillEffects)
38656
38653
  end
38657
38654
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastPillEffect", true)
38658
- function ModdedElementDetection.prototype.getModdedPillEffects(self)
38659
- self:errorIfNoCallbacksFired("pill")
38660
- local firstModdedPillEffect = self:getFirstModdedPillEffect()
38661
- if firstModdedPillEffect == nil then
38662
- return {}
38663
- end
38664
- local lastPillEffect = self:getLastPillEffect()
38665
- return iRange(nil, firstModdedPillEffect, lastPillEffect)
38666
- end
38667
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedPillEffects", true)
38668
38655
  function ModdedElementDetection.prototype.getNumPillEffects(self)
38669
38656
  self:errorIfNoCallbacksFired("pill")
38670
38657
  return itemConfig:GetPillEffects().Size
@@ -38704,18 +38691,21 @@ local ____cachedClasses = require("src.core.cachedClasses")
38704
38691
  local itemConfig = ____cachedClasses.itemConfig
38705
38692
  local ____constants = require("src.core.constants")
38706
38693
  local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
38694
+ local ____constantsVanilla = require("src.core.constantsVanilla")
38695
+ local VANILLA_CARD_TYPES = ____constantsVanilla.VANILLA_CARD_TYPES
38696
+ local VANILLA_COLLECTIBLE_TYPES = ____constantsVanilla.VANILLA_COLLECTIBLE_TYPES
38697
+ local VANILLA_PILL_EFFECTS = ____constantsVanilla.VANILLA_PILL_EFFECTS
38698
+ local VANILLA_TRINKET_TYPES = ____constantsVanilla.VANILLA_TRINKET_TYPES
38707
38699
  local ____decorators = require("src.decorators")
38708
38700
  local Exported = ____decorators.Exported
38709
38701
  local ____ISCFeature = require("src.enums.ISCFeature")
38710
38702
  local ISCFeature = ____ISCFeature.ISCFeature
38711
38703
  local ____cards = require("src.functions.cards")
38712
38704
  local getItemConfigCardType = ____cards.getItemConfigCardType
38713
- local getVanillaCardTypes = ____cards.getVanillaCardTypes
38714
38705
  local ____collectibleTag = require("src.functions.collectibleTag")
38715
38706
  local collectibleHasTag = ____collectibleTag.collectibleHasTag
38716
38707
  local ____collectibles = require("src.functions.collectibles")
38717
38708
  local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
38718
- local getVanillaCollectibleTypeRange = ____collectibles.getVanillaCollectibleTypeRange
38719
38709
  local isActiveCollectible = ____collectibles.isActiveCollectible
38720
38710
  local isHiddenCollectible = ____collectibles.isHiddenCollectible
38721
38711
  local isPassiveCollectible = ____collectibles.isPassiveCollectible
@@ -38729,10 +38719,15 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
38729
38719
  local getRandomSetElement = ____set.getRandomSetElement
38730
38720
  local getSortedSetValues = ____set.getSortedSetValues
38731
38721
  local ____trinkets = require("src.functions.trinkets")
38732
- local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
38733
38722
  local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
38723
+ local ____types = require("src.functions.types")
38724
+ local asCardType = ____types.asCardType
38725
+ local asCollectibleType = ____types.asCollectibleType
38726
+ local asPillEffect = ____types.asPillEffect
38727
+ local asTrinketType = ____types.asTrinketType
38734
38728
  local ____utils = require("src.functions.utils")
38735
38729
  local assertDefined = ____utils.assertDefined
38730
+ local iRange = ____utils.iRange
38736
38731
  local ____repeat = ____utils["repeat"]
38737
38732
  local ____itemConfigCardTypesForCardsSet = require("src.sets.itemConfigCardTypesForCardsSet")
38738
38733
  local ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = ____itemConfigCardTypesForCardsSet.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET
@@ -38766,28 +38761,26 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
38766
38761
  self.arraysInitialized = false
38767
38762
  self.allCollectibleTypesArray = {}
38768
38763
  self.allCollectibleTypesSet = __TS__New(Set)
38769
- self.vanillaCollectibleTypesArray = {}
38770
- self.vanillaCollectibleTypesSet = __TS__New(Set)
38771
38764
  self.moddedCollectibleTypesArray = {}
38772
38765
  self.moddedCollectibleTypesSet = __TS__New(Set)
38773
38766
  self.allTrinketTypesArray = {}
38774
38767
  self.allTrinketTypesSet = __TS__New(Set)
38775
- self.vanillaTrinketTypesArray = {}
38776
- self.vanillaTrinketTypesSet = __TS__New(Set)
38777
38768
  self.moddedTrinketTypesArray = {}
38778
38769
  self.moddedTrinketTypesSet = __TS__New(Set)
38779
38770
  self.allCardTypesArray = {}
38780
38771
  self.allCardTypesSet = __TS__New(Set)
38781
- self.vanillaCardTypesArray = {}
38782
- self.vanillaCardTypesSet = __TS__New(Set)
38783
38772
  self.moddedCardTypesArray = {}
38784
38773
  self.moddedCardTypesSet = __TS__New(Set)
38785
- self.tagToCollectibleTypesMap = __TS__New(Map)
38774
+ self.allPillEffectsArray = {}
38775
+ self.allPillEffectsSet = __TS__New(Set)
38776
+ self.moddedPillEffectsArray = {}
38777
+ self.moddedPillEffectsSet = __TS__New(Set)
38786
38778
  self.cacheFlagToCollectibleTypesMap = __TS__New(Map)
38787
38779
  self.cacheFlagToTrinketTypesMap = __TS__New(Map)
38788
38780
  self.flyingCollectibleTypesSet = __TS__New(Set)
38789
38781
  self.permanentFlyingCollectibleTypesSet = __TS__New(Set)
38790
38782
  self.flyingTrinketTypesSet = __TS__New(Set)
38783
+ self.tagToCollectibleTypesMap = __TS__New(Map)
38791
38784
  self.edenActiveCollectibleTypesSet = __TS__New(Set)
38792
38785
  self.edenPassiveCollectibleTypesSet = __TS__New(Set)
38793
38786
  self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
@@ -38800,12 +38793,10 @@ function ModdedElementSets.prototype.lazyInit(self)
38800
38793
  return
38801
38794
  end
38802
38795
  self.arraysInitialized = true
38803
- self:lazyInitVanillaCollectibleTypes()
38804
38796
  self:lazyInitModdedCollectibleTypes()
38805
- self:lazyInitVanillaTrinketTypes()
38806
38797
  self:lazyInitModdedTrinketTypes()
38807
- self:lazyInitVanillaCardTypes()
38808
38798
  self:lazyInitModdedCardTypes()
38799
+ self:lazyInitModdedPillEffects()
38809
38800
  self:lazyInitTagToCollectibleTypesMap()
38810
38801
  self:lazyInitCacheFlagToCollectibleTypesMap()
38811
38802
  self:lazyInitCacheFlagToTrinketTypesMap()
@@ -38814,102 +38805,103 @@ function ModdedElementSets.prototype.lazyInit(self)
38814
38805
  self:lazyInitEdenCollectibleTypesSet()
38815
38806
  self:lazyInitCardTypes()
38816
38807
  end
38817
- function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
38818
- if #self.vanillaCollectibleTypesArray > 0 then
38819
- return
38820
- end
38821
- local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
38822
- for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
38823
- local itemConfigItem = itemConfig:GetCollectible(collectibleType)
38824
- if itemConfigItem ~= nil then
38825
- local ____self_vanillaCollectibleTypesArray_0 = self.vanillaCollectibleTypesArray
38826
- ____self_vanillaCollectibleTypesArray_0[#____self_vanillaCollectibleTypesArray_0 + 1] = collectibleType
38827
- self.vanillaCollectibleTypesSet:add(collectibleType)
38828
- end
38829
- end
38830
- end
38831
38808
  function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
38832
- for ____, collectibleType in ipairs(self.vanillaCollectibleTypesArray) do
38833
- local ____self_allCollectibleTypesArray_1 = self.allCollectibleTypesArray
38834
- ____self_allCollectibleTypesArray_1[#____self_allCollectibleTypesArray_1 + 1] = collectibleType
38809
+ for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES) do
38810
+ local ____self_allCollectibleTypesArray_0 = self.allCollectibleTypesArray
38811
+ ____self_allCollectibleTypesArray_0[#____self_allCollectibleTypesArray_0 + 1] = collectibleType
38835
38812
  self.allCollectibleTypesSet:add(collectibleType)
38836
38813
  end
38837
- local moddedCollectibleTypes = self.moddedElementDetection:getModdedCollectibleTypes()
38838
- for ____, collectibleType in ipairs(moddedCollectibleTypes) do
38814
+ local firstModdedCollectibleType = self.moddedElementDetection:getFirstModdedCollectibleType()
38815
+ if firstModdedCollectibleType == nil then
38816
+ return
38817
+ end
38818
+ local lastCollectibleType = self.moddedElementDetection:getLastCollectibleType()
38819
+ local moddedCollectibleTypes = iRange(nil, firstModdedCollectibleType, lastCollectibleType)
38820
+ for ____, collectibleTypeInt in ipairs(moddedCollectibleTypes) do
38821
+ local collectibleType = asCollectibleType(nil, collectibleTypeInt)
38839
38822
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
38840
38823
  if itemConfigItem ~= nil then
38841
- local ____self_moddedCollectibleTypesArray_2 = self.moddedCollectibleTypesArray
38842
- ____self_moddedCollectibleTypesArray_2[#____self_moddedCollectibleTypesArray_2 + 1] = collectibleType
38824
+ local ____self_moddedCollectibleTypesArray_1 = self.moddedCollectibleTypesArray
38825
+ ____self_moddedCollectibleTypesArray_1[#____self_moddedCollectibleTypesArray_1 + 1] = collectibleType
38843
38826
  self.moddedCollectibleTypesSet:add(collectibleType)
38844
- local ____self_allCollectibleTypesArray_3 = self.allCollectibleTypesArray
38845
- ____self_allCollectibleTypesArray_3[#____self_allCollectibleTypesArray_3 + 1] = collectibleType
38827
+ local ____self_allCollectibleTypesArray_2 = self.allCollectibleTypesArray
38828
+ ____self_allCollectibleTypesArray_2[#____self_allCollectibleTypesArray_2 + 1] = collectibleType
38846
38829
  self.allCollectibleTypesSet:add(collectibleType)
38847
38830
  end
38848
38831
  end
38849
38832
  end
38850
- function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
38851
- if #self.vanillaTrinketTypesArray > 0 then
38852
- return
38853
- end
38854
- local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
38855
- for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
38856
- local itemConfigItem = itemConfig:GetTrinket(trinketType)
38857
- if itemConfigItem ~= nil then
38858
- local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
38859
- ____self_vanillaTrinketTypesArray_4[#____self_vanillaTrinketTypesArray_4 + 1] = trinketType
38860
- self.vanillaTrinketTypesSet:add(trinketType)
38861
- end
38862
- end
38863
- end
38864
38833
  function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
38865
- for ____, trinketType in ipairs(self.vanillaTrinketTypesArray) do
38866
- local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
38867
- ____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
38834
+ for ____, trinketType in ipairs(VANILLA_TRINKET_TYPES) do
38835
+ local ____self_allTrinketTypesArray_3 = self.allTrinketTypesArray
38836
+ ____self_allTrinketTypesArray_3[#____self_allTrinketTypesArray_3 + 1] = trinketType
38868
38837
  self.allTrinketTypesSet:add(trinketType)
38869
38838
  end
38870
- local moddedTrinketTypes = self.moddedElementDetection:getModdedTrinketTypes()
38871
- for ____, trinketType in ipairs(moddedTrinketTypes) do
38839
+ local firstModdedTrinketType = self.moddedElementDetection:getFirstModdedTrinketType()
38840
+ if firstModdedTrinketType == nil then
38841
+ return
38842
+ end
38843
+ local lastTrinketType = self.moddedElementDetection:getLastTrinketType()
38844
+ local moddedTrinketTypes = iRange(nil, firstModdedTrinketType, lastTrinketType)
38845
+ for ____, trinketTypeInt in ipairs(moddedTrinketTypes) do
38846
+ local trinketType = asTrinketType(nil, trinketTypeInt)
38872
38847
  local itemConfigItem = itemConfig:GetTrinket(trinketType)
38873
38848
  if itemConfigItem ~= nil then
38874
- local ____self_moddedTrinketTypesArray_6 = self.moddedTrinketTypesArray
38875
- ____self_moddedTrinketTypesArray_6[#____self_moddedTrinketTypesArray_6 + 1] = trinketType
38849
+ local ____self_moddedTrinketTypesArray_4 = self.moddedTrinketTypesArray
38850
+ ____self_moddedTrinketTypesArray_4[#____self_moddedTrinketTypesArray_4 + 1] = trinketType
38876
38851
  self.moddedTrinketTypesSet:add(trinketType)
38877
- local ____self_allTrinketTypesArray_7 = self.allTrinketTypesArray
38878
- ____self_allTrinketTypesArray_7[#____self_allTrinketTypesArray_7 + 1] = trinketType
38852
+ local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
38853
+ ____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
38879
38854
  self.allTrinketTypesSet:add(trinketType)
38880
38855
  end
38881
38856
  end
38882
38857
  end
38883
- function ModdedElementSets.prototype.lazyInitVanillaCardTypes(self)
38884
- if #self.vanillaCardTypesArray > 0 then
38858
+ function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
38859
+ for ____, cardType in ipairs(VANILLA_CARD_TYPES) do
38860
+ local ____self_allCardTypesArray_6 = self.allCardTypesArray
38861
+ ____self_allCardTypesArray_6[#____self_allCardTypesArray_6 + 1] = cardType
38862
+ self.allCardTypesSet:add(cardType)
38863
+ end
38864
+ local firstModdedCardType = self.moddedElementDetection:getFirstModdedCardType()
38865
+ if firstModdedCardType == nil then
38885
38866
  return
38886
38867
  end
38887
- local vanillaCardTypes = getVanillaCardTypes(nil)
38888
- for ____, cardType in ipairs(vanillaCardTypes) do
38868
+ local lastCardType = self.moddedElementDetection:getLastCardType()
38869
+ local moddedCardTypes = iRange(nil, firstModdedCardType, lastCardType)
38870
+ for ____, cardTypeInt in ipairs(moddedCardTypes) do
38871
+ local cardType = asCardType(nil, cardTypeInt)
38889
38872
  local itemConfigCard = itemConfig:GetCard(cardType)
38890
38873
  if itemConfigCard ~= nil then
38891
- local ____self_vanillaCardTypesArray_8 = self.vanillaCardTypesArray
38892
- ____self_vanillaCardTypesArray_8[#____self_vanillaCardTypesArray_8 + 1] = cardType
38893
- self.vanillaCardTypesSet:add(cardType)
38874
+ local ____self_moddedCardTypesArray_7 = self.moddedCardTypesArray
38875
+ ____self_moddedCardTypesArray_7[#____self_moddedCardTypesArray_7 + 1] = cardType
38876
+ self.moddedCardTypesSet:add(cardType)
38877
+ local ____self_allCardTypesArray_8 = self.allCardTypesArray
38878
+ ____self_allCardTypesArray_8[#____self_allCardTypesArray_8 + 1] = cardType
38879
+ self.allCardTypesSet:add(cardType)
38894
38880
  end
38895
38881
  end
38896
38882
  end
38897
- function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
38898
- for ____, cardType in ipairs(self.vanillaCardTypesArray) do
38899
- local ____self_allCardTypesArray_9 = self.allCardTypesArray
38900
- ____self_allCardTypesArray_9[#____self_allCardTypesArray_9 + 1] = cardType
38901
- self.allCardTypesSet:add(cardType)
38883
+ function ModdedElementSets.prototype.lazyInitModdedPillEffects(self)
38884
+ for ____, pillEffect in ipairs(VANILLA_PILL_EFFECTS) do
38885
+ local ____self_allPillEffectsArray_9 = self.allPillEffectsArray
38886
+ ____self_allPillEffectsArray_9[#____self_allPillEffectsArray_9 + 1] = pillEffect
38887
+ self.allPillEffectsSet:add(pillEffect)
38902
38888
  end
38903
- local moddedCardTypes = self.moddedElementDetection:getModdedCardTypes()
38904
- for ____, cardType in ipairs(moddedCardTypes) do
38905
- local itemConfigCard = itemConfig:GetCard(cardType)
38906
- if itemConfigCard ~= nil then
38907
- local ____self_moddedCardTypesArray_10 = self.moddedCardTypesArray
38908
- ____self_moddedCardTypesArray_10[#____self_moddedCardTypesArray_10 + 1] = cardType
38909
- self.moddedCardTypesSet:add(cardType)
38910
- local ____self_allCardTypesArray_11 = self.allCardTypesArray
38911
- ____self_allCardTypesArray_11[#____self_allCardTypesArray_11 + 1] = cardType
38912
- self.allCardTypesSet:add(cardType)
38889
+ local firstModdedPillEffect = self.moddedElementDetection:getFirstModdedPillEffect()
38890
+ if firstModdedPillEffect == nil then
38891
+ return
38892
+ end
38893
+ local lastPillEffect = self.moddedElementDetection:getLastPillEffect()
38894
+ local moddedPillEffects = iRange(nil, firstModdedPillEffect, lastPillEffect)
38895
+ for ____, pillEffectInt in ipairs(moddedPillEffects) do
38896
+ local pillEffect = asPillEffect(nil, pillEffectInt)
38897
+ local itemConfigPillEffect = itemConfig:GetPillEffect(pillEffect)
38898
+ if itemConfigPillEffect ~= nil then
38899
+ local ____self_moddedPillEffectsArray_10 = self.moddedPillEffectsArray
38900
+ ____self_moddedPillEffectsArray_10[#____self_moddedPillEffectsArray_10 + 1] = pillEffect
38901
+ self.moddedPillEffectsSet:add(pillEffect)
38902
+ local ____self_allPillEffectsArray_11 = self.allPillEffectsArray
38903
+ ____self_allPillEffectsArray_11[#____self_allPillEffectsArray_11 + 1] = pillEffect
38904
+ self.allPillEffectsSet:add(pillEffect)
38913
38905
  end
38914
38906
  end
38915
38907
  end
@@ -38920,11 +38912,11 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
38920
38912
  __TS__New(Set)
38921
38913
  )
38922
38914
  end
38923
- for ____, collectibleType in ipairs(self:getCollectibleArray()) do
38915
+ for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
38924
38916
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
38925
38917
  do
38926
38918
  if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
38927
- goto __continue42
38919
+ goto __continue37
38928
38920
  end
38929
38921
  local collectibleTypesSet = self.tagToCollectibleTypesMap:get(itemConfigTag)
38930
38922
  if collectibleTypesSet == nil then
@@ -38933,14 +38925,14 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
38933
38925
  end
38934
38926
  collectibleTypesSet:add(collectibleType)
38935
38927
  end
38936
- ::__continue42::
38928
+ ::__continue37::
38937
38929
  end
38938
38930
  end
38939
38931
  end
38940
38932
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
38941
38933
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
38942
38934
  local collectiblesSet = __TS__New(Set)
38943
- for ____, collectibleType in ipairs(self:getCollectibleArray()) do
38935
+ for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
38944
38936
  if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
38945
38937
  collectiblesSet:add(collectibleType)
38946
38938
  end
@@ -38951,7 +38943,7 @@ end
38951
38943
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
38952
38944
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
38953
38945
  local trinketsSet = __TS__New(Set)
38954
- for ____, trinketType in ipairs(self:getTrinketArray()) do
38946
+ for ____, trinketType in ipairs(self:getTrinketTypes()) do
38955
38947
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
38956
38948
  trinketsSet:add(trinketType)
38957
38949
  end
@@ -38962,9 +38954,9 @@ end
38962
38954
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
38963
38955
  self.flyingCollectibleTypesSet = copySet(
38964
38956
  nil,
38965
- self:getCollectiblesWithCacheFlag(CacheFlag.FLYING)
38957
+ self:getCollectibleTypesWithCacheFlag(CacheFlag.FLYING)
38966
38958
  )
38967
- local collectiblesWithAllCacheFlag = self:getCollectiblesWithCacheFlag(CacheFlag.ALL)
38959
+ local collectiblesWithAllCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.ALL)
38968
38960
  deleteSetsFromSet(nil, self.flyingCollectibleTypesSet, collectiblesWithAllCacheFlag)
38969
38961
  local permanentFlyingCollectibleTypes = copySet(nil, self.flyingCollectibleTypesSet)
38970
38962
  for ____, collectibleType in ipairs(CONDITIONAL_FLYING_COLLECTIBLE_TYPES) do
@@ -38977,20 +38969,20 @@ end
38977
38969
  function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
38978
38970
  self.flyingTrinketTypesSet = copySet(
38979
38971
  nil,
38980
- self:getTrinketsWithCacheFlag(CacheFlag.FLYING)
38972
+ self:getTrinketsTypesWithCacheFlag(CacheFlag.FLYING)
38981
38973
  )
38982
38974
  local trinketsWithAllCacheFlag = copySet(
38983
38975
  nil,
38984
- self:getTrinketsWithCacheFlag(CacheFlag.ALL)
38976
+ self:getTrinketsTypesWithCacheFlag(CacheFlag.ALL)
38985
38977
  )
38986
38978
  trinketsWithAllCacheFlag:delete(TrinketType.AZAZELS_STUMP)
38987
38979
  deleteSetsFromSet(nil, self.flyingTrinketTypesSet, trinketsWithAllCacheFlag)
38988
38980
  end
38989
38981
  function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
38990
- for ____, collectibleType in ipairs(self:getCollectibleArray()) do
38982
+ for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
38991
38983
  do
38992
38984
  if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
38993
- goto __continue66
38985
+ goto __continue61
38994
38986
  end
38995
38987
  if isActiveCollectible(nil, collectibleType) then
38996
38988
  self.edenActiveCollectibleTypesSet:add(collectibleType)
@@ -38999,7 +38991,7 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
38999
38991
  self.edenPassiveCollectibleTypesSet:add(collectibleType)
39000
38992
  end
39001
38993
  end
39002
- ::__continue66::
38994
+ ::__continue61::
39003
38995
  end
39004
38996
  end
39005
38997
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
@@ -39009,7 +39001,7 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
39009
39001
  __TS__New(Set)
39010
39002
  )
39011
39003
  end
39012
- for ____, cardType in ipairs(self:getCardArray()) do
39004
+ for ____, cardType in ipairs(self:getCardTypes()) do
39013
39005
  local itemConfigCardType = getItemConfigCardType(nil, cardType)
39014
39006
  if itemConfigCardType ~= nil then
39015
39007
  local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
@@ -39025,126 +39017,28 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
39025
39017
  end
39026
39018
  end
39027
39019
  end
39028
- function ModdedElementSets.prototype.getCardArray(self)
39029
- self:lazyInit()
39030
- return self.allCardTypesArray
39031
- end
39032
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardArray", true)
39033
- function ModdedElementSets.prototype.getCardSet(self)
39034
- self:lazyInit()
39035
- return self.allCardTypesSet
39036
- end
39037
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardSet", true)
39038
- function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
39039
- local itemConfigCardTypes = {...}
39040
- self:lazyInit()
39041
- local matchingCardTypes = __TS__New(Set)
39042
- for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
39043
- local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
39044
- assertDefined(
39045
- nil,
39046
- cardTypeSet,
39047
- "Failed to get the card type set for item config type: " .. tostring(itemConfigCardType)
39048
- )
39049
- for ____, cardType in __TS__Iterator(cardTypeSet) do
39050
- matchingCardTypes:add(cardType)
39051
- end
39052
- end
39053
- return matchingCardTypes
39054
- end
39055
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
39056
- function ModdedElementSets.prototype.getCollectibleArray(self)
39020
+ function ModdedElementSets.prototype.getCollectibleTypes(self)
39057
39021
  self:lazyInit()
39058
39022
  return self.allCollectibleTypesArray
39059
39023
  end
39060
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleArray", true)
39061
- function ModdedElementSets.prototype.getCollectibleSet(self)
39024
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypes", true)
39025
+ function ModdedElementSets.prototype.getCollectibleTypeSet(self)
39062
39026
  self:lazyInit()
39063
39027
  return self.allCollectibleTypesSet
39064
39028
  end
39065
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleSet", true)
39066
- function ModdedElementSets.prototype.getCollectiblesForTransformation(self, playerForm)
39067
- local itemConfigTag = TRANSFORMATION_TO_TAG_MAP:get(playerForm)
39068
- assertDefined(
39069
- nil,
39070
- itemConfigTag,
39071
- ("Failed to get the collectible types for the transformation of " .. tostring(playerForm)) .. " because that transformation is not based on collectibles."
39072
- )
39073
- return self:getCollectiblesWithTag(itemConfigTag)
39074
- end
39075
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesForTransformation", true)
39076
- function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFlag)
39077
- self:lazyInit()
39078
- local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
39079
- if collectiblesSet == nil then
39080
- return __TS__New(ReadonlySet)
39081
- end
39082
- return collectiblesSet
39083
- end
39084
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithCacheFlag", true)
39085
- function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
39086
- self:lazyInit()
39087
- local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
39088
- assertDefined(
39089
- nil,
39090
- collectibleTypes,
39091
- ("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the \"ItemConfigTag\" enum."
39092
- )
39093
- return collectibleTypes
39094
- end
39095
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithTag", true)
39096
- function ModdedElementSets.prototype.getEdenActiveCollectibles(self)
39097
- self:lazyInit()
39098
- return self.edenActiveCollectibleTypesSet
39099
- end
39100
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibles", true)
39101
- function ModdedElementSets.prototype.getEdenPassiveCollectibles(self)
39102
- self:lazyInit()
39103
- return self.edenPassiveCollectibleTypesSet
39104
- end
39105
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibles", true)
39106
- function ModdedElementSets.prototype.getFlyingCollectibles(self, includeConditionalItems)
39107
- self:lazyInit()
39108
- return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
39109
- end
39110
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibles", true)
39111
- function ModdedElementSets.prototype.getFlyingTrinkets(self)
39112
- self:lazyInit()
39113
- return self.flyingTrinketTypesSet
39114
- end
39115
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinkets", true)
39116
- function ModdedElementSets.prototype.getModdedCardArray(self)
39117
- self:lazyInit()
39118
- return self.moddedCardTypesArray
39119
- end
39120
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardArray", true)
39121
- function ModdedElementSets.prototype.getModdedCardSet(self)
39122
- self:lazyInit()
39123
- return self.moddedCardTypesSet
39124
- end
39125
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardSet", true)
39126
- function ModdedElementSets.prototype.getModdedCollectibleArray(self)
39029
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypeSet", true)
39030
+ function ModdedElementSets.prototype.getModdedCollectibleTypes(self)
39127
39031
  self:lazyInit()
39128
39032
  return self.moddedCollectibleTypesArray
39129
39033
  end
39130
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleArray", true)
39131
- function ModdedElementSets.prototype.getModdedCollectibleSet(self)
39034
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypes", true)
39035
+ function ModdedElementSets.prototype.getModdedCollectibleTypesSet(self)
39132
39036
  self:lazyInit()
39133
39037
  return self.moddedCollectibleTypesSet
39134
39038
  end
39135
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleSet", true)
39136
- function ModdedElementSets.prototype.getModdedTrinketArray(self)
39137
- self:lazyInit()
39138
- return self.moddedTrinketTypesArray
39139
- end
39140
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketArray", true)
39141
- function ModdedElementSets.prototype.getModdedTrinketSet(self)
39142
- self:lazyInit()
39143
- return self.moddedTrinketTypesSet
39144
- end
39145
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketSet", true)
39039
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypesSet", true)
39146
39040
  function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
39147
- local collectibleArray = self:getCollectibleArray()
39041
+ local collectibleArray = self:getCollectibleTypes()
39148
39042
  local collectibleMap = __TS__New(Map)
39149
39043
  for ____, collectibleType in ipairs(collectibleArray) do
39150
39044
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
@@ -39171,8 +39065,86 @@ function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
39171
39065
  return collectibleMap
39172
39066
  end
39173
39067
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectibleMap", true)
39068
+ function ModdedElementSets.prototype.getTrinketTypes(self)
39069
+ self:lazyInit()
39070
+ return self.allTrinketTypesArray
39071
+ end
39072
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypes", true)
39073
+ function ModdedElementSets.prototype.getTrinketTypesSet(self)
39074
+ self:lazyInit()
39075
+ return self.allTrinketTypesSet
39076
+ end
39077
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypesSet", true)
39078
+ function ModdedElementSets.prototype.getModdedTrinketTypes(self)
39079
+ self:lazyInit()
39080
+ return self.moddedTrinketTypesArray
39081
+ end
39082
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypes", true)
39083
+ function ModdedElementSets.prototype.getModdedTrinketTypesSet(self)
39084
+ self:lazyInit()
39085
+ return self.moddedTrinketTypesSet
39086
+ end
39087
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypesSet", true)
39088
+ function ModdedElementSets.prototype.getCardTypes(self)
39089
+ self:lazyInit()
39090
+ return self.allCardTypesArray
39091
+ end
39092
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypes", true)
39093
+ function ModdedElementSets.prototype.getCardTypesSet(self)
39094
+ self:lazyInit()
39095
+ return self.allCardTypesSet
39096
+ end
39097
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesSet", true)
39098
+ function ModdedElementSets.prototype.getModdedCardTypes(self)
39099
+ self:lazyInit()
39100
+ return self.moddedCardTypesArray
39101
+ end
39102
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypes", true)
39103
+ function ModdedElementSets.prototype.getModdedCardTypesSet(self)
39104
+ self:lazyInit()
39105
+ return self.moddedCardTypesSet
39106
+ end
39107
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypesSet", true)
39108
+ function ModdedElementSets.prototype.getPillEffects(self)
39109
+ self:lazyInit()
39110
+ return self.allPillEffectsArray
39111
+ end
39112
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffects", true)
39113
+ function ModdedElementSets.prototype.getPillEffectsSet(self)
39114
+ self:lazyInit()
39115
+ return self.allPillEffectsSet
39116
+ end
39117
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffectsSet", true)
39118
+ function ModdedElementSets.prototype.getModdedPillEffects(self)
39119
+ self:lazyInit()
39120
+ return self.moddedPillEffectsArray
39121
+ end
39122
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffects", true)
39123
+ function ModdedElementSets.prototype.getModdedPillEffectsSet(self)
39124
+ self:lazyInit()
39125
+ return self.moddedPillEffectsSet
39126
+ end
39127
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffectsSet", true)
39128
+ function ModdedElementSets.prototype.getCollectibleTypesWithCacheFlag(self, cacheFlag)
39129
+ self:lazyInit()
39130
+ local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
39131
+ if collectiblesSet == nil then
39132
+ return __TS__New(ReadonlySet)
39133
+ end
39134
+ return collectiblesSet
39135
+ end
39136
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithCacheFlag", true)
39137
+ function ModdedElementSets.prototype.getTrinketsTypesWithCacheFlag(self, cacheFlag)
39138
+ self:lazyInit()
39139
+ local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
39140
+ if trinketsSet == nil then
39141
+ return __TS__New(ReadonlySet)
39142
+ end
39143
+ return trinketsSet
39144
+ end
39145
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsTypesWithCacheFlag", true)
39174
39146
  function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
39175
- local collectiblesWithCacheFlag = self:getCollectiblesWithCacheFlag(cacheFlag)
39147
+ local collectiblesWithCacheFlag = self:getCollectibleTypesWithCacheFlag(cacheFlag)
39176
39148
  local playerCollectibles = {}
39177
39149
  for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesWithCacheFlag)) do
39178
39150
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
@@ -39187,10 +39159,43 @@ function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, pl
39187
39159
  return playerCollectibles
39188
39160
  end
39189
39161
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithCacheFlag", true)
39162
+ function ModdedElementSets.prototype.getPlayerTrinketsWithCacheFlag(self, player, cacheFlag)
39163
+ local trinketTypesWithCacheFlag = self:getTrinketsTypesWithCacheFlag(cacheFlag)
39164
+ local playerTrinkets = __TS__New(Map)
39165
+ for ____, trinketType in __TS__Iterator(trinketTypesWithCacheFlag) do
39166
+ local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
39167
+ if trinketMultiplier > 0 then
39168
+ playerTrinkets:set(trinketType, trinketMultiplier)
39169
+ end
39170
+ end
39171
+ return playerTrinkets
39172
+ end
39173
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerTrinketsWithCacheFlag", true)
39174
+ function ModdedElementSets.prototype.getFlyingCollectibleTypes(self, includeConditionalItems)
39175
+ self:lazyInit()
39176
+ return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
39177
+ end
39178
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibleTypes", true)
39179
+ function ModdedElementSets.prototype.getFlyingTrinketTypes(self)
39180
+ self:lazyInit()
39181
+ return self.flyingTrinketTypesSet
39182
+ end
39183
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinketTypes", true)
39184
+ function ModdedElementSets.prototype.getCollectibleTypesWithTag(self, itemConfigTag)
39185
+ self:lazyInit()
39186
+ local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
39187
+ assertDefined(
39188
+ nil,
39189
+ collectibleTypes,
39190
+ ("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the \"ItemConfigTag\" enum."
39191
+ )
39192
+ return collectibleTypes
39193
+ end
39194
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithTag", true)
39190
39195
  function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player, itemConfigTag)
39191
- local collectiblesWithTag = self:getCollectiblesWithTag(itemConfigTag)
39196
+ local collectibleTypesWithTag = self:getCollectibleTypesWithTag(itemConfigTag)
39192
39197
  local playerCollectibles = {}
39193
- for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesWithTag)) do
39198
+ for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesWithTag)) do
39194
39199
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
39195
39200
  ____repeat(
39196
39201
  nil,
@@ -39203,8 +39208,18 @@ function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player,
39203
39208
  return playerCollectibles
39204
39209
  end
39205
39210
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithTag", true)
39211
+ function ModdedElementSets.prototype.getCollectibleTypesForTransformation(self, playerForm)
39212
+ local itemConfigTag = TRANSFORMATION_TO_TAG_MAP:get(playerForm)
39213
+ assertDefined(
39214
+ nil,
39215
+ itemConfigTag,
39216
+ ("Failed to get the collectible types for the transformation of " .. tostring(playerForm)) .. " because that transformation is not based on collectibles."
39217
+ )
39218
+ return self:getCollectibleTypesWithTag(itemConfigTag)
39219
+ end
39220
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesForTransformation", true)
39206
39221
  function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self, player, playerForm)
39207
- local collectibleForTransformation = self:getCollectiblesForTransformation(playerForm)
39222
+ local collectibleForTransformation = self:getCollectibleTypesForTransformation(playerForm)
39208
39223
  local playerCollectibles = {}
39209
39224
  for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleForTransformation)) do
39210
39225
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
@@ -39219,19 +39234,17 @@ function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self
39219
39234
  return playerCollectibles
39220
39235
  end
39221
39236
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesForTransformation", true)
39222
- function ModdedElementSets.prototype.getPlayerTrinketsWithCacheFlag(self, player, cacheFlag)
39223
- local trinketsWithCacheFlag = self:getTrinketsWithCacheFlag(cacheFlag)
39224
- local playerTrinkets = __TS__New(Map)
39225
- for ____, trinketType in __TS__Iterator(trinketsWithCacheFlag) do
39226
- local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
39227
- if trinketMultiplier > 0 then
39228
- playerTrinkets:set(trinketType, trinketMultiplier)
39229
- end
39230
- end
39231
- return playerTrinkets
39237
+ function ModdedElementSets.prototype.getEdenActiveCollectibleTypes(self)
39238
+ self:lazyInit()
39239
+ return self.edenActiveCollectibleTypesSet
39232
39240
  end
39233
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerTrinketsWithCacheFlag", true)
39234
- function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
39241
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibleTypes", true)
39242
+ function ModdedElementSets.prototype.getEdenPassiveCollectibleTypes(self)
39243
+ self:lazyInit()
39244
+ return self.edenPassiveCollectibleTypesSet
39245
+ end
39246
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibleTypes", true)
39247
+ function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, seedOrRNG, exceptions)
39235
39248
  if seedOrRNG == nil then
39236
39249
  seedOrRNG = getRandomSeed(nil)
39237
39250
  end
@@ -39239,33 +39252,50 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
39239
39252
  exceptions = {}
39240
39253
  end
39241
39254
  self:lazyInit()
39242
- return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
39255
+ return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39243
39256
  end
39244
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
39245
- function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
39257
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectibleType", true)
39258
+ function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, seedOrRNG, exceptions)
39246
39259
  if seedOrRNG == nil then
39247
39260
  seedOrRNG = getRandomSeed(nil)
39248
39261
  end
39249
39262
  if exceptions == nil then
39250
39263
  exceptions = {}
39251
39264
  end
39252
- local cardTypeSet = self:getCardTypesOfType(itemConfigCardType)
39253
- return getRandomSetElement(nil, cardTypeSet, seedOrRNG, exceptions)
39265
+ self:lazyInit()
39266
+ return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39254
39267
  end
39255
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
39256
- function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
39268
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectibleType", true)
39269
+ function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
39270
+ local itemConfigCardTypes = {...}
39271
+ self:lazyInit()
39272
+ local matchingCardTypes = __TS__New(Set)
39273
+ for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
39274
+ local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
39275
+ assertDefined(
39276
+ nil,
39277
+ cardTypeSet,
39278
+ "Failed to get the card type set for item config type: " .. tostring(itemConfigCardType)
39279
+ )
39280
+ for ____, cardType in __TS__Iterator(cardTypeSet) do
39281
+ matchingCardTypes:add(cardType)
39282
+ end
39283
+ end
39284
+ return matchingCardTypes
39285
+ end
39286
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
39287
+ function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
39257
39288
  if seedOrRNG == nil then
39258
39289
  seedOrRNG = getRandomSeed(nil)
39259
39290
  end
39260
39291
  if exceptions == nil then
39261
39292
  exceptions = {}
39262
39293
  end
39263
- local runesSet = self:getCardTypesOfType(ItemConfigCardType.RUNE)
39264
- runesSet:delete(CardType.RUNE_SHARD)
39265
- return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
39294
+ local cardTypeSet = self:getCardTypesOfType(itemConfigCardType)
39295
+ return getRandomSetElement(nil, cardTypeSet, seedOrRNG, exceptions)
39266
39296
  end
39267
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomRune", true)
39268
- function ModdedElementSets.prototype.getRandomEdenActiveCollectible(self, seedOrRNG, exceptions)
39297
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
39298
+ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
39269
39299
  if seedOrRNG == nil then
39270
39300
  seedOrRNG = getRandomSeed(nil)
39271
39301
  end
@@ -39273,69 +39303,21 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectible(self, seedOr
39273
39303
  exceptions = {}
39274
39304
  end
39275
39305
  self:lazyInit()
39276
- return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39306
+ return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
39277
39307
  end
39278
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectible", true)
39279
- function ModdedElementSets.prototype.getRandomEdenPassiveCollectible(self, seedOrRNG, exceptions)
39308
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
39309
+ function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
39280
39310
  if seedOrRNG == nil then
39281
39311
  seedOrRNG = getRandomSeed(nil)
39282
39312
  end
39283
39313
  if exceptions == nil then
39284
39314
  exceptions = {}
39285
39315
  end
39286
- self:lazyInit()
39287
- return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
39288
- end
39289
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectible", true)
39290
- function ModdedElementSets.prototype.getTrinketArray(self)
39291
- self:lazyInit()
39292
- return self.allTrinketTypesArray
39293
- end
39294
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketArray", true)
39295
- function ModdedElementSets.prototype.getTrinketSet(self)
39296
- self:lazyInit()
39297
- return self.allTrinketTypesSet
39298
- end
39299
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketSet", true)
39300
- function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
39301
- self:lazyInit()
39302
- local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
39303
- if trinketsSet == nil then
39304
- return __TS__New(ReadonlySet)
39305
- end
39306
- return trinketsSet
39307
- end
39308
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsWithCacheFlag", true)
39309
- function ModdedElementSets.prototype.getVanillaCardArray(self)
39310
- self:lazyInitVanillaCardTypes()
39311
- return self.vanillaCardTypesArray
39312
- end
39313
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardArray", true)
39314
- function ModdedElementSets.prototype.getVanillaCardSet(self)
39315
- self:lazyInitVanillaCardTypes()
39316
- return self.vanillaCardTypesSet
39317
- end
39318
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardSet", true)
39319
- function ModdedElementSets.prototype.getVanillaCollectibleArray(self)
39320
- self:lazyInitVanillaCollectibleTypes()
39321
- return self.vanillaCollectibleTypesArray
39322
- end
39323
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleArray", true)
39324
- function ModdedElementSets.prototype.getVanillaCollectibleSet(self)
39325
- self:lazyInitVanillaCollectibleTypes()
39326
- return self.vanillaCollectibleTypesSet
39327
- end
39328
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleSet", true)
39329
- function ModdedElementSets.prototype.getVanillaTrinketArray(self)
39330
- self:lazyInitVanillaTrinketTypes()
39331
- return self.vanillaTrinketTypesArray
39332
- end
39333
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketArray", true)
39334
- function ModdedElementSets.prototype.getVanillaTrinketSet(self)
39335
- self:lazyInitVanillaTrinketTypes()
39336
- return self.vanillaTrinketTypesSet
39316
+ local runesSet = self:getCardTypesOfType(ItemConfigCardType.RUNE)
39317
+ runesSet:delete(CardType.RUNE_SHARD)
39318
+ return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
39337
39319
  end
39338
- __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketSet", true)
39320
+ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomRune", true)
39339
39321
  return ____exports
39340
39322
  end,
39341
39323
  ["src.classes.features.callbackLogic.PlayerCollectibleDetection"] = function(...)
@@ -51152,13 +51134,13 @@ function FlyingDetection.prototype.____constructor(self, moddedElementSets)
51152
51134
  end
51153
51135
  function FlyingDetection.prototype.hasFlyingTemporaryEffect(self, player)
51154
51136
  local effects = player:GetEffects()
51155
- local flyingCollectibles = self.moddedElementSets:getFlyingCollectibles(true)
51137
+ local flyingCollectibles = self.moddedElementSets:getFlyingCollectibleTypes(true)
51156
51138
  for ____, collectibleType in __TS__Iterator(flyingCollectibles) do
51157
51139
  if effects:HasCollectibleEffect(collectibleType) then
51158
51140
  return true
51159
51141
  end
51160
51142
  end
51161
- local flyingTrinkets = self.moddedElementSets:getFlyingTrinkets()
51143
+ local flyingTrinkets = self.moddedElementSets:getFlyingTrinketTypes()
51162
51144
  for ____, trinketType in __TS__Iterator(flyingTrinkets) do
51163
51145
  if effects:HasTrinketEffect(trinketType) then
51164
51146
  return true
@@ -51359,7 +51341,7 @@ function ItemPoolDetection.prototype.____constructor(self, moddedElementSets)
51359
51341
  self.moddedElementSets = moddedElementSets
51360
51342
  end
51361
51343
  function ItemPoolDetection.prototype.getCollectiblesInItemPool(self, itemPoolType)
51362
- local collectibleArray = self.moddedElementSets:getCollectibleArray()
51344
+ local collectibleArray = self.moddedElementSets:getCollectibleTypes()
51363
51345
  return __TS__ArrayFilter(
51364
51346
  collectibleArray,
51365
51347
  function(____, collectibleType) return self:isCollectibleInItemPool(collectibleType, itemPoolType) end
@@ -51384,7 +51366,7 @@ function ItemPoolDetection.prototype.isCollectibleInItemPool(self, collectibleTy
51384
51366
  local removedTrinketsMap = ____removeItemsAndTrinketsThatAffectItemPools_result_0.removedTrinketsMap
51385
51367
  local itemPool = game:GetItemPool()
51386
51368
  itemPool:ResetRoomBlacklist()
51387
- for ____, collectibleTypeInSet in ipairs(self.moddedElementSets:getCollectibleArray()) do
51369
+ for ____, collectibleTypeInSet in ipairs(self.moddedElementSets:getCollectibleTypes()) do
51388
51370
  if collectibleTypeInSet ~= collectibleType then
51389
51371
  itemPool:AddRoomBlacklist(collectibleTypeInSet)
51390
51372
  end
@@ -53238,6 +53220,9 @@ function initOptionalFeatures(self, mod, features)
53238
53220
  for ____, ____value in ipairs(exportedMethodTuples) do
53239
53221
  local funcName = ____value[1]
53240
53222
  local func = ____value[2]
53223
+ if modRecord[funcName] ~= nil then
53224
+ error(("Failed to upgrade the mod since two or more features share the name function name of \"" .. funcName) .. "\". This should never happen, so report this error to the library authors.")
53225
+ end
53241
53226
  modRecord[funcName] = func
53242
53227
  end
53243
53228
  end
@@ -54580,6 +54565,14 @@ do
54580
54565
  end
54581
54566
  end
54582
54567
  end
54568
+ do
54569
+ local ____export = require("src.core.constantsVanilla")
54570
+ for ____exportKey, ____exportValue in pairs(____export) do
54571
+ if ____exportKey ~= "default" then
54572
+ ____exports[____exportKey] = ____exportValue
54573
+ end
54574
+ end
54575
+ end
54583
54576
  do
54584
54577
  local ____export = require("src.core.upgradeMod")
54585
54578
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -55704,6 +55697,14 @@ do
55704
55697
  end
55705
55698
  end
55706
55699
  end
55700
+ do
55701
+ local ____export = require("src.core.constantsVanilla")
55702
+ for ____exportKey, ____exportValue in pairs(____export) do
55703
+ if ____exportKey ~= "default" then
55704
+ ____exports[____exportKey] = ____exportValue
55705
+ end
55706
+ end
55707
+ end
55707
55708
  do
55708
55709
  local ____export = require("src.core.upgradeMod")
55709
55710
  for ____exportKey, ____exportValue in pairs(____export) do