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,36 +1,43 @@
1
+ import type { PillEffect } from "isaac-typescript-definitions";
1
2
  import { CacheFlag, CardType, CollectibleType, ItemConfigCardType, ItemConfigTag, PlayerForm, TrinketType } from "isaac-typescript-definitions";
2
3
  import { Feature } from "../../private/Feature";
4
+ /**
5
+ * A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded
6
+ * elements. This is useful for performance purposes (so that we do not have to reconstruct the
7
+ * arrays/sets multiple times).
8
+ *
9
+ * The modded arrays/sets are created using the functions from
10
+ * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11
+ */
3
12
  export declare class ModdedElementSets extends Feature {
4
13
  private arraysInitialized;
5
14
  private readonly allCollectibleTypesArray;
6
15
  private readonly allCollectibleTypesSet;
7
- private readonly vanillaCollectibleTypesArray;
8
- private readonly vanillaCollectibleTypesSet;
9
16
  private readonly moddedCollectibleTypesArray;
10
17
  private readonly moddedCollectibleTypesSet;
11
18
  private readonly allTrinketTypesArray;
12
19
  private readonly allTrinketTypesSet;
13
- private readonly vanillaTrinketTypesArray;
14
- private readonly vanillaTrinketTypesSet;
15
20
  private readonly moddedTrinketTypesArray;
16
21
  private readonly moddedTrinketTypesSet;
17
22
  private readonly allCardTypesArray;
18
23
  private readonly allCardTypesSet;
19
- private readonly vanillaCardTypesArray;
20
- private readonly vanillaCardTypesSet;
21
24
  private readonly moddedCardTypesArray;
22
25
  private readonly moddedCardTypesSet;
23
- private readonly tagToCollectibleTypesMap;
26
+ private readonly allPillEffectsArray;
27
+ private readonly allPillEffectsSet;
28
+ private readonly moddedPillEffectsArray;
29
+ private readonly moddedPillEffectsSet;
24
30
  private readonly cacheFlagToCollectibleTypesMap;
25
31
  private readonly cacheFlagToTrinketTypesMap;
26
32
  private flyingCollectibleTypesSet;
27
33
  private readonly permanentFlyingCollectibleTypesSet;
28
34
  private flyingTrinketTypesSet;
35
+ private readonly tagToCollectibleTypesMap;
29
36
  private readonly edenActiveCollectibleTypesSet;
30
37
  private readonly edenPassiveCollectibleTypesSet;
31
38
  private readonly itemConfigCardTypeToCardTypeMap;
32
39
  /**
33
- * The set of cards that are not:
40
+ * The set of card types that are not:
34
41
  *
35
42
  * - ItemConfigCardType.RUNE
36
43
  * - ItemConfigCardType.SPECIAL_OBJECT
@@ -38,12 +45,10 @@ export declare class ModdedElementSets extends Feature {
38
45
  private readonly cardSet;
39
46
  private readonly moddedElementDetection;
40
47
  private lazyInit;
41
- private lazyInitVanillaCollectibleTypes;
42
48
  private lazyInitModdedCollectibleTypes;
43
- private lazyInitVanillaTrinketTypes;
44
49
  private lazyInitModdedTrinketTypes;
45
- private lazyInitVanillaCardTypes;
46
50
  private lazyInitModdedCardTypes;
51
+ private lazyInitModdedPillEffects;
47
52
  private lazyInitTagToCollectibleTypesMap;
48
53
  private lazyInitCacheFlagToCollectibleTypesMap;
49
54
  private lazyInitCacheFlagToTrinketTypesMap;
@@ -52,250 +57,246 @@ export declare class ModdedElementSets extends Feature {
52
57
  private lazyInitEdenCollectibleTypesSet;
53
58
  private lazyInitCardTypes;
54
59
  /**
55
- * Returns an array containing every valid card type in the game, including modded cards.
56
- *
57
- * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
58
- * use the `getCardSet` helper function instead.
59
- *
60
- * This function can only be called if at least one callback has been executed. This is because
61
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
62
- *
63
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
64
- */
65
- getCardArray(): readonly CardType[];
66
- /**
67
- * Returns a set containing every valid card type in the game, including modded cards.
60
+ * Returns an array containing every valid collectible type in the game, including modded
61
+ * collectibles.
68
62
  *
69
- * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
70
- * use the `getCardArray` helper function instead.
63
+ * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
64
+ * then use the `getCollectibleTypesSet` helper function instead.
71
65
  *
72
66
  * This function can only be called if at least one callback has been executed. This is because
73
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
67
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
68
+ * order).
74
69
  *
75
70
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
76
71
  */
77
- getCardSet(): ReadonlySet<CardType>;
72
+ getCollectibleTypes(): readonly CollectibleType[];
78
73
  /**
79
- * Helper function to get a set of card types matching the `ItemConfigCardType`.
74
+ * Returns a set containing every valid collectible type in the game, including modded
75
+ * collectibles.
80
76
  *
81
- * This function is variadic, meaning that you can you can specify N card types to get a set
82
- * containing cards that match any of the specified types.
77
+ * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
78
+ * then use the `getCollectibleTypes` helper function instead.
83
79
  *
84
80
  * This function can only be called if at least one callback has been executed. This is because
85
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
81
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
82
+ * order).
86
83
  *
87
84
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
88
85
  */
89
- getCardTypesOfType(...itemConfigCardTypes: ItemConfigCardType[]): Set<CardType>;
86
+ getCollectibleTypeSet(): ReadonlySet<CollectibleType>;
90
87
  /**
91
- * Returns an array containing every valid collectible type in the game, including modded
92
- * collectibles.
88
+ * Returns an array containing every modded collectible type in the game.
93
89
  *
94
90
  * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
95
- * then use the `getCollectibleSet` helper function instead.
91
+ * then use the `getModdedCollectibleTypesSet` helper function instead.
96
92
  *
97
93
  * This function can only be called if at least one callback has been executed. This is because
98
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
94
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
99
95
  * order).
100
96
  *
101
97
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
102
98
  */
103
- getCollectibleArray(): readonly CollectibleType[];
99
+ getModdedCollectibleTypes(): readonly CollectibleType[];
104
100
  /**
105
- * Returns a set containing every valid collectible type in the game, including modded
106
- * collectibles.
101
+ * Returns a set containing every modded collectible type in the game.
107
102
  *
108
103
  * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
109
- * then use the `getCollectibleArray` helper function instead.
104
+ * then use the `getModdedCollectibleTypes` helper function instead.
110
105
  *
111
106
  * This function can only be called if at least one callback has been executed. This is because
112
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
107
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
113
108
  * order).
114
109
  *
115
110
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
116
111
  */
117
- getCollectibleSet(): ReadonlySet<CollectibleType>;
112
+ getModdedCollectibleTypesSet(): ReadonlySet<CollectibleType>;
118
113
  /**
119
- * Helper function to get all of the collectible types in the game that count towards a particular
120
- * transformation.
121
- *
122
- * For example, to get all of the collectible types that count towards Guppy:
114
+ * Iterates over every collectible in the game and returns a map containing the number of each
115
+ * item that the player has.
123
116
  *
124
- * ```ts
125
- * const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY);
126
- * ```
117
+ * Note that this will filter out non-real collectibles like Lilith's Incubus.
127
118
  *
128
119
  * This function can only be called if at least one callback has been executed. This is because
129
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
120
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
130
121
  * order).
131
122
  *
132
123
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
133
124
  */
134
- getCollectiblesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
125
+ getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
135
126
  /**
136
- * Returns a set containing every collectible type with the given cache flag, including modded
137
- * collectibles.
127
+ * Returns an array containing every modded trinket type in the game.
138
128
  *
139
- * This function can only be called if at least one callback has been executed. This is because
140
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
141
- * order).
129
+ * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
130
+ * then use the `getModdedTrinketTypesSet` helper function instead.
142
131
  *
143
132
  * This function can only be called if at least one callback has been executed. This is because
144
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
133
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
145
134
  * order).
146
135
  *
147
136
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
148
137
  */
149
- getCollectiblesWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
138
+ getTrinketTypes(): readonly TrinketType[];
150
139
  /**
151
- * Returns a set containing every collectible type with the given tag.
152
- *
153
- * For example, to get all of the collectible types that count as offensive for the purposes of
154
- * Tainted Lost:
140
+ * Returns a set containing every modded trinket type in the game.
155
141
  *
156
- * ```ts
157
- * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
158
- * ```
142
+ * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
143
+ * then use the `getModdedTrinketTypes` helper function instead.
159
144
  *
160
145
  * This function can only be called if at least one callback has been executed. This is because
161
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
146
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
162
147
  * order).
163
148
  *
164
149
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
165
150
  */
166
- getCollectiblesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
151
+ getTrinketTypesSet(): ReadonlySet<TrinketType>;
167
152
  /**
168
- * Returns a set containing every valid passive item that can be randomly granted to Eden as a
169
- * starting item.
153
+ * Returns an array containing every modded trinket type in the game.
154
+ *
155
+ * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
156
+ * then use the `getModdedTrinketTypesSet` helper function instead.
170
157
  *
171
158
  * This function can only be called if at least one callback has been executed. This is because
172
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
159
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
173
160
  * order).
174
161
  *
175
162
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
176
163
  */
177
- getEdenActiveCollectibles(): ReadonlySet<CollectibleType>;
164
+ getModdedTrinketTypes(): readonly TrinketType[];
178
165
  /**
179
- * Returns a set containing every valid passive item that can be randomly granted to Eden as a
180
- * starting item.
166
+ * Returns a set containing every modded trinket type in the game.
167
+ *
168
+ * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
169
+ * then use the `getModdedTrinketTypes` helper function instead.
181
170
  *
182
171
  * This function can only be called if at least one callback has been executed. This is because
183
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
172
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
184
173
  * order).
185
174
  *
186
175
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
187
176
  */
188
- getEdenPassiveCollectibles(): ReadonlySet<CollectibleType>;
177
+ getModdedTrinketTypesSet(): ReadonlySet<TrinketType>;
189
178
  /**
190
- * Returns a set of all of the collectibles that grant flight. This is derived from collectibles
191
- * that have `CacheFlag.FLYING` set in the "items.xml" file.
179
+ * Returns an array containing every valid card type in the game, including modded cards.
192
180
  *
193
- * Collectibles that only grant flight conditionally are manually pruned. Collectibles such as
194
- * Empty Vessel should be checked for via the `hasFlyingTemporaryEffect` function.
181
+ * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
182
+ * use the `getCardTypesSet` helper function instead.
195
183
  *
196
184
  * This function can only be called if at least one callback has been executed. This is because
197
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
198
- * order).
185
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
199
186
  *
200
187
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
201
- *
202
- * @param includeConditionalItems Whether collectibles that only grant flight conditionally should
203
- * be included in the set (like Empty Vessel).
204
188
  */
205
- getFlyingCollectibles(includeConditionalItems: boolean): ReadonlySet<CollectibleType>;
189
+ getCardTypes(): readonly CardType[];
206
190
  /**
207
- * Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
208
- * conditionally, like Bat Wing and Azazel's Stump.)
191
+ * Returns a set containing every valid card type in the game, including modded cards.
192
+ *
193
+ * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
194
+ * use the `getCardTypes` helper function instead.
209
195
  *
210
196
  * This function can only be called if at least one callback has been executed. This is because
211
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
197
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
212
198
  *
213
199
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
214
200
  */
215
- getFlyingTrinkets(): ReadonlySet<TrinketType>;
201
+ getCardTypesSet(): ReadonlySet<CardType>;
216
202
  /**
217
203
  * Returns an array containing every modded card type in the game.
218
204
  *
219
205
  * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
220
- * use the `getModdedCardSet` helper function instead.
206
+ * use the `getModdedCardTypesSet` helper function instead.
221
207
  *
222
208
  * This function can only be called if at least one callback has been executed. This is because
223
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
209
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
224
210
  *
225
211
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
226
212
  */
227
- getModdedCardArray(): readonly CardType[];
213
+ getModdedCardTypes(): readonly CardType[];
228
214
  /**
229
215
  * Returns a set containing every modded card type in the game.
230
216
  *
231
217
  * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
232
- * use the `getModdedCardArray` helper function instead.
218
+ * use the `getModdedCardTypes` helper function instead.
233
219
  *
234
220
  * This function can only be called if at least one callback has been executed. This is because
235
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
221
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
236
222
  *
237
223
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
238
224
  */
239
- getModdedCardSet(): ReadonlySet<CardType>;
225
+ getModdedCardTypesSet(): ReadonlySet<CardType>;
240
226
  /**
241
- * Returns an array containing every modded collectible type in the game.
227
+ * Returns an array containing every valid pill effect in the game, including modded pill effects.
242
228
  *
243
- * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
244
- * then use the `getModdedCollectibleSet` helper function instead.
229
+ * Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
230
+ * then use the `getPillEffectSet` helper function instead.
245
231
  *
246
232
  * This function can only be called if at least one callback has been executed. This is because
247
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
233
+ * not all pill effects will necessarily be present when a mod first loads (due to mod load
248
234
  * order).
249
235
  *
250
236
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
251
237
  */
252
- getModdedCollectibleArray(): readonly CollectibleType[];
238
+ getPillEffects(): readonly PillEffect[];
253
239
  /**
254
- * Returns a set containing every modded collectible type in the game.
240
+ * Returns a set containing every valid pill effect in the game, including modded pill effects.
255
241
  *
256
- * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
257
- * then use the `getModdedCollectibleArray` helper function instead.
242
+ * Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
243
+ * then use the `getPillEffects` helper function instead.
258
244
  *
259
245
  * This function can only be called if at least one callback has been executed. This is because
260
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
246
+ * not all pill effects will necessarily be present when a mod first loads (due to mod load
261
247
  * order).
262
248
  *
263
249
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
264
250
  */
265
- getModdedCollectibleSet(): ReadonlySet<CollectibleType>;
251
+ getPillEffectsSet(): ReadonlySet<PillEffect>;
266
252
  /**
267
- * Returns an array containing every modded trinket type in the game.
253
+ * Returns an array containing every modded pill effect in the game.
268
254
  *
269
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
270
- * then use the `getModdedTrinketSet` helper function instead.
255
+ * Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
256
+ * then use the `getModdedPillEffectsSet` helper function instead.
271
257
  *
272
258
  * This function can only be called if at least one callback has been executed. This is because
273
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
259
+ * not all pill effects will necessarily be present when a mod first loads (due to mod load
260
+ * order).
274
261
  *
275
262
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
276
263
  */
277
- getModdedTrinketArray(): readonly TrinketType[];
264
+ getModdedPillEffects(): readonly PillEffect[];
278
265
  /**
279
- * Returns a set containing every modded trinket type in the game.
266
+ * Returns a set containing every modded pill effect in the game.
280
267
  *
281
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
282
- * then use the `getModdedTrinketArray` helper function instead.
268
+ * Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
269
+ * then use the `getModdedPillEffects` helper function instead.
283
270
  *
284
271
  * This function can only be called if at least one callback has been executed. This is because
285
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
272
+ * not all pill effects will necessarily be present when a mod first loads (due to mod load
273
+ * order).
286
274
  *
287
275
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
288
276
  */
289
- getModdedTrinketSet(): ReadonlySet<TrinketType>;
277
+ getModdedPillEffectsSet(): ReadonlySet<PillEffect>;
290
278
  /**
291
- * Iterates over every item in the game and returns a map containing the number of each item that
292
- * the player has.
279
+ * Returns a set containing every collectible type with the given cache flag, including modded
280
+ * collectibles.
293
281
  *
294
- * Note that this will filter out non-real collectibles like Lilith's Incubus.
282
+ * This function can only be called if at least one callback has been executed. This is because
283
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
284
+ * order).
295
285
  *
296
286
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
297
287
  */
298
- getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
288
+ getCollectibleTypesWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
289
+ /**
290
+ * Returns a set containing every trinket type with the given cache flag, including modded
291
+ * trinkets.
292
+ *
293
+ * This function can only be called if at least one callback has been executed. This is because
294
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
295
+ * order).
296
+ *
297
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
298
+ */
299
+ getTrinketsTypesWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<TrinketType>;
299
300
  /**
300
301
  * Returns an array containing every collectible type that the player has that matches the
301
302
  * provided `CacheFlag`.
@@ -315,186 +316,225 @@ export declare class ModdedElementSets extends Feature {
315
316
  * Lilith's Incubus.
316
317
  *
317
318
  * This function can only be called if at least one callback has been executed. This is because
318
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
319
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
319
320
  * order).
320
321
  *
321
322
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
322
323
  */
323
324
  getPlayerCollectiblesWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): CollectibleType[];
