Class "EntityPickup"⚓︎
Info
你可以通过以下函数获取此类:
Example Code
local entity = Isaac.GetRoomEntities()[1]:ToPickup()
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: 如果设置为 true,将保留拾取物的初始 RNG 种子,而不是重置它
IgnoreModifiers: 如果设置为true,将忽略可能将此拾取物转变为其他类型的物品效果。具体来说,这可以用来防止道具受到堕化以撒的额外选择机制的影响。(例如,如果您手动生成一个任务道具,例如 Polaroid,它将受到堕化以撒的机制的影响,这通常是不可取的。要解决此问题,您可以在生成后立即将其变形为相同的实体类型/变体/子类型,并将此参数设置为 true。)
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⚓︎
任何非 0 的值都会导致该物品与任何其他具有相同 OptionsPickupIndex 值的物品形成选项组。
当属于选项组的物品被拾取时,所有属于同一组的其他物品都会消失。
0 是默认值,表示该物品不属于任何组。
Price⚓︎
int Price⚓︎
该物品在商店中的价格。
堕化店长信息
在堕化店长身上,所有物品都应该有一个价格。但是,任何使用 Lua 生成的物品都不符合此规则,因此您必须手动设置价格。在分配价格的下一帧(例如 1
)之后,它将自动调整为堕化店长的正确价格(例如 15)。这是由于 AutoUpdatePrice 功能造成的。
该方法在大多数情况下都有效。然而,它在特殊房间(例如天使房)中会出现问题,有时价格会跳到错误的值,例如 24、99 等。解决此问题的方法是将 ShopItemId 设置为任意负值(例如 -1)。
Shop·Item·Id⚓︎
int ShopItemId⚓︎
如果在商店中, 这个值描述了这个物品在商店的哪一个槽中售卖。例如,如果商店有 6 个待售物品,则房间中的拾取物将具有 0、1、2、3、4 和 5 的商店物品 ID。
当生成一个新的道具时,ShopItemId 默认为 0。这会导致 D6 将道具重置为红心。通过将商店物品 ID 设置为 -1,可以修复此行为,使道具正确重置为另一个道具。然而,非道具可能会通过 D20 或类似物品重置为道具。
通过将商店物品 ID 设置为 -2,自动价格将为恶魔交易价格。否则,这与 -1 相同。
其他负值的行为与 -1 相同。
State⚓︎
int State⚓︎
Timeout⚓︎
int Timeout⚓︎
使拾取物在一段时间后闪烁并消失,就像堕化玛姬掉落的临时生命值一样。该值每帧减少 1,达到 0 后拾取物消失。如果 Timeout 设置为 -1(正常拾取物的默认值),则拾取物将正常工作而不会消失。
Touched⚓︎
boolean Touched⚓︎
Wait⚓︎
int Wait⚓︎
被用于道具,以强制执行一段时间,期间玩家将不会自动拾取道具。新的道具生成时,Wait
值为 20(对应于 20 帧游戏时间)。该值会随着游戏帧的推移而自动减少。
目前尚不清楚此值是否用于其他类型的拾取物。