Skip to content

Class "ItemPool"⚓︎

Modified Functions⚓︎

GetCollectible ()⚓︎

CollectibleType GetCollectible ( ItemPoolType PoolType, boolean Decrease = false, int Seed = Random(), CollectibleType DefaultItem = CollectibleType.COLLECTIBLE_NULL, GetCollectibleFlag Flags = 0 )⚓︎

Setting both Ban Flags

Now gives access to the Flags parameter. Setting both the BAN_ACTIVE and the BAN_PASSIVE flag will cause the function to always return either the DefaultItem or CollectibleType.COLLECTIBLE_BREAKFAST

AddBibleUpgrade ()⚓︎

void AddBibleUpgrade ( int Add, ItemPoolType PoolType )⚓︎


CanSpawnCollectible ()⚓︎

boolean CanSpawnCollectible ( CollectibleType Collectible, boolean ignoreLocked )⚓︎

IgnoreLocked

If IgnoreLocked is set to true, this function will return true for items that could appear but are locked behind achievements. It will still return false if the item was removed from the item pool or if it can't appear because other effects (Tainted Lost offensive items mechanic or NO! trinket effect).

GetBibleUpgrades ()⚓︎

int GetBibleUpgrades ( ItemPoolType PoolType )⚓︎

Returns number of Bible collectibles added to a pool.

GetCardEx ()⚓︎

Card GetCardEx ( int Seed, int SpecialChance, int RuneChance, int SuitChance, boolean AllowNonCards )⚓︎

More sophisticated version of ItemPool:GetCard() that allows to define individual chances.

GetCollectibleFromList ()⚓︎

CollectibleType GetCollectibleFromList ( CollectibleType[] ItemList, int Seed = Random(), CollectibleType DefaultItem = CollectibleType.COLLECTIBLE_BREAKFAST, boolean AddToBlacklist = true, boolean ExcludeLockedItems = false )⚓︎


GetCollectiblesFromPool ()⚓︎

table GetCollectiblesFromPool ( ItemPoolType PoolType )⚓︎

initialWeight float
isUnlocked boolean
Returns a table of collectibles registered in the specified pool. The table contains the following fields
Field Type Comment
weight float
removeOn float
decreaseBy float
itemID CollectibleType

GetNumAvailableTrinkets ()⚓︎

int GetNumAvailableTrinkets ( )⚓︎

Returns the amount of trinkets available in the item pool.

GetNumItemPools ()⚓︎

int GetNumItemPools ( )⚓︎

Retrieves the total number of item pools in the game, including custom item pools.

GetPillColor ()⚓︎

PillColor GetPillColor ( PillEffect ID )⚓︎

Currently not applied by pill modifications, such as PHD/False PHD. Returns a PillColor matching the specificed PillEffect, returns -1 if the Effect is not in the rotation.

GetRandomPool ()⚓︎

ItemPoolType GetRandomPool ( RNG RNG, boolean AdvancedSearch = false, ItemPoolType[] Filter = {}, boolean IsWhitelist = false)⚓︎

table.insert(CustomPools, i) local CustomPools = {} Normally this function is tied to the same rules as Chaos, meaning that you can only get the pools for the current mode, but by setting Advanced Search to true you can bypass these restrictions. local PoolList = { ItemPoolType.POOL_ROTTEN_BEGGAR local rng = RNG(Random()) -- replace this with your own rng

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
???+ example "Pick Pool From Vanilla"
ItemPoolType.POOL_BATTERY_BUM,
-- Put all custom pools within the Filter
local randomPool = Game():GetItemPool():GetRandomPool(rng, true, CustomPools, false)
ItemPoolType.POOL_DEMON_BEGGAR,
Setting `Advanced Search` to true allows you to make use of the `Filter` parameter.
local rng = RNG() -- replace this with your own rng
local randomPool = Game():GetItemPool():GetRandomPool(rng, true, PoolList, true)
This code picks a random pool from any of the "Beggar" pools
Picks a random pool in an identical manner to Chaos, where pools with more items have a higher probability of being chosen compared to those with fewer items.
ItemPoolType.POOL_BOMB_BUM,
Normally the `Filter` acts as a blacklist of unwanted itemPools, however setting `IsWhitelist` to true turns it into a list from which to choose from.
for i = 31, itemPool:GetNumItemPools() - 1 do
end
???+ info "Advanced Search"
local itemPool = Game():GetItemPool()
ItemPoolType.POOL_KEY_MASTER,
ItemPoolType.POOL_BEGGAR,
This code picks a random pool from any of the vanilla
???+ example "Pick Pool From List"
}