324
- /**
325
- * Returns the number of items that a player has towards a particular transformation.
326
- *
327
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
328
- */
329
- getPlayerCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): CollectibleType[];
330
- /**
331
- * Returns the number of items that a player has towards a particular transformation.
332
- *
333
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
334
- */
335
- getPlayerCollectiblesForTransformation(player: EntityPlayer, playerForm: PlayerForm): CollectibleType[];
336
325
  /**
337
326
  * Returns a map containing every trinket type that the player has that matches the provided
338
327
  * `CacheFlag`. The values of the map correspond to the multiplier for that trinket.
339
328
  *
340
329
  * This function can only be called if at least one callback has been executed. This is because
341
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
330
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
331
+ * order).
342
332
  *
343
333
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
344
334
  */
345
335
  getPlayerTrinketsWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): Map<TrinketType, int>;
346
336
  /**
347
- * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
337
+ * Returns a set of all of the collectibles that grant flight. This is derived from collectibles
338
+ * that have `CacheFlag.FLYING` set in the "items.xml" file.
348
339
  *
349
- * This will not return:
350
- * - any runes
351
- * - any objects like Dice Shard
340
+ * Vanilla collectibles that only grant flight conditionally are manually pruned. Collectibles
341
+ * such as Empty Vessel should be checked for via the `hasFlyingTemporaryEffect` function.
342
+ *
343
+ * Under the hood, this is determined by looking at the collectibles that have `CacheFlag.FLYING`
344
+ * and excluding the ones that have `CacheFlag.ALL`. (None of the collectibles with
345
+ * `CacheFlag.ALL` grant flying, including all of the 3 Dollar Bill collectibles and all of the
346
+ * Birthright effects.)
347
+ *
348
+ * This function can only be called if at least one callback has been executed. This is because
349
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
350
+ * order).
352
351
  *
353
352
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
354
353
  *
355
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
356
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
357
- * @param exceptions Optional. An array of cards to not select.
354
+ * @param includeConditionalItems Whether collectibles that only grant flight conditionally should
355
+ * be included in the set (like Empty Vessel).
358
356
  */
