Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
Public Member Functions | |
const Item & | GetCollectible (integer ID) |
const Item & | GetTrinket (integer ID) |
const Item & | GetNullItem (integer ID) |
const Card & | GetCard (integer ID) |
const PillEffect & | GetPillEffect (PillEffect PillEffectID) |
const ItemList & | GetCollectibles () |
const ItemList & | GetTrinkets () |
const ItemList & | GetNullItems () |
const CostumeList & | GetCostumes () |
const CardList & | GetCards () |
const PillList & | GetPillEffects () |
Static Public Member Functions | |
static boolean | IsValidCollectible (CollectibleType ID) |
static boolean | ShouldAddCostumeOnPickup (Item Config) |
const Card& ItemConfig::Config::GetCard | ( | integer | ID | ) |
const CardList& ItemConfig::Config::GetCards | ( | ) |
const Item& ItemConfig::Config::GetCollectible | ( | integer | ID | ) |
Returns the Itemobject of a given CollectibleID.
This Code gets the highest possible collectibleid including modded items. It uses the Binary Search algorithm to do it.
Using GetCollectible(): (recommended!)
function GetMaxCollectibleID()
local id = CollectibleType.NUM_COLLECTIBLES-1
local step = 16
while step > 0 do
if Isaac.GetItemConfig():GetCollectible(id+step) ~= nil then
id = id + step
else
step = step // 2
end
end
return id
end
Using GetCollectibles(): (Crashes on Mac OS)
function GetMaxCollectibleID()
return Isaac.GetItemConfig():GetCollectibles().Size -1
end
const ItemList& ItemConfig::Config::GetCollectibles | ( | ) |
Returns the List of all Collectibles.
This Code gets the highest possible collectibleid including modded items.
function GetMaxCollectibleID()
return Isaac.GetItemConfig():GetCollectibles().Size -1
end
const CostumeList& ItemConfig::Config::GetCostumes | ( | ) |
const Item& ItemConfig::Config::GetNullItem | ( | integer | ID | ) |
const ItemList& ItemConfig::Config::GetNullItems | ( | ) |
const PillEffect& ItemConfig::Config::GetPillEffect | ( | PillEffect | PillEffectID | ) |
const PillList& ItemConfig::Config::GetPillEffects | ( | ) |
const Item& ItemConfig::Config::GetTrinket | ( | integer | ID | ) |
const ItemList& ItemConfig::Config::GetTrinkets | ( | ) |
|
static |
Function to check if a given item id is a valid collectible id (aka. this item exists). Returns True when it exists and False when it doesnt.
itemConfig:GetCollectible()
instead.
ItemConfig.Config.IsValidCollectible(1)
|
static |