Skip to content

Class "EntityPickup"⚓︎

Class Diagram⚓︎

    classDiagram
    class Entity:::diagramCurrentPage
    class EntityBomb
    class EntityEffect
    class EntityFamiliar
    class EntityKnife
    class EntityLaser
    class EntityNPC
    class EntityPickup
    class EntityPlayer
    class EntityProjectile
    class EntityTear
    Entity <|-- EntityBomb
    Entity <|-- EntityEffect
    Entity <|-- EntityFamiliar
    Entity <|-- EntityKnife
    Entity <|-- EntityLaser
    Entity <|-- EntityNPC
    Entity <|-- EntityPickup
    Entity <|-- EntityPlayer
    Entity <|-- EntityProjectile
    Entity <|-- EntityTear
    link Entity "Entity.html" "Go to page for 'Entity' class"
    link EntityBomb "EntityBomb.html" "Go to page for 'EntityBomb' class"
    link EntityEffect "EntityEffect.html" "Go to page for 'EntityEffect' class"
    link EntityFamiliar "EntityFamiliar.html" "Go to page for 'EntityFamiliar' class"
    link EntityKnife "EntityKnife.html" "Go to page for 'EntityKnife' class"
    link EntityLaser "EntityLaser.html" "Go to page for 'EntityLaser' class"
    link EntityNPC "EntityNPC.html" "Go to page for 'EntityNPC' class"
    link EntityPickup "EntityPickup.html" "Go to page for 'EntityPickup' class"
    link EntityPlayer "EntityPlayer.html" "Go to page for 'EntityPlayer' class"
    link EntityProjectile "EntityProjectile.html" "Go to page for 'EntityProjectile' class"
    link EntityTear "EntityTear.html" "Go to page for 'EntityTear' class"

Functions⚓︎

Appear·Fast ()⚓︎

void AppearFast ( )⚓︎


Can·Reroll ()⚓︎

boolean CanReroll ( )⚓︎


Get·Coin·Value ()⚓︎

int GetCoinValue ( )⚓︎

If this is a coin, return its face value, else zero.


Is·Shop·Item ()⚓︎

boolean IsShopItem ( )⚓︎


Morph ()⚓︎

void Morph ( EntityType Type, int Variant, int SubType, boolean KeepPrice = false, boolean KeepSeed = false, boolean IgnoreModifiers = false )⚓︎

KeepSeed: If set to true, keeps the initial RNG seed of the pickup instead of rerolling it

IgnoreModifiers: If set to true, ignores item effects that might turn this pickup into something other than the specificed variant and subtype


Play·Drop·Sound ()⚓︎

void PlayDropSound ( )⚓︎


Play·Pickup·Sound ()⚓︎

void PlayPickupSound ( )⚓︎


Try·Open·Chest ()⚓︎

boolean TryOpenChest ( EntityPlayer Player = nil )⚓︎

Player: The player that opened this chest


Variables⚓︎

Auto·Update·Price⚓︎

boolean AutoUpdatePrice⚓︎


Charge⚓︎

int Charge⚓︎


OptionsPickupIndex⚓︎

int OptionsPickupIndex⚓︎

Any non-zero value causes the item to form an option group with any other item with the same OptionsPickupIndex value.

When an item belonging to an option group is picked up, all other items belonging to the same group disappear.

0 is the default value and means the item doesn't belong to any group.


Price⚓︎

int Price⚓︎

Price of the pickup in shops.

Tainted Keeper Info

On Tainted Keeper, all items are supposed to have a price. But any items spawned with Lua does not comply with this rule, so you have to manually set a price. On the next frame after assigning a price (for example 1), it will snap to the correct price it would have for Tainted Keeper (e.g. 15). This is because of the AutoUpdatePrice feature.

This method works most of the time. However, it breaks in special rooms (e.g. Angel Rooms) such that sometimes, the price will snap to wrong values, such as 24, 99, and so on. The fix for this, set ShopItemId to an arbitrary negative value (e.g. -1).


Shop·Item·Id⚓︎

int ShopItemId⚓︎

If in a shop, this value describes which slot the item is for sale in. For example, if the shop has 6 things for sale, the pickups in the room will have shop item IDs of 0, 1, 2, 3, 4, and 5.

When spawning a new collectible item, the ShopItemId will be 0 by default. This has a side effect of making the D6 roll the collectible into a red heart. By setting shop item id to -1, it will fix this behavior such that the collectible will properly roll into another collectible. However, non-collectible pickups may reroll into collectibles through a D20 or similar.

By setting shop item id to -2, automatic prices will be devil deal prices. Otherwise this is identical to -1.

Other negative values act identically to -1.


State⚓︎

int State⚓︎


Timeout⚓︎

int Timeout⚓︎


Touched⚓︎

boolean Touched⚓︎


Wait⚓︎

int Wait⚓︎

Used with collectibles to enforce a period of time where the player will not automatically pick up the collectible. New collectibles spawn with a Wait value of 20 (which corresponds to 20 game frames). The value will automatically decrement as game frames pass.

It is unknown whether or not this value is used for pickups other than collectibles.



Last update: January 21, 2023