GetRemovedCollectibles ()⚓︎

table GetRemovedCollectibles ( )⚓︎

local removedCollectibles = itemPool:GetRemovedCollectibles() Returns a table of collectibles removed from all pools. if removedCollectibles[CollectibleType.COLLECTIBLE_SAD_ONION] then end

1

print("Sad onion removed!")

Example Code

This code checks if the sad onion has been removed.

GetRoomBlacklistedCollectibles ()⚓︎

table GetRoomBlacklistedCollectibles ( )⚓︎

print("Sad onion blacklisted!") Returns a table of collectibles blacklisted in the current room. local blacklistedCollectibles = itemPool:GetRoomBlacklistedCollectibles() end

1

Example Code

This code checks if the sad onion has been removed. if blacklistedCollectibles[CollectibleType.COLLECTIBLE_SAD_ONION] then

HasCollectible ()⚓︎

boolean HasCollectible ( CollectibleType Collectible )⚓︎

Returns true if collectible is available in item pools, false otherwise.

HasTrinket ()⚓︎

boolean HasTrinket ( TrinketType Trinket )⚓︎

Returns true if trinket is currently available in trinket pool, false otherwise.

PickCollectible ()⚓︎

table PickCollectible ( ItemPoolType PoolType, boolean Decrease = false, RNG RNG = RNG(), GetCollectibleFlag Flags = 0 )⚓︎

| initialWeight | float | | | weight | float | | - Does not attempt to morph the collectible into CollectibleType.COLLECTIBLE_BIBLE, CollectibleType.COLLECTIBLE_MAGIC_SKIN or CollectibleType.COLLECTIBLE_ROSARY - Does not generate a Glitched Item when having the CollectibleType.COLLECTIBLE_TMTRAINER effect.

Differences with GetCollectible

If RNG is not set, its initialized with RNG(Random(), 4) Returns the raw result of GetCollectible(), without any of the filtering applied by the original function. If the pool has completely ran out of repicks then this function will return nil. For reference GetCollectible() Gives Up after either this function has failed to pick an Unlocked collectible 20 times in a row or has failed to produce any result at all (nil). | decreaseBy | float | | |:--|:--|:--| | isUnlocked | boolean | | - Does not randomize the pool when having the CollectibleType.COLLECTIBLE_CHAOS effect. - Does not trigger the MC_PRE_GET_COLLECTIBLE and MC_POST_GET_COLLECTIBLE callback. The table contains the following fields: | removeOn | float | | |Field|Type|Comment| - Does not attempt to get a collectible from ItemPoolType.POOL_TREASURE if Giving up. - Does not morph the collectible into CollectibleType.COLLECTIBLE_BREAKFAST if Giving up. | itemID | CollectibleType | |

ResetCollectible ()⚓︎

void ResetCollectible ( CollectibleType Collectible )⚓︎

Makes the available once again, allowing it to naturally spawned even if previously remove. Also restores all instances of the collectible to it's initialWeight in every item pool.

SetLastPool ()⚓︎

void SetLastPool ( ItemPoolType )⚓︎


UnidentifyPill ()⚓︎

void UnidentifyPill ( PillColor Pill )⚓︎

Will reset a pill back to unidentified (???) state.