isaacscript-common 38.0.1 → 39.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,6 @@ local itemConfig = ____cachedClasses.itemConfig
10
10
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
11
11
  local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
12
12
  local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
13
- local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
14
13
  local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
15
14
  local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
16
15
  local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
@@ -117,8 +116,7 @@ end
117
116
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedTrinketType", true)
118
117
  function ModdedElementDetection.prototype.getLastTrinketType(self)
119
118
  self:errorIfNoCallbacksFired("trinket")
120
- local numTrinketTypes = self:getNumTrinketTypes()
121
- return asTrinketType(nil, numTrinketTypes)
119
+ return itemConfig:GetTrinkets().Size - 1
122
120
  end
123
121
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
124
122
  function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
@@ -133,21 +131,16 @@ end
133
131
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
134
132
  function ModdedElementDetection.prototype.getNumTrinketTypes(self)
135
133
  self:errorIfNoCallbacksFired("trinket")
136
- return itemConfig:GetTrinkets().Size - 1
134
+ local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
135
+ return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes
137
136
  end
138
137
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumTrinketTypes", true)
139
138
  function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
140
- self:errorIfNoCallbacksFired("trinket")
141
- local numTrinketTypes = self:getNumTrinketTypes()
142
- return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES
143
- end
144
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
145
- function ModdedElementDetection.prototype.getTrinketTypes(self)
146
139
  self:errorIfNoCallbacksFired("trinket")
147
140
  local lastTrinketType = self:getLastTrinketType()
148
- return iRange(nil, FIRST_TRINKET_TYPE, lastTrinketType)
141
+ return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
149
142
  end
150
- __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getTrinketTypes", true)
143
+ __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
151
144
  function ModdedElementDetection.prototype.getAllCardTypes(self)
152
145
  self:errorIfNoCallbacksFired("card")
153
146
  local lastCardType = self:getLastCardType()
@@ -1,6 +1,7 @@
1
1
  import { CacheFlag, CardType, CollectibleType, ItemConfigCardType, ItemConfigTag, PlayerForm, TrinketType } from "isaac-typescript-definitions";
2
2
  import { Feature } from "../../private/Feature";