359
- getRandomCard(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
357
+ getFlyingCollectibleTypes(includeConditionalItems: boolean): ReadonlySet<CollectibleType>;
360
358
  /**
361
- * Helper function to get a random card type that matches the provided `ItemConfigCardType`.
359
+ * Returns a set of all of the trinkets that grant flight. (All vanilla trinkets that grant flight
360
+ * do so conditionally, like Bat Wing and Azazel's Stump.)
362
361
  *
363
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
362
+ * Under the hood, this is determined by looking at the trinkets that have `CacheFlag.FLYING` and
363
+ * excluding the ones that have `CacheFlag.ALL`. (None of the trinket with `CacheFlag.ALL` grant
364
+ * flying except for Azazel's Stump.)
364
365
  *
365
- * @param itemConfigCardType The item config card type that represents the pool of cards to select
366
- * from.
367
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
368
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
369
- * @param exceptions Optional. An array of cards to not select.
366
+ * This function can only be called if at least one callback has been executed. This is because
367
+ * not all trinket types will necessarily be present when a mod first loads (due to mod load
368
+ * order).
369
+ *
370
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
370
371
  */
371
- getRandomCardTypeOfType(itemConfigCardType: ItemConfigCardType, seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
372
+ getFlyingTrinketTypes(): ReadonlySet<TrinketType>;
372
373
  /**
373
- * Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul
374
- * of Isaac, etc.). This will never return a Rune Shard.
374
+ * Returns a set containing every collectible type with the given tag.
375
375
  *
376
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
376
+ * For example, to get all of the collectible types that count as offensive for the purposes of
377
+ * Tainted Lost:
377
378
  *
378
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
379
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
380
- * @param exceptions Optional. An array of runes to not select.
379
+ * ```ts
380
+ * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
381
+ * ```
382
+ *
383
+ * This function can only be called if at least one callback has been executed. This is because
384
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
385
+ * order).
386
+ *
387
+ * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
381
388
  */
382
- getRandomRune(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
389
+ getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
383
390
  /**
384
- * Returns a random active collectible type that that is a valid starting item for Eden.
391
+ * Returns the number of items that a player has towards a particular transformation.
385
392
  *
386
393
  * This function can only be called if at least one callback has been executed. This is because
387
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
394
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
388
395
  * order).
389
396
  *
390
397
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
391
- *
392
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
393
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
394
- * @param exceptions Optional. An array of runes to not select.
395
398
  */
396
- getRandomEdenActiveCollectible(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
399
+ getPlayerCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): CollectibleType[];
397
400
  /**
398
- * Returns a random passive collectible type that that is a valid starting item for Eden.
401
+ * Helper function to get all of the collectible types in the game that count towards a particular
402
+ * transformation.
403
+ *
404
+ * For example, to get all of the collectible types that count towards Guppy:
405
+ *
406
+ * ```ts
407
+ * const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY);
408
+ * ```
399
409
  *
400
410
  * This function can only be called if at least one callback has been executed. This is because
401
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
411
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
402
412
  * order).
403
413
  *
404
414
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
405
- *
406
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
407
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
408
- * @param exceptions Optional. An array of runes to not select.
409
415
  */
410
- getRandomEdenPassiveCollectible(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
416
+ getCollectibleTypesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
411
417
  /**
412
- * Returns an array containing every modded trinket type in the game.
413
- *
414
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
415
- * then use the `getModdedTrinketSet` helper function instead.
418
+ * Returns the number of items that a player has towards a particular transformation.
416
419
  *
417
420
  * This function can only be called if at least one callback has been executed. This is because
418
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
421
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
422
+ * order).
419
423
  *
420
424
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
421
425
  */
422
- getTrinketArray(): readonly TrinketType[];
426
+ getPlayerCollectiblesForTransformation(player: EntityPlayer, playerForm: PlayerForm): CollectibleType[];
423
427
  /**
424
- * Returns a set containing every modded trinket type in the game.
428
+ * Returns a set containing every valid passive item that can be randomly granted to Eden as a
429
+ * starting item.
425
430
  *
426
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
427
- * then use the `getModdedTrinketArray` helper function instead.
431
+ * Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml".
428
432
  *
429
433
  * This function can only be called if at least one callback has been executed. This is because
430
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
434
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
435
+ * order).
431
436
  *
432
437
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
433
438
  */
434
- getTrinketSet(): ReadonlySet<TrinketType>;
439
+ getEdenActiveCollectibleTypes(): ReadonlySet<CollectibleType>;
435
440
  /**
436
- * Returns a set containing every trinket type with the given cache flag, including modded
437
- * trinkets.
441
+ * Returns a set containing every valid passive item that can be randomly granted to Eden as a
442
+ * starting item.
443
+ *
444
+ * Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml".
438
445
  *
439
446
  * This function can only be called if at least one callback has been executed. This is because
440
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
447
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
448
+ * order).
441
449
  *
442
450
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
443
451
  */
444
- getTrinketsWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<TrinketType>;
452
+ getEdenPassiveCollectibleTypes(): ReadonlySet<CollectibleType>;
445
453
  /**
446
- * Returns an array containing every valid vanilla card type in the game.
454
+ * Returns a random active collectible type that that is a valid starting item for Eden.
447
455
  *
448
- * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
449
- * use the `getVanillaCardSet` helper function instead.
456
+ * This function can only be called if at least one callback has been executed. This is because
457
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
458
+ * order).
450
459
  *
451
460
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
461
+ *
462
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
463
+ * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
464
+ * @param exceptions Optional. An array of runes to not select.
452
465
  */
453
- getVanillaCardArray(): readonly CardType[];
466
+ getRandomEdenActiveCollectibleType(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
454
467
  /**
455
- * Returns a set containing every valid vanilla card type in the game.
468
+ * Returns a random passive collectible type that that is a valid starting item for Eden.
456
469
  *
457
- * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
458
- * use the `getVanillaCardArray` helper function instead.
470
+ * This function can only be called if at least one callback has been executed. This is because
471
+ * not all collectible types will necessarily be present when a mod first loads (due to mod load
472
+ * order).
459
473
  *
460
474
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
475
+ *
476
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
477
+ * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
478
+ * @param exceptions Optional. An array of runes to not select.
461
479
  */
462
- getVanillaCardSet(): ReadonlySet<CardType>;
480
+ getRandomEdenPassiveCollectibleType(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
463
481
  /**
464
- * Returns an array containing every valid vanilla collectible type in the game.
482
+ * Helper function to get a set of card types matching the `ItemConfigCardType`.
465
483
  *
466
- * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
467
- * then use the `getVanillaCollectibleSet` helper function instead.
484
+ * This function is variadic, meaning that you can you can specify N card types to get a set
485
+ * containing cards that match any of the specified types.
486
+ *
487
+ * This function can only be called if at least one callback has been executed. This is because
488
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
468
489
  *
469
490
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
470
491
  */
471
- getVanillaCollectibleArray(): readonly CollectibleType[];
492
+ getCardTypesOfType(...itemConfigCardTypes: ItemConfigCardType[]): Set<CardType>;
472
493
  /**
473
- * Returns a set containing every valid vanilla collectible type in the game.
494
+ * Helper function to get a random card type that matches the provided `ItemConfigCardType`.
474
495
  *
475
- * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
476
- * then use the `getVanillaCollectibleArray` helper function instead.
496
+ * This function can only be called if at least one callback has been executed. This is because
497
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
477
498
  *
478
499
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
500
+ *
501
+ * @param itemConfigCardType The item config card type that represents the pool of cards to select
502
+ * from.
503
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
504
+ * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
505
+ * @param exceptions Optional. An array of cards to not select.
479
506
  */
480
- getVanillaCollectibleSet(): ReadonlySet<CollectibleType>;
507
+ getRandomCardTypeOfType(itemConfigCardType: ItemConfigCardType, seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
481
508
  /**
482
- * Returns an array containing every valid vanilla trinket type in the game.
509
+ * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
483
510
  *
484
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
485
- * then use the `getVanillaTrinketSet` helper function instead.
511
+ * This will not return:
512
+ * - any runes
513
+ * - any objects like Dice Shard
514
+ *
515
+ * This function can only be called if at least one callback has been executed. This is because
516
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
486
517
  *
487
518
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
519
+ *
520
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
521
+ * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
522
+ * @param exceptions Optional. An array of cards to not select.
488
523
  */
489
- getVanillaTrinketArray(): readonly TrinketType[];
524
+ getRandomCard(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
490
525
  /**
491
- * Returns a set containing every valid vanilla trinket type in the game.
526
+ * Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul
527
+ * of Isaac, etc.). This will never return a Rune Shard.
492
528
  *
493
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
494
- * then use the `getVanillaTrinketArray` helper function instead.
529
+ * This function can only be called if at least one callback has been executed. This is because
530
+ * not all card types will necessarily be present when a mod first loads (due to mod load order).
495
531
  *
496
532
  * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
533
+ *
534
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
535
+ * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
536
+ * @param exceptions Optional. An array of runes to not select.
497
537
  */
498
- getVanillaTrinketSet(): ReadonlySet<TrinketType>;
538
+ getRandomRune(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
499
539
  }
500
540
  //# sourceMappingURL=ModdedElementSets.d.ts.map