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 |
|
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 |
|
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.