Modded Element Sets
A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded elements. This is useful for performance purposes (so that we do not have to reconstruct the arrays/sets multiple times).
The modded arrays/sets are created using the functions from
ISCFeature.MODDED_ELEMENT_DETECTION
.
Hierarchy
-
Feature
↳
ModdedElementSets
Methods
getCollectibleTypes
▸ getCollectibleTypes(): readonly CollectibleType
[]
Returns an array containing every valid collectible type in the game, including modded collectibles.
Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
then use the getCollectibleTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:494
getCollectibleTypeSet
▸ getCollectibleTypeSet(): ReadonlySet
<CollectibleType
>
Returns a set containing every valid collectible type in the game, including modded collectibles.
Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
then use the getCollectibleTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CollectibleType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:515
getModdedCollectibleTypes
▸ getModdedCollectibleTypes(): readonly CollectibleType
[]
Returns an array containing every modded collectible type in the game.
Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
then use the getModdedCollectibleTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:535
getModdedCollectibleTypesSet
▸ getModdedCollectibleTypesSet(): ReadonlySet
<CollectibleType
>
Returns a set containing every modded collectible type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
then use the getModdedCollectibleTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CollectibleType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:555
getPlayerCollectibleMap
▸ getPlayerCollectibleMap(player
): Map
<CollectibleType
, int
>
Iterates over every collectible in the game and returns a map containing the number of each item that the player has.
Note that this will filter out non-real collectibles like Lilith's Incubus.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
Returns
Map
<CollectibleType
, int
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:575
getTrinketTypes
▸ getTrinketTypes(): readonly TrinketType
[]
Returns an array containing every modded trinket type in the game.
Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
then use the getModdedTrinketTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly TrinketType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:632
getTrinketTypesSet
▸ getTrinketTypesSet(): ReadonlySet
<TrinketType
>
Returns a set containing every modded trinket type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
then use the getModdedTrinketTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<TrinketType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:652
getModdedTrinketTypes
▸ getModdedTrinketTypes(): readonly TrinketType
[]
Returns an array containing every modded trinket type in the game.
Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
then use the getModdedTrinketTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly TrinketType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:672
getModdedTrinketTypesSet
▸ getModdedTrinketTypesSet(): ReadonlySet
<TrinketType
>
Returns a set containing every modded trinket type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
then use the getModdedTrinketTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<TrinketType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:692
getCardTypes
▸ getCardTypes(): readonly CardType
[]
Returns an array containing every valid card type in the game, including modded cards.
Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
use the getCardTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly CardType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:715
getCardTypesSet
▸ getCardTypesSet(): ReadonlySet
<CardType
>
Returns a set containing every valid card type in the game, including modded cards.
Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
use the getCardTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CardType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:734
getModdedCardTypes
▸ getModdedCardTypes(): readonly CardType
[]
Returns an array containing every modded card type in the game.
Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
use the getModdedCardTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly CardType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:753
getModdedCardTypesSet
▸ getModdedCardTypesSet(): ReadonlySet
<CardType
>
Returns a set containing every modded card type in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
use the getModdedCardTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CardType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:772
getPillEffects
▸ getPillEffects(): readonly PillEffect
[]
Returns an array containing every valid pill effect in the game, including modded pill effects.
Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
then use the getPillEffectSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly PillEffect
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:796
getPillEffectsSet
▸ getPillEffectsSet(): ReadonlySet
<PillEffect
>
Returns a set containing every valid pill effect in the game, including modded pill effects.
Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
then use the getPillEffects
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<PillEffect
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:816
getModdedPillEffects
▸ getModdedPillEffects(): readonly PillEffect
[]
Returns an array containing every modded pill effect in the game.
Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups,
then use the getModdedPillEffectsSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly PillEffect
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:836
getModdedPillEffectsSet
▸ getModdedPillEffectsSet(): ReadonlySet
<PillEffect
>
Returns a set containing every modded pill effect in the game.
Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order,
then use the getModdedPillEffects
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all pill effects will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<PillEffect
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:856
getCollectibleTypesWithCacheFlag
▸ getCollectibleTypesWithCacheFlag(cacheFlag
): readonly CollectibleType
[]
Returns a set containing every collectible type with the given cache flag, including modded collectibles.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
cacheFlag | CacheFlagValue |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:878
getTrinketsTypesWithCacheFlag
▸ getTrinketsTypesWithCacheFlag(cacheFlag
): readonly TrinketType
[]
Returns a set containing every trinket type with the given cache flag, including modded trinkets.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
cacheFlag | CacheFlagValue |
Returns
readonly TrinketType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:904
getPlayerCollectiblesWithCacheFlag
▸ getPlayerCollectiblesWithCacheFlag(player
, cacheFlag
): readonly CollectibleType
[]
Returns an array containing every collectible type that the player has that matches the
provided CacheFlag
.
For example, if the cache flag is CacheFlag.FLYING
, and the player has one Lord of the Pit
and two Dead Doves, then this function would return:
[
CollectibleType.LORD_OF_THE_PIT,
CollectibleType.DEAD_DOVE,
CollectibleType.DEAD_DOVE,
]
Note that this array will not include collectibles that the player does not really have, like Lilith's Incubus.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
cacheFlag | CacheFlagValue |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:944
getPlayerTrinketsWithCacheFlag
▸ getPlayerTrinketsWithCacheFlag(player
, cacheFlag
): Map
<TrinketType
, int
>
Returns a map containing every trinket type that the player has that matches the provided
CacheFlag
. The values of the map correspond to the multiplier for that trinket.
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
cacheFlag | CacheFlagValue |
Returns
Map
<TrinketType
, int
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:976
getFlyingCollectibleTypes
▸ getFlyingCollectibleTypes(includeConditionalItems
): readonly CollectibleType
[]
Returns a set of all of the collectibles that grant flight. This is derived from collectibles
that have CacheFlag.FLYING
set in the "items.xml" file.
Vanilla collectibles that only grant flight conditionally are manually pruned. Collectibles
such as Empty Vessel should be checked for via the hasFlyingTemporaryEffect
function.
Under the hood, this is determined by looking at the collectibles that have CacheFlag.FLYING
and excluding the ones that have CacheFlag.ALL
. (None of the collectibles with
CacheFlag.ALL
grant flying, including all of the 3 Dollar Bill collectibles and all of the
Birthright effects.)
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Description |
---|---|---|
includeConditionalItems | boolean | Whether collectibles that only grant flight conditionally should be included in the set (like Empty Vessel). |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1017
getFlyingTrinketTypes
▸ getFlyingTrinketTypes(): readonly TrinketType
[]
Returns a set of all of the trinkets that grant flight. (All vanilla trinkets that grant flight do so conditionally, like Bat Wing and Azazel's Stump.)
Under the hood, this is determined by looking at the trinkets that have CacheFlag.FLYING
and
excluding the ones that have CacheFlag.ALL
. (None of the trinket with CacheFlag.ALL
grant
flying except for Azazel's Stump.)
This function can only be called if at least one callback has been executed. This is because not all trinket types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly TrinketType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1044
getCollectibleTypesWithTag
▸ getCollectibleTypesWithTag(itemConfigTag
): readonly CollectibleType
[]
Returns a set containing every collectible type with the given tag.
For example, to get all of the collectible types that count as offensive for the purposes of Tainted Lost:
const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
itemConfigTag | ItemConfigTagValue |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1072
getPlayerCollectiblesWithTag
▸ getPlayerCollectiblesWithTag(player
, itemConfigTag
): readonly CollectibleType
[]
Returns an array of collectible types that a player has with a particular tag.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
itemConfigTag | ItemConfigTagValue |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1098
getCollectibleTypesForTransformation
▸ getCollectibleTypesForTransformation(playerForm
): readonly CollectibleType
[]
Helper function to get all of the collectible types in the game that count towards a particular transformation.
For example, to get all of the collectible types that count towards Guppy:
const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY);
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
playerForm | PlayerForm |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1136
getPlayerCollectiblesForTransformation
▸ getPlayerCollectiblesForTransformation(player
, playerForm
): readonly CollectibleType
[]
Returns an array of collectible types that a player has that count towards a particular transformation.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
playerForm | PlayerForm |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1161
getEdenActiveCollectibleTypes
▸ getEdenActiveCollectibleTypes(): ReadonlySet
<CollectibleType
>
Returns a set containing every valid passive item that can be randomly granted to Eden as a starting item.
Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml".
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CollectibleType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1195
getEdenPassiveCollectibleTypes
▸ getEdenPassiveCollectibleTypes(): ReadonlySet
<CollectibleType
>
Returns a set containing every valid passive item that can be randomly granted to Eden as a starting item.
Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml".
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CollectibleType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1215
getRandomEdenActiveCollectibleType
▸ getRandomEdenActiveCollectibleType(seedOrRNG
, exceptions?
): CollectibleType
Returns a random active collectible type that that is a valid starting item for Eden.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded collectible type, you must explicitly pass undefined
to the
seedOrRNG
parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
seedOrRNG | undefined | RNG | Seed | undefined | The Seed or RNG object to use. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed. |
exceptions | readonly CollectibleType [] | [] | Optional. An array of runes to not select. |
Returns
CollectibleType
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1239
getRandomEdenPassiveCollectibleType
▸ getRandomEdenPassiveCollectibleType(seedOrRNG
, exceptions?
): CollectibleType
Returns a random passive collectible type that that is a valid starting item for Eden (including familiars).
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded collectible type, you must explicitly pass undefined
to the
seedOrRNG
parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
seedOrRNG | undefined | RNG | Seed | undefined | The Seed or RNG object to use. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed. |
exceptions | readonly CollectibleType [] | [] | Optional. An array of runes to not select. |
Returns
CollectibleType
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1272
getCollectibleTypesOfQuality
▸ getCollectibleTypesOfQuality(quality
): readonly CollectibleType
[]
Returns an array containing every collectible type with the given quality.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
quality | Quality |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1301
getPlayerCollectiblesOfQuality
▸ getPlayerCollectiblesOfQuality(player
, quality
): readonly CollectibleType
[]
Returns an array of collectible types that a player has that are of a particular quality.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
player | EntityPlayer |
quality | Quality |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1327
getCardTypesOfType
▸ getCardTypesOfType(...itemConfigCardTypes
): readonly CardType
[]
Helper function to get an array of card types matching the ItemConfigCardType
.
This function is variadic, meaning that you can you can specify N card types to get an array containing cards that match any of the specified types.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type |
---|---|
...itemConfigCardTypes | readonly ItemConfigCardType [] |
Returns
readonly CardType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1364
getRandomCardTypeOfType
▸ getRandomCardTypeOfType(itemConfigCardType
, seedOrRNG
, exceptions?
): CardType
Helper function to get a random card type that matches the provided ItemConfigCardType
.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined
to the
seedOrRNG
parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
itemConfigCardType | ItemConfigCardType | undefined | The item config card type that represents the pool of cards to select from. |
seedOrRNG | undefined | RNG | Seed | undefined | The Seed or RNG object to use. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed. |
exceptions | readonly CardType [] | [] | Optional. An array of cards to not select. |
Returns
CardType
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1406
getRandomCard
▸ getRandomCard(seedOrRNG
, exceptions?
): CardType
Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
This will not return:
- any runes
- any objects like Dice Shard
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined
to the
seedOrRNG
parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
seedOrRNG | undefined | RNG | Seed | undefined | The Seed or RNG object to use. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed. |
exceptions | readonly CardType [] | [] | Optional. An array of cards to not select. |
Returns
CardType
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1437
getRandomRune
▸ getRandomRune(seedOrRNG
, exceptions?
): CardType
Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul of Isaac, etc.). This will never return a Rune Shard.
This function can only be called if at least one callback has been executed. This is because not all card types will necessarily be present when a mod first loads (due to mod load order).
If you want to get an unseeded card type, you must explicitly pass undefined
to the
seedOrRNG
parameter.
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
seedOrRNG | undefined | RNG | Seed | undefined | The Seed or RNG object to use. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed. |
exceptions | readonly CardType [] | [] | Optional. An array of runes to not select. |
Returns
CardType
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:1464