3
3
  export declare class ModdedElementSets extends Feature {
4
+ private arraysInitialized;
4
5
  private readonly allCollectibleTypesArray;
5
6
  private readonly allCollectibleTypesSet;
6
7
  private readonly vanillaCollectibleTypesArray;
@@ -36,6 +37,7 @@ export declare class ModdedElementSets extends Feature {
36
37
  */
37
38
  private readonly cardSet;
38
39
  private readonly moddedElementDetection;
40
+ private lazyInit;
39
41
  private lazyInitVanillaCollectibleTypes;
40
42
  private lazyInitModdedCollectibleTypes;
41
43
  private lazyInitVanillaTrinketTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mapp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;IASlB;;;;;;;;;;OAUG;IAEI,eAAe,IAAI,SAAS,WAAW,EAAE;IAKhD;;;;;;;;;;OAUG;IAEI,aAAa,IAAI,WAAW,CAAC,WAAW,CAAC;IAKhD;;;;;;;;OAQG;IAEI,wBAAwB,CAC7B,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,WAAW,CAAC;IAW3B;;;;;;;OAOG;IAEI,mBAAmB,IAAI,SAAS,QAAQ,EAAE;IAKjD;;;;;;;OAOG;IAEI,iBAAiB,IAAI,WAAW,CAAC,QAAQ,CAAC;IAKjD;;;;;;;OAOG;IAEI,0BAA0B,IAAI,SAAS,eAAe,EAAE;IAK/D;;;;;;;OAOG;IAEI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC;IAK/D;;;;;;;OAOG;IAEI,sBAAsB,IAAI,SAAS,WAAW,EAAE;IAKvD;;;;;;;OAOG;IAEI,oBAAoB,IAAI,WAAW,CAAC,WAAW,CAAC;CAIxD"}
@@ -82,6 +82,7 @@ ModdedElementSets.name = "ModdedElementSets"
82
82
  __TS__ClassExtends(ModdedElementSets, Feature)
83
83
  function ModdedElementSets.prototype.____constructor(self, moddedElementDetection)
84
84
  Feature.prototype.____constructor(self)
85
+ self.arraysInitialized = false
85
86
  self.allCollectibleTypesArray = {}
86
87
  self.allCollectibleTypesSet = __TS__New(Set)
87
88
  self.vanillaCollectibleTypesArray = {}
@@ -113,10 +114,26 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
113
114
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
114
115
  self.moddedElementDetection = moddedElementDetection
115
116
  end
116
- function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
117
- if #self.vanillaCollectibleTypesArray > 0 then
117
+ function ModdedElementSets.prototype.lazyInit(self)
118
+ if self.arraysInitialized then
118
119
  return
119
120
  end
121
+ self.arraysInitialized = true
122
+ self:lazyInitVanillaCollectibleTypes()
123
+ self:lazyInitModdedCollectibleTypes()
124
+ self:lazyInitVanillaTrinketTypes()
125
+ self:lazyInitModdedTrinketTypes()
126
+ self:lazyInitVanillaCardTypes()
127
+ self:lazyInitModdedCardTypes()
128
+ self:lazyInitTagToCollectibleTypesMap()
129
+ self:lazyInitCacheFlagToCollectibleTypesMap()
130
+ self:lazyInitCacheFlagToTrinketTypesMap()
131
+ self:lazyInitFlyingCollectibleTypesSet()
132
+ self:lazyInitFlyingTrinketTypesSet()
133
+ self:lazyInitEdenCollectibleTypesSet()
134
+ self:lazyInitCardTypes()
135
+ end
136
+ function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
120
137
  local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
121
138
  for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
122
139
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
@@ -128,10 +145,6 @@ function ModdedElementSets.prototype.lazyInitVanillaCollectibleTypes(self)
128
145
  end
129
146
  end
130
147
  function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
131
- if #self.moddedCollectibleTypesArray > 0 then
132
- return
133
- end
134
- self:lazyInitVanillaCollectibleTypes()
135
148
  for ____, collectibleType in ipairs(self.vanillaCollectibleTypesArray) do
136
149
  local ____self_allCollectibleTypesArray_1 = self.allCollectibleTypesArray
137
150
  ____self_allCollectibleTypesArray_1[#____self_allCollectibleTypesArray_1 + 1] = collectibleType
@@ -151,9 +164,6 @@ function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
151
164
  end
152
165
  end
153
166
  function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
154
- if #self.vanillaTrinketTypesArray > 0 then
155
- return
156
- end
157
167
  local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
158
168
  for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
159
169
  local itemConfigItem = itemConfig:GetTrinket(trinketType)
@@ -165,10 +175,6 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
165
175
  end
166
176
  end
167
177
  function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
168
- if #self.moddedTrinketTypesArray > 0 then
169
- return
170
- end
171
- self:lazyInitVanillaTrinketTypes()
172
178
  for ____, trinketType in ipairs(self.vanillaTrinketTypesArray) do
173
179
  local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
174
180
  ____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
@@ -188,9 +194,6 @@ function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
188
194
  end
189
195
  end
190
196
  function ModdedElementSets.prototype.lazyInitVanillaCardTypes(self)
191
- if #self.vanillaCardTypesArray > 0 then
192
- return
193
- end
194
197
  local vanillaCardTypes = getVanillaCardTypes(nil)
195
198
  for ____, cardType in ipairs(vanillaCardTypes) do
196
199
  local itemConfigCard = itemConfig:GetCard(cardType)
@@ -202,10 +205,6 @@ function ModdedElementSets.prototype.lazyInitVanillaCardTypes(self)
202
205
  end
203
206
  end
204
207
  function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
205
- if #self.moddedCardTypesArray > 0 then
206
- return
207
- end
208
- self:lazyInitVanillaCardTypes()
209
208
  for ____, cardType in ipairs(self.vanillaCardTypesArray) do
210
209
  local ____self_allCardTypesArray_9 = self.allCardTypesArray
211
210
  ____self_allCardTypesArray_9[#____self_allCardTypesArray_9 + 1] = cardType
@@ -225,9 +224,6 @@ function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
225
224
  end
226
225
  end
227
226
  function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
228
- if self.tagToCollectibleTypesMap.size > 0 then
229
- return
230
- end
231
227
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
232
228
  self.tagToCollectibleTypesMap:set(
233
229
  itemConfigTag,
@@ -238,7 +234,7 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
238
234
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
239
235
  do
240
236
  if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
241
- goto __continue44
237
+ goto __continue39
242
238
  end
243
239
  local collectibleTypesSet = self.tagToCollectibleTypesMap:get(itemConfigTag)
244
240
  if collectibleTypesSet == nil then
@@ -247,14 +243,11 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
247
243
  end
248
244
  collectibleTypesSet:add(collectibleType)
249
245
  end
250
- ::__continue44::
246
+ ::__continue39::
251
247
  end
252
248
  end
253
249
  end
254
250
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
255
- if self.cacheFlagToCollectibleTypesMap.size > 0 then
256
- return
257
- end
258
251
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
259
252
  local collectiblesSet = __TS__New(Set)
260
253
  for ____, collectibleType in ipairs(self:getCollectibleArray()) do
@@ -266,12 +259,9 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self
266
259
  end
267
260
  end
268
261
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
269
- if self.cacheFlagToTrinketTypesMap.size > 0 then
270
- return
271
- end
272
262
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
273
263
  local trinketsSet = __TS__New(Set)
274
- for ____, trinketType in ipairs(self.moddedElementDetection:getTrinketTypes()) do
264
+ for ____, trinketType in ipairs(self:getTrinketArray()) do
275
265
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
276
266
  trinketsSet:add(trinketType)
277
267
  end
@@ -280,9 +270,6 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
280
270
  end
281
271
  end
282
272
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
283
- if self.flyingCollectibleTypesSet.size > 0 then
284
- return
285
- end
286
273
  self.flyingCollectibleTypesSet = copySet(
287
274
  nil,
288
275
  self:getCollectiblesWithCacheFlag(CacheFlag.FLYING)
@@ -298,9 +285,6 @@ function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
298
285
  end
299
286
  end
300
287
  function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
301
- if self.flyingTrinketTypesSet.size > 0 then
302
- return
303
- end
304
288
  self.flyingTrinketTypesSet = copySet(
305
289
  nil,
306
290
  self:getTrinketsWithCacheFlag(CacheFlag.FLYING)
@@ -313,13 +297,10 @@ function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
313
297
  deleteSetsFromSet(nil, self.flyingTrinketTypesSet, trinketsWithAllCacheFlag)
314
298
  end
315
299
  function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
316
- if self.edenActiveCollectibleTypesSet.size > 0 then
317
- return
318
- end
319
300
  for ____, collectibleType in ipairs(self:getCollectibleArray()) do
320
301
  do
321
302
  if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
322
- goto __continue73
303
+ goto __continue63
323
304
  end
324
305
  if isActiveCollectible(nil, collectibleType) then
325
306
  self.edenActiveCollectibleTypesSet:add(collectibleType)
@@ -328,13 +309,10 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
328
309
  self.edenPassiveCollectibleTypesSet:add(collectibleType)
329
310
  end
330
311
  end
331
- ::__continue73::
312
+ ::__continue63::
332
313
  end
333
314
  end
334
315
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
335
- if self.itemConfigCardTypeToCardTypeMap.size > 0 then
336
- return
337
- end
338
316
  for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
339
317
  self.itemConfigCardTypeToCardTypeMap:set(
340
318
  itemConfigCardType,
@@ -358,20 +336,18 @@ function ModdedElementSets.prototype.lazyInitCardTypes(self)
358
336
  end
359
337
  end
360
338
  function ModdedElementSets.prototype.getCardArray(self)
361
- self:lazyInitModdedCardTypes()
339
+ self:lazyInit()
362
340
  return self.allCardTypesArray
363
341
  end
364
342
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardArray", true)
365
343
  function ModdedElementSets.prototype.getCardSet(self)
366
- self:lazyInitModdedCardTypes()
344
+ self:lazyInit()
367
345
  return self.allCardTypesSet
368
346
  end
369
347
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardSet", true)
370
348
  function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
371
349
  local itemConfigCardTypes = {...}
372
- if self.itemConfigCardTypeToCardTypeMap.size == 0 then
373
- self:lazyInitCardTypes()
374
- end
350
+ self:lazyInit()
375
351
  local matchingCardTypes = __TS__New(Set)
376
352
  for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
377
353
  local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
@@ -388,12 +364,12 @@ function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
388
364
  end
389
365
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
390
366
  function ModdedElementSets.prototype.getCollectibleArray(self)
391
- self:lazyInitModdedCollectibleTypes()
367
+ self:lazyInit()
392
368
  return self.allCollectibleTypesArray
393
369
  end
394
370
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleArray", true)
395
371
  function ModdedElementSets.prototype.getCollectibleSet(self)
396
- self:lazyInitModdedCollectibleTypes()
372
+ self:lazyInit()
397
373
  return self.allCollectibleTypesSet
398
374
  end
399
375
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleSet", true)
@@ -408,7 +384,7 @@ function ModdedElementSets.prototype.getCollectiblesForTransformation(self, play
408
384
  end
409
385
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesForTransformation", true)
410
386
  function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFlag)
411
- self:lazyInitCacheFlagToCollectibleTypesMap()
387
+ self:lazyInit()
412
388
  local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
413
389
  if collectiblesSet == nil then
414
390
  return __TS__New(ReadonlySet)
@@ -417,7 +393,7 @@ function ModdedElementSets.prototype.getCollectiblesWithCacheFlag(self, cacheFla
417
393
  end
418
394
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithCacheFlag", true)
419
395
  function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
420
- self:lazyInitTagToCollectibleTypesMap()
396
+ self:lazyInit()
421
397
  local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
422
398
  assertDefined(
423
399
  nil,
@@ -428,52 +404,52 @@ function ModdedElementSets.prototype.getCollectiblesWithTag(self, itemConfigTag)
428
404
  end
429
405
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectiblesWithTag", true)
430
406
  function ModdedElementSets.prototype.getEdenActiveCollectibles(self)
431
- self:lazyInitEdenCollectibleTypesSet()
407
+ self:lazyInit()
432
408
  return self.edenActiveCollectibleTypesSet
433
409
  end
434
410
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibles", true)
435
411
  function ModdedElementSets.prototype.getEdenPassiveCollectibles(self)
436
- self:lazyInitEdenCollectibleTypesSet()
412
+ self:lazyInit()
437
413
  return self.edenPassiveCollectibleTypesSet
438
414
  end
439
415
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibles", true)
440
416
  function ModdedElementSets.prototype.getFlyingCollectibles(self, includeConditionalItems)
441
- self:lazyInitFlyingCollectibleTypesSet()
417
+ self:lazyInit()
442
418
  return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
443
419
  end
444
420
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibles", true)
445
421
  function ModdedElementSets.prototype.getFlyingTrinkets(self)
446
- self:lazyInitFlyingTrinketTypesSet()
422
+ self:lazyInit()
447
423
  return self.flyingTrinketTypesSet
448
424
  end
449
425
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinkets", true)
450
426
  function ModdedElementSets.prototype.getModdedCardArray(self)
451
- self:lazyInitModdedCardTypes()
427
+ self:lazyInit()
452
428
  return self.moddedCardTypesArray
453
429
  end
454
430
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardArray", true)
455
431
  function ModdedElementSets.prototype.getModdedCardSet(self)
456
- self:lazyInitModdedCardTypes()
432
+ self:lazyInit()
457
433
  return self.moddedCardTypesSet
458
434
  end
459
435
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardSet", true)
460
436
  function ModdedElementSets.prototype.getModdedCollectibleArray(self)
461
- self:lazyInitModdedCollectibleTypes()
437
+ self:lazyInit()
462
438
  return self.moddedCollectibleTypesArray
463
439
  end
464
440
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleArray", true)
465
441
  function ModdedElementSets.prototype.getModdedCollectibleSet(self)
466
- self:lazyInitModdedCollectibleTypes()
442
+ self:lazyInit()
467
443
  return self.moddedCollectibleTypesSet
468
444
  end
469
445
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleSet", true)
470
446
  function ModdedElementSets.prototype.getModdedTrinketArray(self)
471
- self:lazyInitModdedTrinketTypes()
447
+ self:lazyInit()
472
448
  return self.moddedTrinketTypesArray
473
449
  end
474
450
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketArray", true)
475
451
  function ModdedElementSets.prototype.getModdedTrinketSet(self)
476
- self:lazyInitModdedTrinketTypes()
452
+ self:lazyInit()
477
453
  return self.moddedTrinketTypesSet
478
454
  end
479
455
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketSet", true)
@@ -572,7 +548,7 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
572
548
  if exceptions == nil then
573
549
  exceptions = {}
574
550
  end
575
- self:lazyInitCardTypes()
551
+ self:lazyInit()
576
552
  return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
577
553
  end
578
554
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
@@ -606,7 +582,7 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectible(self, seedOr
606
582
  if exceptions == nil then
607
583
  exceptions = {}
608
584
  end
609
- self:lazyInitEdenCollectibleTypesSet()
585
+ self:lazyInit()
610
586
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
611
587
  end
612
588
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectible", true)
@@ -617,22 +593,22 @@ function ModdedElementSets.prototype.getRandomEdenPassiveCollectible(self, seedO
617
593
  if exceptions == nil then
618
594
  exceptions = {}
619
595
  end
620
- self:lazyInitEdenCollectibleTypesSet()
596
+ self:lazyInit()
621
597
  return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
622
598
  end
623
599
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectible", true)
624
600
  function ModdedElementSets.prototype.getTrinketArray(self)
625
- self:lazyInitModdedTrinketTypes()
601
+ self:lazyInit()
626
602
  return self.allTrinketTypesArray
627
603
  end
628
604
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketArray", true)
629
605
  function ModdedElementSets.prototype.getTrinketSet(self)
630
- self:lazyInitModdedTrinketTypes()
606
+ self:lazyInit()
631
607
  return self.allTrinketTypesSet
632
608
  end
633
609
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketSet", true)
634
610
  function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
635
- self:lazyInitCacheFlagToTrinketTypesMap()
611
+ self:lazyInit()
636
612
  local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
637
613
  if trinketsSet == nil then
638
614
  return __TS__New(ReadonlySet)
@@ -641,32 +617,32 @@ function ModdedElementSets.prototype.getTrinketsWithCacheFlag(self, cacheFlag)
641
617
  end
642
618
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsWithCacheFlag", true)
643
619
  function ModdedElementSets.prototype.getVanillaCardArray(self)
644
- self:lazyInitVanillaCardTypes()
620
+ self:lazyInit()
645
621
  return self.vanillaCardTypesArray
646
622
  end
647
623
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardArray", true)
648
624
  function ModdedElementSets.prototype.getVanillaCardSet(self)
649
- self:lazyInitVanillaCardTypes()
625
+ self:lazyInit()
650
626
  return self.vanillaCardTypesSet
651
627
  end
652
628
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCardSet", true)
653
629
  function ModdedElementSets.prototype.getVanillaCollectibleArray(self)
654
- self:lazyInitVanillaCollectibleTypes()
630
+ self:lazyInit()
655
631
  return self.vanillaCollectibleTypesArray
656
632
  end
657
633
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleArray", true)
658
634
  function ModdedElementSets.prototype.getVanillaCollectibleSet(self)
659
- self:lazyInitVanillaCollectibleTypes()
635
+ self:lazyInit()
660
636
  return self.vanillaCollectibleTypesSet
661
637
  end
662
638
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaCollectibleSet", true)
663
639
  function ModdedElementSets.prototype.getVanillaTrinketArray(self)
664
- self:lazyInitVanillaTrinketTypes()
640
+ self:lazyInit()
665
641
  return self.vanillaTrinketTypesArray
666
642
  end
667
643
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketArray", true)
668
644
  function ModdedElementSets.prototype.getVanillaTrinketSet(self)
669
- self:lazyInitVanillaTrinketTypes()
645
+ self:lazyInit()
670
646
  return self.vanillaTrinketTypesSet
671
647
  end
672
648
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getVanillaTrinketSet", true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "38.0.1",
3
+ "version": "39.0.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -9,7 +9,6 @@ import { itemConfig } from "../../../core/cachedClasses";
9
9
  import {
10
10
  FIRST_CARD_TYPE,
11
11
  FIRST_PILL_EFFECT,
12
- FIRST_TRINKET_TYPE,
13
12
  LAST_VANILLA_CARD_TYPE,
14
13
  LAST_VANILLA_COLLECTIBLE_TYPE,
15
14
  LAST_VANILLA_PILL_EFFECT,
@@ -101,6 +100,9 @@ export class ModdedElementDetection extends Feature {
101
100
  * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
102
101
  * 666. We subtract one to account for `CollectibleType.NULL`.)
103
102
  *
103
+ * If there are no mods present that add any custom items, this function will return
104
+ * `CollectibleType.MOMS_RING` (732).
105
+ *
104
106
  * This function can only be called if at least one callback has been executed. This is because
105
107
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
106
108
  * order).
@@ -116,7 +118,7 @@ export class ModdedElementDetection extends Feature {
116
118
  }
117
119
 
118
120
  /**
119
- * Helper function to get an array that represents the all modded collectible types.
121
+ * Helper function to get an array that represents every modded collectible type.
120
122
  *
121
123
  * Returns an empty array if there are no modded collectible types.
122
124
  *
@@ -149,6 +151,10 @@ export class ModdedElementDetection extends Feature {
149
151
  }
150
152
 
151
153
  /**
154
+ * Returns the total number of collectibles in the item config, including both vanilla and modded
155
+ * items. If you just need the number of vanilla collectible types, use the
156
+ * `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
157
+ *
152
158
  * This function can only be called if at least one callback has been executed. This is because
153
159
  * not all collectibles will necessarily be present when a mod first loads (due to mod load
154
160
  * order).
@@ -209,8 +215,11 @@ export class ModdedElementDetection extends Feature {
209
215
  /**
210
216
  * Will change depending on how many modded trinkets there are.
211
217
  *
212
- * This is equal to the number of trinket types, since all trinket types are contiguous (unlike
213
- * collectibles).
218
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
219
+ * subtract one to account for `TrinketType.NULL`.)
220
+ *
221
+ * If there are no mods present that add any custom trinkets, this function will return
222
+ * `TrinketType.SIGIL_OF_BAPHOMET` (189).
214
223
  *
215
224
  * This function can only be called if at least one callback has been executed. This is because
216
225
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -222,8 +231,7 @@ export class ModdedElementDetection extends Feature {
222
231
  public getLastTrinketType(): TrinketType {
223
232
  this.errorIfNoCallbacksFired("trinket");
224
233
 
225
- const numTrinketTypes = this.getNumTrinketTypes();
226
- return asTrinketType(numTrinketTypes);
234
+ return itemConfig.GetTrinkets().Size - 1;
227
235
  }
228
236
 
229
237
  /**
@@ -231,9 +239,11 @@ export class ModdedElementDetection extends Feature {
231
239
  *
232
240
  * Returns an empty array if there are no modded trinket types.
233
241
  *
234
- * This function is only useful when building collectible type objects. For most purposes, you
235
- * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
236
- * instead.
242
+ * This function is only useful when building trinket type objects. For most purposes, you should
243
+ * use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
244
+ *
245
+ * (This function is named differently from the `getVanillaTrinketTypeRange` function because all
246
+ * modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
237
247
  *
238
248
  * This function can only be called if at least one callback has been executed. This is because
239
249
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -255,10 +265,9 @@ export class ModdedElementDetection extends Feature {
255
265
  }
256
266
 
257
267
  /**
258
- * Will change depending on how many modded trinkets there are.
259
- *
260
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
261
- * `TrinketType.NULL`.)
268
+ * Returns the total number of trinkets in the item config, including both vanilla and modded
269
+ * items. If you just need the number of vanilla trinket types, use the
270
+ * `NUM_VANILLA_TRINKET_TYPES` constant.
262
271
  *
263
272
  * This function can only be called if at least one callback has been executed. This is because
264
273
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -270,26 +279,12 @@ export class ModdedElementDetection extends Feature {
270
279
  public getNumTrinketTypes(): int {
271
280
  this.errorIfNoCallbacksFired("trinket");
272
281
 
273
- return itemConfig.GetTrinkets().Size - 1;
274
- }
275
-
276
- /**
277
- * This function can only be called if at least one callback has been executed. This is because
278
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
279
- *
280
- * In order to use this function, you must upgrade your mod with
281
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
282
- */
283
- @Exported
284
- public getNumModdedTrinketTypes(): int {
285
- this.errorIfNoCallbacksFired("trinket");
286
-
287
- const numTrinketTypes = this.getNumTrinketTypes();
288
- return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES;
282
+ const numModdedTrinketTypes = this.getNumModdedTrinketTypes();
283
+ return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes;
289
284
  }
290
285
 
291
286
  /**
292
- * Helper function to get an array that contains every trinket type.
287
+ * Unlike vanilla trinket types, modded trinket types are always contiguous.
293
288
  *
294
289
  * This function can only be called if at least one callback has been executed. This is because
295
290
  * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
@@ -298,11 +293,11 @@ export class ModdedElementDetection extends Feature {
298
293
  * `ISCFeature.MODDED_ELEMENT_DETECTION`.
299
294
  */
300
295
  @Exported
301
- public getTrinketTypes(): TrinketType[] {
296
+ public getNumModdedTrinketTypes(): int {
302
297
  this.errorIfNoCallbacksFired("trinket");
303
298
 
304
299
  const lastTrinketType = this.getLastTrinketType();
305
- return iRange(FIRST_TRINKET_TYPE, lastTrinketType);
300
+ return lastTrinketType - LAST_VANILLA_TRINKET_TYPE;
306
301
  }
307
302
 
308
303
  // -----