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.
- package/dist/index.rollup.d.ts +364 -334
- package/dist/isaacscript-common.lua +379 -378
- package/dist/src/classes/features/other/FlyingDetection.lua +2 -2
- package/dist/src/classes/features/other/ItemPoolDetection.lua +2 -2
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts +0 -86
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementDetection.lua +1 -57
- package/dist/src/classes/features/other/ModdedElementSets.d.ts +250 -210
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +285 -284
- package/dist/src/core/constants.d.ts +17 -2
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +8 -1
- package/dist/src/core/constantsFirstLast.d.ts +5 -0
- package/dist/src/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/src/core/constantsVanilla.d.ts +93 -0
- package/dist/src/core/constantsVanilla.d.ts.map +1 -0
- package/dist/src/core/constantsVanilla.lua +115 -0
- package/dist/src/core/upgradeMod.lua +3 -0
- package/dist/src/functions/cards.d.ts +0 -7
- package/dist/src/functions/cards.d.ts.map +1 -1
- package/dist/src/functions/cards.lua +0 -10
- package/dist/src/functions/collectibles.d.ts +0 -10
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +0 -13
- package/dist/src/functions/dimensions.d.ts +0 -4
- package/dist/src/functions/dimensions.d.ts.map +1 -1
- package/dist/src/functions/dimensions.lua +2 -8
- package/dist/src/functions/pills.d.ts +0 -2
- package/dist/src/functions/pills.d.ts.map +1 -1
- package/dist/src/functions/pills.lua +0 -5
- package/dist/src/functions/rooms.lua +2 -2
- package/dist/src/functions/trinkets.d.ts +0 -9
- package/dist/src/functions/trinkets.d.ts.map +1 -1
- package/dist/src/functions/trinkets.lua +0 -12
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/package.json +1 -1
- package/src/classes/features/other/FlyingDetection.ts +2 -2
- package/src/classes/features/other/ItemPoolDetection.ts +2 -2
- package/src/classes/features/other/ModdedElementDetection.ts +4 -156
- package/src/classes/features/other/ModdedElementSets.ts +552 -486
- package/src/core/constants.ts +15 -2
- package/src/core/constantsFirstLast.ts +5 -1
- package/src/core/constantsVanilla.ts +183 -0
- package/src/core/upgradeMod.ts +6 -1
- package/src/functions/cards.ts +1 -15
- package/src/functions/collectibles.ts +1 -18
- package/src/functions/dimensions.ts +2 -10
- package/src/functions/pills.ts +0 -6
- package/src/functions/rooms.ts +3 -3
- package/src/functions/trinkets.ts +1 -17
- package/src/index.ts +1 -0
|
@@ -23,18 +23,21 @@ 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 ____constantsVanilla = require("src.core.constantsVanilla")
|
|
27
|
+
local VANILLA_CARD_TYPES = ____constantsVanilla.VANILLA_CARD_TYPES
|
|
28
|
+
local VANILLA_COLLECTIBLE_TYPES = ____constantsVanilla.VANILLA_COLLECTIBLE_TYPES
|
|
29
|
+
local VANILLA_PILL_EFFECTS = ____constantsVanilla.VANILLA_PILL_EFFECTS
|
|
30
|
+
local VANILLA_TRINKET_TYPES = ____constantsVanilla.VANILLA_TRINKET_TYPES
|
|
26
31
|
local ____decorators = require("src.decorators")
|
|
27
32
|
local Exported = ____decorators.Exported
|
|
28
33
|
local ____ISCFeature = require("src.enums.ISCFeature")
|
|
29
34
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
30
35
|
local ____cards = require("src.functions.cards")
|
|
31
36
|
local getItemConfigCardType = ____cards.getItemConfigCardType
|
|
32
|
-
local getVanillaCardTypes = ____cards.getVanillaCardTypes
|
|
33
37
|
local ____collectibleTag = require("src.functions.collectibleTag")
|
|
34
38
|
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
35
39
|
local ____collectibles = require("src.functions.collectibles")
|
|
36
40
|
local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
|
|
37
|
-
local getVanillaCollectibleTypeRange = ____collectibles.getVanillaCollectibleTypeRange
|
|
38
41
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
39
42
|
local isHiddenCollectible = ____collectibles.isHiddenCollectible
|
|
40
43
|
local isPassiveCollectible = ____collectibles.isPassiveCollectible
|
|
@@ -48,10 +51,15 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
|
48
51
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
49
52
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
50
53
|
local ____trinkets = require("src.functions.trinkets")
|
|
51
|
-
local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
|
|
52
54
|
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
|
|
55
|
+
local ____types = require("src.functions.types")
|
|
56
|
+
local asCardType = ____types.asCardType
|
|
57
|
+
local asCollectibleType = ____types.asCollectibleType
|
|
58
|
+
local asPillEffect = ____types.asPillEffect
|
|
59
|
+
local asTrinketType = ____types.asTrinketType
|
|
53
60
|
local ____utils = require("src.functions.utils")
|
|
54
61
|
local assertDefined = ____utils.assertDefined
|
|
62
|
+
local iRange = ____utils.iRange
|
|
55
63
|
local ____repeat = ____utils["repeat"]
|
|
56
64
|
local ____itemConfigCardTypesForCardsSet = require("src.sets.itemConfigCardTypesForCardsSet")
|
|
57
65
|
local ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = ____itemConfigCardTypesForCardsSet.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET
|
|
@@ -76,6 +84,12 @@ local TRANSFORMATION_TO_TAG_MAP = __TS__New(ReadonlyMap, {
|
|
|
76
84
|
{PlayerForm.BOOKWORM, ItemConfigTag.BOOK},
|
|
77
85
|
{PlayerForm.SPIDER_BABY, ItemConfigTag.SPIDER}
|
|
78
86
|
})
|
|
87
|
+
--- A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded
|
|
88
|
+
-- elements. This is useful for performance purposes (so that we do not have to reconstruct the
|
|
89
|
+
-- arrays/sets multiple times).
|
|
90
|
+
--
|
|
91
|
+
-- The modded arrays/sets are created using the functions from
|
|
92
|
+
-- `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
79
93
|
____exports.ModdedElementSets = __TS__Class()
|
|
80
94
|
local ModdedElementSets = ____exports.ModdedElementSets
|
|
81
95
|
ModdedElementSets.name = "ModdedElementSets"
|
|
@@ -85,28 +99,26 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
|
|
|
85
99
|
self.arraysInitialized = false
|
|
86
100
|
self.allCollectibleTypesArray = {}
|
|
87
101
|
self.allCollectibleTypesSet = __TS__New(Set)
|
|
88
|
-
self.vanillaCollectibleTypesArray = {}
|
|
89
|
-
self.vanillaCollectibleTypesSet = __TS__New(Set)
|
|
90
102
|
self.moddedCollectibleTypesArray = {}
|
|
91
103
|
self.moddedCollectibleTypesSet = __TS__New(Set)
|
|
92
104
|
self.allTrinketTypesArray = {}
|
|
93
105
|
self.allTrinketTypesSet = __TS__New(Set)
|
|
94
|
-
self.vanillaTrinketTypesArray = {}
|
|
95
|
-
self.vanillaTrinketTypesSet = __TS__New(Set)
|
|
96
106
|
self.moddedTrinketTypesArray = {}
|
|
97
107
|
self.moddedTrinketTypesSet = __TS__New(Set)
|
|
98
108
|
self.allCardTypesArray = {}
|
|
99
109
|
self.allCardTypesSet = __TS__New(Set)
|
|
100
|
-
self.vanillaCardTypesArray = {}
|
|
101
|
-
self.vanillaCardTypesSet = __TS__New(Set)
|
|
102
110
|
self.moddedCardTypesArray = {}
|
|
103
111
|
self.moddedCardTypesSet = __TS__New(Set)
|
|
104
|
-
self.
|
|
112
|
+
self.allPillEffectsArray = {}
|
|
113
|
+
self.allPillEffectsSet = __TS__New(Set)
|
|
114
|
+
self.moddedPillEffectsArray = {}
|
|
115
|
+
self.moddedPillEffectsSet = __TS__New(Set)
|
|
105
116
|
self.cacheFlagToCollectibleTypesMap = __TS__New(Map)
|
|
106
117
|
self.cacheFlagToTrinketTypesMap = __TS__New(Map)
|
|
107
118
|
self.flyingCollectibleTypesSet = __TS__New(Set)
|
|
108
119
|
self.permanentFlyingCollectibleTypesSet = __TS__New(Set)
|
|
109
120
|
self.flyingTrinketTypesSet = __TS__New(Set)
|
|
121
|
+
self.tagToCollectibleTypesMap = __TS__New(Map)
|
|
110
122
|
self.edenActiveCollectibleTypesSet = __TS__New(Set)
|
|
111
123
|
self.edenPassiveCollectibleTypesSet = __TS__New(Set)
|
|
112
124
|
self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
|
|
@@ -119,12 +131,10 @@ function ModdedElementSets.prototype.lazyInit(self)
|
|
|
119
131
|
return
|
|
120
132
|
end
|
|
121
133
|
self.arraysInitialized = true
|
|
122
|
-
self:lazyInitVanillaCollectibleTypes()
|
|
123
134
|
self:lazyInitModdedCollectibleTypes()
|
|
124
|
-
self:lazyInitVanillaTrinketTypes()
|
|
125
135
|
self:lazyInitModdedTrinketTypes()
|
|
126
|
-
self:lazyInitVanillaCardTypes()
|
|
127
136
|
self:lazyInitModdedCardTypes()
|
|
137
|
+
self:lazyInitModdedPillEffects()
|
|
128
138
|
self:lazyInitTagToCollectibleTypesMap()
|
|
129
139
|
self:lazyInitCacheFlagToCollectibleTypesMap()
|
|
130
140
|
self:lazyInitCacheFlagToTrinketTypesMap()
|
|
@@ -133,102 +143,103 @@ function ModdedElementSets.prototype.lazyInit(self)
|
|
|
133
143
|
self:lazyInitEdenCollectibleTypesSet()
|
|
134
144
|
self:lazyInitCardTypes()
|
|
135
145
|
end
|
|
136
|
-
function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
|
|
137
|
-
if #self.vanillaCollectibleTypesArray > 0 then
|
|
138
|
-
return
|
|
139
|
-
end
|
|
140
|
-
local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
|
|
141
|
-
for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
|
|
142
|
-
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
143
|
-
if itemConfigItem ~= nil then
|
|
144
|
-
local ____self_vanillaCollectibleTypesArray_0 = self.vanillaCollectibleTypesArray
|
|
145
|
-
____self_vanillaCollectibleTypesArray_0[#____self_vanillaCollectibleTypesArray_0 + 1] = collectibleType
|
|
146
|
-
self.vanillaCollectibleTypesSet:add(collectibleType)
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
146
|
function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
|
|
151
|
-
for ____, collectibleType in ipairs(
|
|
152
|
-
local
|
|
153
|
-
|
|
147
|
+
for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES) do
|
|
148
|
+
local ____self_allCollectibleTypesArray_0 = self.allCollectibleTypesArray
|
|
149
|
+
____self_allCollectibleTypesArray_0[#____self_allCollectibleTypesArray_0 + 1] = collectibleType
|
|
154
150
|
self.allCollectibleTypesSet:add(collectibleType)
|
|
155
151
|
end
|
|
156
|
-
local
|
|
157
|
-
|
|
152
|
+
local firstModdedCollectibleType = self.moddedElementDetection:getFirstModdedCollectibleType()
|
|
153
|
+
if firstModdedCollectibleType == nil then
|
|
154
|
+
return
|
|
155
|
+
end
|
|
156
|
+
local lastCollectibleType = self.moddedElementDetection:getLastCollectibleType()
|
|
157
|
+
local moddedCollectibleTypes = iRange(nil, firstModdedCollectibleType, lastCollectibleType)
|
|
158
|
+
for ____, collectibleTypeInt in ipairs(moddedCollectibleTypes) do
|
|
159
|
+
local collectibleType = asCollectibleType(nil, collectibleTypeInt)
|
|
158
160
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
159
161
|
if itemConfigItem ~= nil then
|
|
160
|
-
local
|
|
161
|
-
|
|
162
|
+
local ____self_moddedCollectibleTypesArray_1 = self.moddedCollectibleTypesArray
|
|
163
|
+
____self_moddedCollectibleTypesArray_1[#____self_moddedCollectibleTypesArray_1 + 1] = collectibleType
|
|
162
164
|
self.moddedCollectibleTypesSet:add(collectibleType)
|
|
163
|
-
local
|
|
164
|
-
|
|
165
|
+
local ____self_allCollectibleTypesArray_2 = self.allCollectibleTypesArray
|
|
166
|
+
____self_allCollectibleTypesArray_2[#____self_allCollectibleTypesArray_2 + 1] = collectibleType
|
|
165
167
|
self.allCollectibleTypesSet:add(collectibleType)
|
|
166
168
|
end
|
|
167
169
|
end
|
|
168
170
|
end
|
|
169
|
-
function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
|
|
170
|
-
if #self.vanillaTrinketTypesArray > 0 then
|
|
171
|
-
return
|
|
172
|
-
end
|
|
173
|
-
local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
|
|
174
|
-
for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
|
|
175
|
-
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
176
|
-
if itemConfigItem ~= nil then
|
|
177
|
-
local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
|
|
178
|
-
____self_vanillaTrinketTypesArray_4[#____self_vanillaTrinketTypesArray_4 + 1] = trinketType
|
|
179
|
-
self.vanillaTrinketTypesSet:add(trinketType)
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
end
|
|
183
171
|
function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
|
|
184
|
-
for ____, trinketType in ipairs(
|
|
185
|
-
local
|
|
186
|
-
|
|
172
|
+
for ____, trinketType in ipairs(VANILLA_TRINKET_TYPES) do
|
|
173
|
+
local ____self_allTrinketTypesArray_3 = self.allTrinketTypesArray
|
|
174
|
+
____self_allTrinketTypesArray_3[#____self_allTrinketTypesArray_3 + 1] = trinketType
|
|
187
175
|
self.allTrinketTypesSet:add(trinketType)
|
|
188
176
|
end
|
|
189
|
-
local
|
|
190
|
-
|
|
177
|
+
local firstModdedTrinketType = self.moddedElementDetection:getFirstModdedTrinketType()
|
|
178
|
+
if firstModdedTrinketType == nil then
|
|
179
|
+
return
|
|
180
|
+
end
|
|
181
|
+
local lastTrinketType = self.moddedElementDetection:getLastTrinketType()
|
|
182
|
+
local moddedTrinketTypes = iRange(nil, firstModdedTrinketType, lastTrinketType)
|
|
183
|
+
for ____, trinketTypeInt in ipairs(moddedTrinketTypes) do
|
|
184
|
+
local trinketType = asTrinketType(nil, trinketTypeInt)
|
|
191
185
|
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
192
186
|
if itemConfigItem ~= nil then
|
|
193
|
-
local
|
|
194
|
-
|
|
187
|
+
local ____self_moddedTrinketTypesArray_4 = self.moddedTrinketTypesArray
|
|
188
|
+
____self_moddedTrinketTypesArray_4[#____self_moddedTrinketTypesArray_4 + 1] = trinketType
|
|
195
189
|
self.moddedTrinketTypesSet:add(trinketType)
|
|
196
|
-
local
|
|
197
|
-
|
|
190
|
+
local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
|
|
191
|
+
____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
|
|
198
192
|
self.allTrinketTypesSet:add(trinketType)
|
|
199
193
|
end
|
|
200
194
|
end
|
|
201
195
|
end
|
|
202
|
-
function ModdedElementSets.prototype.
|
|
203
|
-
|
|
196
|
+
function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
|
|
197
|
+
for ____, cardType in ipairs(VANILLA_CARD_TYPES) do
|
|
198
|
+
local ____self_allCardTypesArray_6 = self.allCardTypesArray
|
|
199
|
+
____self_allCardTypesArray_6[#____self_allCardTypesArray_6 + 1] = cardType
|
|
200
|
+
self.allCardTypesSet:add(cardType)
|
|
201
|
+
end
|
|
202
|
+
local firstModdedCardType = self.moddedElementDetection:getFirstModdedCardType()
|
|
203
|
+
if firstModdedCardType == nil then
|
|
204
204
|
return
|
|
205
205
|
end
|
|
206
|
-
local
|
|
207
|
-
|
|
206
|
+
local lastCardType = self.moddedElementDetection:getLastCardType()
|
|
207
|
+
local moddedCardTypes = iRange(nil, firstModdedCardType, lastCardType)
|
|
208
|
+
for ____, cardTypeInt in ipairs(moddedCardTypes) do
|
|
209
|
+
local cardType = asCardType(nil, cardTypeInt)
|
|
208
210
|
local itemConfigCard = itemConfig:GetCard(cardType)
|
|
209
211
|
if itemConfigCard ~= nil then
|
|
210
|
-
local
|
|
211
|
-
|
|
212
|
-
self.
|
|
212
|
+
local ____self_moddedCardTypesArray_7 = self.moddedCardTypesArray
|
|
213
|
+
____self_moddedCardTypesArray_7[#____self_moddedCardTypesArray_7 + 1] = cardType
|
|
214
|
+
self.moddedCardTypesSet:add(cardType)
|
|
215
|
+
local ____self_allCardTypesArray_8 = self.allCardTypesArray
|
|
216
|
+
____self_allCardTypesArray_8[#____self_allCardTypesArray_8 + 1] = cardType
|
|
217
|
+
self.allCardTypesSet:add(cardType)
|
|
213
218
|
end
|
|
214
219
|
end
|
|
215
220
|
end
|
|
216
|
-
function ModdedElementSets.prototype.
|
|
217
|
-
for ____,
|
|
218
|
-
local
|
|
219
|
-
|
|
220
|
-
self.
|
|
221
|
+
function ModdedElementSets.prototype.lazyInitModdedPillEffects(self)
|
|
222
|
+
for ____, pillEffect in ipairs(VANILLA_PILL_EFFECTS) do
|
|
223
|
+
local ____self_allPillEffectsArray_9 = self.allPillEffectsArray
|
|
224
|
+
____self_allPillEffectsArray_9[#____self_allPillEffectsArray_9 + 1] = pillEffect
|
|
225
|
+
self.allPillEffectsSet:add(pillEffect)
|
|
221
226
|
end
|
|
222
|
-
local
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
local firstModdedPillEffect = self.moddedElementDetection:getFirstModdedPillEffect()
|
|
228
|
+
if firstModdedPillEffect == nil then
|
|
229
|
+
return
|
|
230
|
+
end
|
|
231
|
+
local lastPillEffect = self.moddedElementDetection:getLastPillEffect()
|
|
232
|
+
local moddedPillEffects = iRange(nil, firstModdedPillEffect, lastPillEffect)
|
|
233
|
+
for ____, pillEffectInt in ipairs(moddedPillEffects) do
|
|
234
|
+
local pillEffect = asPillEffect(nil, pillEffectInt)
|
|
235
|
+
local itemConfigPillEffect = itemConfig:GetPillEffect(pillEffect)
|
|
236
|
+
if itemConfigPillEffect ~= nil then
|
|
237
|
+
local ____self_moddedPillEffectsArray_10 = self.moddedPillEffectsArray
|
|
238
|
+
____self_moddedPillEffectsArray_10[#____self_moddedPillEffectsArray_10 + 1] = pillEffect
|
|
239
|
+
self.moddedPillEffectsSet:add(pillEffect)
|
|
240
|
+
local ____self_allPillEffectsArray_11 = self.allPillEffectsArray
|
|
241
|
+
____self_allPillEffectsArray_11[#____self_allPillEffectsArray_11 + 1] = pillEffect
|
|
242
|
+
self.allPillEffectsSet:add(pillEffect)
|
|
232
243
|
end
|
|
233
244
|
end
|
|
234
245
|
end
|
|
@@ -239,11 +250,11 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
|
|
|
239
250
|
__TS__New(Set)
|
|
240
251
|
)
|
|
241
252
|
end
|
|
242
|
-
for ____, collectibleType in ipairs(self:
|
|
253
|
+
for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
|
|
243
254
|
for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
|
|
244
255
|
do
|
|
245
256
|
if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
|
|
246
|
-
goto
|
|
257
|
+
goto __continue37
|
|
247
258
|
end
|
|
248
259
|
local collectibleTypesSet = self.tagToCollectibleTypesMap:get(itemConfigTag)
|
|
249
260
|
if collectibleTypesSet == nil then
|
|
@@ -252,14 +263,14 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
|
|
|
252
263
|
end
|
|
253
264
|
collectibleTypesSet:add(collectibleType)
|
|
254
265
|
end
|
|
255
|
-
::
|
|
266
|
+
::__continue37::
|
|
256
267
|
end
|
|
257
268
|
end
|
|
258
269
|
end
|
|
259
270
|
function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
|
|
260
271
|
for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
|
|
261
272
|
local collectiblesSet = __TS__New(Set)
|
|
262
|
-
for ____, collectibleType in ipairs(self:
|
|
273
|
+
for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
|
|
263
274
|
if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
|
|
264
275
|
collectiblesSet:add(collectibleType)
|
|
265
276
|
end
|
|
@@ -270,7 +281,7 @@ end
|
|
|
270
281
|
function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
|
|
271
282
|
for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
|
|
272
283
|
local trinketsSet = __TS__New(Set)
|
|
273
|
-
for ____, trinketType in ipairs(self:
|
|
284
|
+
for ____, trinketType in ipairs(self:getTrinketTypes()) do
|
|
274
285
|
if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
|
|
275
286
|
trinketsSet:add(trinketType)
|
|
276
287
|
end
|
|
@@ -281,9 +292,9 @@ end
|
|
|
281
292
|
function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
|
|
282
293
|
self.flyingCollectibleTypesSet = copySet(
|
|
283
294
|
nil,
|
|
284
|
-
self:
|
|
295
|
+
self:getCollectibleTypesWithCacheFlag(CacheFlag.FLYING)
|
|
285
296
|
)
|
|
286
|
-
local collectiblesWithAllCacheFlag = self:
|
|
297
|
+
local collectiblesWithAllCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.ALL)
|
|
287
298
|
deleteSetsFromSet(nil, self.flyingCollectibleTypesSet, collectiblesWithAllCacheFlag)
|
|
288
299
|
local permanentFlyingCollectibleTypes = copySet(nil, self.flyingCollectibleTypesSet)
|
|
289
300
|
for ____, collectibleType in ipairs(CONDITIONAL_FLYING_COLLECTIBLE_TYPES) do
|
|
@@ -296,20 +307,20 @@ end
|
|
|
296
307
|
function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
|
|
297
308
|
self.flyingTrinketTypesSet = copySet(
|
|
298
309
|
nil,
|
|
299
|
-
self:
|
|
310
|
+
self:getTrinketsTypesWithCacheFlag(CacheFlag.FLYING)
|
|
300
311
|
)
|
|
301
312
|
local trinketsWithAllCacheFlag = copySet(
|
|
302
313
|
nil,
|
|
303
|
-
self:
|
|
314
|
+
self:getTrinketsTypesWithCacheFlag(CacheFlag.ALL)
|
|
304
315
|
)
|
|
305
316
|
trinketsWithAllCacheFlag:delete(TrinketType.AZAZELS_STUMP)
|
|
306
317
|
deleteSetsFromSet(nil, self.flyingTrinketTypesSet, trinketsWithAllCacheFlag)
|
|
307
318
|
end
|
|
308
319
|
function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
|
|
309
|
-
for ____, collectibleType in ipairs(self:
|
|
320
|
+
for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
|
|
310
321
|
do
|
|
311
322
|
if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
|
|
312
|
-
goto
|
|
323
|
+
goto __continue61
|
|
313
324
|
end
|
|
314
325
|
if isActiveCollectible(nil, collectibleType) then
|
|
315
326
|
self.edenActiveCollectibleTypesSet:add(collectibleType)
|
|
@@ -318,7 +329,7 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
|
|
|
318
329
|
self.edenPassiveCollectibleTypesSet:add(collectibleType)
|
|
319
330
|
end
|
|
320
331
|
end
|
|
321
|
-
::
|
|
332
|
+
::__continue61::
|
|
322
333
|
end
|
|
323
334
|
end
|
|
324
335
|
function ModdedElementSets.prototype.lazyInitCardTypes(self)
|
|
@@ -328,7 +339,7 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
|
|
|
328
339
|
__TS__New(Set)
|
|
329
340
|
)
|
|
330
341
|
end
|
|
331
|
-
for ____, cardType in ipairs(self:
|
|
342
|
+
for ____, cardType in ipairs(self:getCardTypes()) do
|
|
332
343
|
local itemConfigCardType = getItemConfigCardType(nil, cardType)
|
|
333
344
|
if itemConfigCardType ~= nil then
|
|
334
345
|
local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
|
|
@@ -344,126 +355,28 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
|
|
|
344
355
|
end
|
|
345
356
|
end
|
|
346
357
|
end
|
|
347
|
-
function ModdedElementSets.prototype.
|
|
348
|
-
self:lazyInit()
|
|
349
|
-
return self.allCardTypesArray
|
|
350
|
-
end
|
|
351
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardArray", true)
|
|
352
|
-
function ModdedElementSets.prototype.getCardSet(self)
|
|
353
|
-
self:lazyInit()
|
|
354
|
-
return self.allCardTypesSet
|
|
355
|
-
end
|
|
356
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardSet", true)
|
|
357
|
-
function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
|
|
358
|
-
local itemConfigCardTypes = {...}
|
|
359
|
-
self:lazyInit()
|
|
360
|
-
local matchingCardTypes = __TS__New(Set)
|
|
361
|
-
for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
|
|
362
|
-
local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
|
|
363
|
-
assertDefined(
|
|
364
|
-
nil,
|
|
365
|
-
cardTypeSet,
|
|
366
|
-
"Failed to get the card type set for item config type: " .. tostring(itemConfigCardType)
|
|
367
|
-
)
|
|
368
|
-
for ____, cardType in __TS__Iterator(cardTypeSet) do
|
|
369
|
-
matchingCardTypes:add(cardType)
|
|
370
|
-
end
|
|
371
|
-
end
|
|
372
|
-
return matchingCardTypes
|
|
373
|
-
end
|
|
374
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
|
|
375
|
-
function ModdedElementSets.prototype.getCollectibleArray(self)
|
|
358
|
+
function ModdedElementSets.prototype.getCollectibleTypes(self)
|
|
376
359
|
self:lazyInit()
|
|
377
360
|
return self.allCollectibleTypesArray
|
|
378
361
|
end
|
|
379
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
380
|
-
function ModdedElementSets.prototype.
|
|
362
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypes", true)
|
|
363
|
+
function ModdedElementSets.prototype.getCollectibleTypeSet(self)
|
|
381
364
|
self:lazyInit()
|
|
382
365
|
return self.allCollectibleTypesSet
|
|
383
366
|
end
|
|
384
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
385
|
-
function ModdedElementSets.prototype.
|
|
386
|
-
local itemConfigTag = TRANSFORMATION_TO_TAG_MAP:get(playerForm)
|
|
387
|
-
assertDefined(
|
|
388
|
-
nil,
|
|
389
|
-
itemConfigTag,
|
|
390
|
-
("Failed to get the collectible types for the transformation of " .. tostring(playerForm)) .. " because that transformation is not based on collectibles."
|
|
391
|
-
)
|
|
392
|
-
return self:getCollectiblesWithTag(itemConfigTag)
|
|
393
|
-
end
|
|
394
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesForTransformation", true)
|
|
395
|
-
function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFlag)
|
|
396
|
-
self:lazyInit()
|
|
397
|
-
local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
|
|
398
|
-
if collectiblesSet == nil then
|
|
399
|
-
return __TS__New(ReadonlySet)
|
|
400
|
-
end
|
|
401
|
-
return collectiblesSet
|
|
402
|
-
end
|
|
403
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithCacheFlag", true)
|
|
404
|
-
function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
|
|
405
|
-
self:lazyInit()
|
|
406
|
-
local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
|
|
407
|
-
assertDefined(
|
|
408
|
-
nil,
|
|
409
|
-
collectibleTypes,
|
|
410
|
-
("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the \"ItemConfigTag\" enum."
|
|
411
|
-
)
|
|
412
|
-
return collectibleTypes
|
|
413
|
-
end
|
|
414
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithTag", true)
|
|
415
|
-
function ModdedElementSets.prototype.getEdenActiveCollectibles(self)
|
|
416
|
-
self:lazyInit()
|
|
417
|
-
return self.edenActiveCollectibleTypesSet
|
|
418
|
-
end
|
|
419
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibles", true)
|
|
420
|
-
function ModdedElementSets.prototype.getEdenPassiveCollectibles(self)
|
|
421
|
-
self:lazyInit()
|
|
422
|
-
return self.edenPassiveCollectibleTypesSet
|
|
423
|
-
end
|
|
424
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibles", true)
|
|
425
|
-
function ModdedElementSets.prototype.getFlyingCollectibles(self, includeConditionalItems)
|
|
426
|
-
self:lazyInit()
|
|
427
|
-
return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
|
|
428
|
-
end
|
|
429
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibles", true)
|
|
430
|
-
function ModdedElementSets.prototype.getFlyingTrinkets(self)
|
|
431
|
-
self:lazyInit()
|
|
432
|
-
return self.flyingTrinketTypesSet
|
|
433
|
-
end
|
|
434
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinkets", true)
|
|
435
|
-
function ModdedElementSets.prototype.getModdedCardArray(self)
|
|
436
|
-
self:lazyInit()
|
|
437
|
-
return self.moddedCardTypesArray
|
|
438
|
-
end
|
|
439
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardArray", true)
|
|
440
|
-
function ModdedElementSets.prototype.getModdedCardSet(self)
|
|
441
|
-
self:lazyInit()
|
|
442
|
-
return self.moddedCardTypesSet
|
|
443
|
-
end
|
|
444
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardSet", true)
|
|
445
|
-
function ModdedElementSets.prototype.getModdedCollectibleArray(self)
|
|
367
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypeSet", true)
|
|
368
|
+
function ModdedElementSets.prototype.getModdedCollectibleTypes(self)
|
|
446
369
|
self:lazyInit()
|
|
447
370
|
return self.moddedCollectibleTypesArray
|
|
448
371
|
end
|
|
449
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
450
|
-
function ModdedElementSets.prototype.
|
|
372
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypes", true)
|
|
373
|
+
function ModdedElementSets.prototype.getModdedCollectibleTypesSet(self)
|
|
451
374
|
self:lazyInit()
|
|
452
375
|
return self.moddedCollectibleTypesSet
|
|
453
376
|
end
|
|
454
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
455
|
-
function ModdedElementSets.prototype.getModdedTrinketArray(self)
|
|
456
|
-
self:lazyInit()
|
|
457
|
-
return self.moddedTrinketTypesArray
|
|
458
|
-
end
|
|
459
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketArray", true)
|
|
460
|
-
function ModdedElementSets.prototype.getModdedTrinketSet(self)
|
|
461
|
-
self:lazyInit()
|
|
462
|
-
return self.moddedTrinketTypesSet
|
|
463
|
-
end
|
|
464
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketSet", true)
|
|
377
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypesSet", true)
|
|
465
378
|
function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
|
|
466
|
-
local collectibleArray = self:
|
|
379
|
+
local collectibleArray = self:getCollectibleTypes()
|
|
467
380
|
local collectibleMap = __TS__New(Map)
|
|
468
381
|
for ____, collectibleType in ipairs(collectibleArray) do
|
|
469
382
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
@@ -490,8 +403,86 @@ function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
|
|
|
490
403
|
return collectibleMap
|
|
491
404
|
end
|
|
492
405
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectibleMap", true)
|
|
406
|
+
function ModdedElementSets.prototype.getTrinketTypes(self)
|
|
407
|
+
self:lazyInit()
|
|
408
|
+
return self.allTrinketTypesArray
|
|
409
|
+
end
|
|
410
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypes", true)
|
|
411
|
+
function ModdedElementSets.prototype.getTrinketTypesSet(self)
|
|
412
|
+
self:lazyInit()
|
|
413
|
+
return self.allTrinketTypesSet
|
|
414
|
+
end
|
|
415
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypesSet", true)
|
|
416
|
+
function ModdedElementSets.prototype.getModdedTrinketTypes(self)
|
|
417
|
+
self:lazyInit()
|
|
418
|
+
return self.moddedTrinketTypesArray
|
|
419
|
+
end
|
|
420
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypes", true)
|
|
421
|
+
function ModdedElementSets.prototype.getModdedTrinketTypesSet(self)
|
|
422
|
+
self:lazyInit()
|
|
423
|
+
return self.moddedTrinketTypesSet
|
|
424
|
+
end
|
|
425
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypesSet", true)
|
|
426
|
+
function ModdedElementSets.prototype.getCardTypes(self)
|
|
427
|
+
self:lazyInit()
|
|
428
|
+
return self.allCardTypesArray
|
|
429
|
+
end
|
|
430
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypes", true)
|
|
431
|
+
function ModdedElementSets.prototype.getCardTypesSet(self)
|
|
432
|
+
self:lazyInit()
|
|
433
|
+
return self.allCardTypesSet
|
|
434
|
+
end
|
|
435
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesSet", true)
|
|
436
|
+
function ModdedElementSets.prototype.getModdedCardTypes(self)
|
|
437
|
+
self:lazyInit()
|
|
438
|
+
return self.moddedCardTypesArray
|
|
439
|
+
end
|
|
440
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypes", true)
|
|
441
|
+
function ModdedElementSets.prototype.getModdedCardTypesSet(self)
|
|
442
|
+
self:lazyInit()
|
|
443
|
+
return self.moddedCardTypesSet
|
|
444
|
+
end
|
|
445
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypesSet", true)
|
|
446
|
+
function ModdedElementSets.prototype.getPillEffects(self)
|
|
447
|
+
self:lazyInit()
|
|
448
|
+
return self.allPillEffectsArray
|
|
449
|
+
end
|
|
450
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffects", true)
|
|
451
|
+
function ModdedElementSets.prototype.getPillEffectsSet(self)
|
|
452
|
+
self:lazyInit()
|
|
453
|
+
return self.allPillEffectsSet
|
|
454
|
+
end
|
|
455
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffectsSet", true)
|
|
456
|
+
function ModdedElementSets.prototype.getModdedPillEffects(self)
|
|
457
|
+
self:lazyInit()
|
|
458
|
+
return self.moddedPillEffectsArray
|
|
459
|
+
end
|
|
460
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffects", true)
|
|
461
|
+
function ModdedElementSets.prototype.getModdedPillEffectsSet(self)
|
|
462
|
+
self:lazyInit()
|
|
463
|
+
return self.moddedPillEffectsSet
|
|
464
|
+
end
|
|
465
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffectsSet", true)
|
|
466
|
+
function ModdedElementSets.prototype.getCollectibleTypesWithCacheFlag(self, cacheFlag)
|
|
467
|
+
self:lazyInit()
|
|
468
|
+
local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
|
|
469
|
+
if collectiblesSet == nil then
|
|
470
|
+
return __TS__New(ReadonlySet)
|
|
471
|
+
end
|
|
472
|
+
return collectiblesSet
|
|
473
|
+
end
|
|
474
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithCacheFlag", true)
|
|
475
|
+
function ModdedElementSets.prototype.getTrinketsTypesWithCacheFlag(self, cacheFlag)
|
|
476
|
+
self:lazyInit()
|
|
477
|
+
local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
|
|
478
|
+
if trinketsSet == nil then
|
|
479
|
+
return __TS__New(ReadonlySet)
|
|
480
|
+
end
|
|
481
|
+
return trinketsSet
|
|
482
|
+
end
|
|
483
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsTypesWithCacheFlag", true)
|
|
493
484
|
function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
|
|
494
|
-
local collectiblesWithCacheFlag = self:
|
|
485
|
+
local collectiblesWithCacheFlag = self:getCollectibleTypesWithCacheFlag(cacheFlag)
|
|
495
486
|
local playerCollectibles = {}
|
|
496
487
|
for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesWithCacheFlag)) do
|
|
497
488
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
@@ -506,10 +497,43 @@ function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, pl
|
|
|
506
497
|
return playerCollectibles
|
|
507
498
|
end
|
|
508
499
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithCacheFlag", true)
|
|
500
|
+
function ModdedElementSets.prototype.getPlayerTrinketsWithCacheFlag(self, player, cacheFlag)
|
|
501
|
+
local trinketTypesWithCacheFlag = self:getTrinketsTypesWithCacheFlag(cacheFlag)
|
|
502
|
+
local playerTrinkets = __TS__New(Map)
|
|
503
|
+
for ____, trinketType in __TS__Iterator(trinketTypesWithCacheFlag) do
|
|
504
|
+
local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
|
|
505
|
+
if trinketMultiplier > 0 then
|
|
506
|
+
playerTrinkets:set(trinketType, trinketMultiplier)
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
return playerTrinkets
|
|
510
|
+
end
|
|
511
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerTrinketsWithCacheFlag", true)
|
|
512
|
+
function ModdedElementSets.prototype.getFlyingCollectibleTypes(self, includeConditionalItems)
|
|
513
|
+
self:lazyInit()
|
|
514
|
+
return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
|
|
515
|
+
end
|
|
516
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibleTypes", true)
|
|
517
|
+
function ModdedElementSets.prototype.getFlyingTrinketTypes(self)
|
|
518
|
+
self:lazyInit()
|
|
519
|
+
return self.flyingTrinketTypesSet
|
|
520
|
+
end
|
|
521
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinketTypes", true)
|
|
522
|
+
function ModdedElementSets.prototype.getCollectibleTypesWithTag(self, itemConfigTag)
|
|
523
|
+
self:lazyInit()
|
|
524
|
+
local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
|
|
525
|
+
assertDefined(
|
|
526
|
+
nil,
|
|
527
|
+
collectibleTypes,
|
|
528
|
+
("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the \"ItemConfigTag\" enum."
|
|
529
|
+
)
|
|
530
|
+
return collectibleTypes
|
|
531
|
+
end
|
|
532
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithTag", true)
|
|
509
533
|
function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player, itemConfigTag)
|
|
510
|
-
local
|
|
534
|
+
local collectibleTypesWithTag = self:getCollectibleTypesWithTag(itemConfigTag)
|
|
511
535
|
local playerCollectibles = {}
|
|
512
|
-
for ____, collectibleType in ipairs(getSortedSetValues(nil,
|
|
536
|
+
for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesWithTag)) do
|
|
513
537
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
514
538
|
____repeat(
|
|
515
539
|
nil,
|
|
@@ -522,8 +546,18 @@ function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player,
|
|
|
522
546
|
return playerCollectibles
|
|
523
547
|
end
|
|
524
548
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithTag", true)
|
|
549
|
+
function ModdedElementSets.prototype.getCollectibleTypesForTransformation(self, playerForm)
|
|
550
|
+
local itemConfigTag = TRANSFORMATION_TO_TAG_MAP:get(playerForm)
|
|
551
|
+
assertDefined(
|
|
552
|
+
nil,
|
|
553
|
+
itemConfigTag,
|
|
554
|
+
("Failed to get the collectible types for the transformation of " .. tostring(playerForm)) .. " because that transformation is not based on collectibles."
|
|
555
|
+
)
|
|
556
|
+
return self:getCollectibleTypesWithTag(itemConfigTag)
|
|
557
|
+
end
|
|
558
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesForTransformation", true)
|
|
525
559
|
function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self, player, playerForm)
|
|
526
|
-
local collectibleForTransformation = self:
|
|
560
|
+
local collectibleForTransformation = self:getCollectibleTypesForTransformation(playerForm)
|
|
527
561
|
local playerCollectibles = {}
|
|
528
562
|
for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleForTransformation)) do
|
|
529
563
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
@@ -538,19 +572,17 @@ function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self
|
|
|
538
572
|
return playerCollectibles
|
|
539
573
|
end
|
|
540
574
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesForTransformation", true)
|
|
541
|
-
function ModdedElementSets.prototype.
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
for ____, trinketType in __TS__Iterator(trinketsWithCacheFlag) do
|
|
545
|
-
local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
|
|
546
|
-
if trinketMultiplier > 0 then
|
|
547
|
-
playerTrinkets:set(trinketType, trinketMultiplier)
|
|
548
|
-
end
|
|
549
|
-
end
|
|
550
|
-
return playerTrinkets
|
|
575
|
+
function ModdedElementSets.prototype.getEdenActiveCollectibleTypes(self)
|
|
576
|
+
self:lazyInit()
|
|
577
|
+
return self.edenActiveCollectibleTypesSet
|
|
551
578
|
end
|
|
552
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
553
|
-
function ModdedElementSets.prototype.
|
|
579
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibleTypes", true)
|
|
580
|
+
function ModdedElementSets.prototype.getEdenPassiveCollectibleTypes(self)
|
|
581
|
+
self:lazyInit()
|
|
582
|
+
return self.edenPassiveCollectibleTypesSet
|
|
583
|
+
end
|
|
584
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibleTypes", true)
|
|
585
|
+
function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, seedOrRNG, exceptions)
|
|
554
586
|
if seedOrRNG == nil then
|
|
555
587
|
seedOrRNG = getRandomSeed(nil)
|
|
556
588
|
end
|
|
@@ -558,33 +590,50 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
|
558
590
|
exceptions = {}
|
|
559
591
|
end
|
|
560
592
|
self:lazyInit()
|
|
561
|
-
return getRandomSetElement(nil, self.
|
|
593
|
+
return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
|
|
562
594
|
end
|
|
563
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
564
|
-
function ModdedElementSets.prototype.
|
|
595
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectibleType", true)
|
|
596
|
+
function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, seedOrRNG, exceptions)
|
|
565
597
|
if seedOrRNG == nil then
|
|
566
598
|
seedOrRNG = getRandomSeed(nil)
|
|
567
599
|
end
|
|
568
600
|
if exceptions == nil then
|
|
569
601
|
exceptions = {}
|
|
570
602
|
end
|
|
571
|
-
|
|
572
|
-
return getRandomSetElement(nil,
|
|
603
|
+
self:lazyInit()
|
|
604
|
+
return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
|
|
573
605
|
end
|
|
574
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
575
|
-
function ModdedElementSets.prototype.
|
|
606
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectibleType", true)
|
|
607
|
+
function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
|
|
608
|
+
local itemConfigCardTypes = {...}
|
|
609
|
+
self:lazyInit()
|
|
610
|
+
local matchingCardTypes = __TS__New(Set)
|
|
611
|
+
for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
|
|
612
|
+
local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
|
|
613
|
+
assertDefined(
|
|
614
|
+
nil,
|
|
615
|
+
cardTypeSet,
|
|
616
|
+
"Failed to get the card type set for item config type: " .. tostring(itemConfigCardType)
|
|
617
|
+
)
|
|
618
|
+
for ____, cardType in __TS__Iterator(cardTypeSet) do
|
|
619
|
+
matchingCardTypes:add(cardType)
|
|
620
|
+
end
|
|
621
|
+
end
|
|
622
|
+
return matchingCardTypes
|
|
623
|
+
end
|
|
624
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
|
|
625
|
+
function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
|
|
576
626
|
if seedOrRNG == nil then
|
|
577
627
|
seedOrRNG = getRandomSeed(nil)
|
|
578
628
|
end
|
|
579
629
|
if exceptions == nil then
|
|
580
630
|
exceptions = {}
|
|
581
631
|
end
|
|
582
|
-
local
|
|
583
|
-
|
|
584
|
-
return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
|
|
632
|
+
local cardTypeSet = self:getCardTypesOfType(itemConfigCardType)
|
|
633
|
+
return getRandomSetElement(nil, cardTypeSet, seedOrRNG, exceptions)
|
|
585
634
|
end
|
|
586
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
587
|
-
function ModdedElementSets.prototype.
|
|
635
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
|
|
636
|
+
function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
588
637
|
if seedOrRNG == nil then
|
|
589
638
|
seedOrRNG = getRandomSeed(nil)
|
|
590
639
|
end
|
|
@@ -592,67 +641,19 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectible(self, seedOr
|
|
|
592
641
|
exceptions = {}
|
|
593
642
|
end
|
|
594
643
|
self:lazyInit()
|
|
595
|
-
return getRandomSetElement(nil, self.
|
|
644
|
+
return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
|
|
596
645
|
end
|
|
597
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
598
|
-
function ModdedElementSets.prototype.
|
|
646
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
|
|
647
|
+
function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
|
|
599
648
|
if seedOrRNG == nil then
|
|
600
649
|
seedOrRNG = getRandomSeed(nil)
|
|
601
650
|
end
|
|
602
651
|
if exceptions == nil then
|
|
603
652
|
exceptions = {}
|
|
604
653
|
end
|
|
605
|
-
self:
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectible", true)
|
|
609
|
-
function ModdedElementSets.prototype.getTrinketArray(self)
|
|
610
|
-
self:lazyInit()
|
|
611
|
-
return self.allTrinketTypesArray
|
|
612
|
-
end
|
|
613
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketArray", true)
|
|
614
|
-
function ModdedElementSets.prototype.getTrinketSet(self)
|
|
615
|
-
self:lazyInit()
|
|
616
|
-
return self.allTrinketTypesSet
|
|
617
|
-
end
|
|
618
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketSet", true)
|
|
619
|
-
function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
|
|
620
|
-
self:lazyInit()
|
|
621
|
-
local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
|
|
622
|
-
if trinketsSet == nil then
|
|
623
|
-
return __TS__New(ReadonlySet)
|
|
624
|
-
end
|
|
625
|
-
return trinketsSet
|
|
654
|
+
local runesSet = self:getCardTypesOfType(ItemConfigCardType.RUNE)
|
|
655
|
+
runesSet:delete(CardType.RUNE_SHARD)
|
|
656
|
+
return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
|
|
626
657
|
end
|
|
627
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "
|
|
628
|
-
function ModdedElementSets.prototype.getVanillaCardArray(self)
|
|
629
|
-
self:lazyInitVanillaCardTypes()
|
|
630
|
-
return self.vanillaCardTypesArray
|
|
631
|
-
end
|
|
632
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardArray", true)
|
|
633
|
-
function ModdedElementSets.prototype.getVanillaCardSet(self)
|
|
634
|
-
self:lazyInitVanillaCardTypes()
|
|
635
|
-
return self.vanillaCardTypesSet
|
|
636
|
-
end
|
|
637
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardSet", true)
|
|
638
|
-
function ModdedElementSets.prototype.getVanillaCollectibleArray(self)
|
|
639
|
-
self:lazyInitVanillaCollectibleTypes()
|
|
640
|
-
return self.vanillaCollectibleTypesArray
|
|
641
|
-
end
|
|
642
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleArray", true)
|
|
643
|
-
function ModdedElementSets.prototype.getVanillaCollectibleSet(self)
|
|
644
|
-
self:lazyInitVanillaCollectibleTypes()
|
|
645
|
-
return self.vanillaCollectibleTypesSet
|
|
646
|
-
end
|
|
647
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleSet", true)
|
|
648
|
-
function ModdedElementSets.prototype.getVanillaTrinketArray(self)
|
|
649
|
-
self:lazyInitVanillaTrinketTypes()
|
|
650
|
-
return self.vanillaTrinketTypesArray
|
|
651
|
-
end
|
|
652
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketArray", true)
|
|
653
|
-
function ModdedElementSets.prototype.getVanillaTrinketSet(self)
|
|
654
|
-
self:lazyInitVanillaTrinketTypes()
|
|
655
|
-
return self.vanillaTrinketTypesSet
|
|
656
|
-
end
|
|
657
|
-
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketSet", true)
|
|
658
|
+
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomRune", true)
|
|
658
659
|
return ____exports
|