Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
Public Member Functions | |
table | GetData () |
Update () | |
Render (Vector Offset) | |
boolean | RenderShadowLayer (Vector Offset) |
PostRender () | |
boolean | TakeDamage (float Damage, integer Flags, EntityRef Source, integer DamageCountdown) |
boolean | HasMortalDamage () |
Kill () | |
Kills the entity and makes a blood splat or gibs. More... | |
Die () | |
Remove () | |
BloodExplode () | |
Explodes with gibs and blood. More... | |
AddVelocity (Vector Velocity) | |
MultiplyFriction (float Value) | |
SetColor (Color Color, integer Duration, integer Priority, boolean Fadeout, boolean Share) | |
const Color & | GetColor () |
SetSpriteFrame (string AnimationName, integer FrameNum) | |
SetSpriteOverlayFrame (string AnimationName, integer FrameNum) | |
SetSize (float Size, Vector SizeMulti, integer NumGridCollisionPoints) | |
boolean | CollidesWithGrid () |
boolean | IsEnemy () |
return true for NPCs that are not controlled by the player More... | |
boolean | IsActiveEnemy (boolean includeDead) |
return true for non background NPCs (ex: every enemy except fire and shopkeepers) More... | |
boolean | IsVulnerableEnemy () |
return true for enemies that can be damaged More... | |
boolean | IsFlying () |
AddEntityFlags (integer Flags) | |
ClearEntityFlags (integer Flags) | |
integer | GetEntityFlags () |
boolean | HasEntityFlags (integer Flags) |
boolean | HasFullHealth () |
AddHealth (float HitPoints) | |
AddPoison (EntityRef Source, integer Duration, float Damage) | |
AddFreeze (EntityRef Source, integer Duration) | |
AddSlowing (EntityRef Source, integer Duration, float SlowValue, Color SlowColor) | |
Makes the friction higher. More... | |
AddCharmed (integer Duration) | |
AddConfusion (EntityRef Source, integer Duration, boolean IgnoreBosses) | |
AddMidasFreeze (EntityRef Source, integer Duration) | |
AddFear (EntityRef Source, integer Duration) | |
AddBurn (EntityRef Source, integer Duration, float Damage) | |
AddShrink (EntityRef Source, integer Duration) | |
RemoveStatusEffects () | |
boolean | Exists () |
boolean | IsDead () |
boolean | IsVisible () |
boolean | IsInvincible () |
boolean | CanShutDoors () |
enemies keep the doors shut More... | |
boolean | IsBoss () |
bosses display health bar More... | |
BossId | GetBossID () |
Entity & | GetLastParent () |
Entity & | GetLastChild () |
boolean | HasCommonParentWithEntity (Entity Other) |
boolean | IsFrame (integer Frame, integer Offset) |
true every X frames More... | |
RNG & | GetDropRNG () |
Sprite & | GetSprite () |
EntityPlayer | ToPlayer () |
EntityEffect | ToEffect () |
EntityNPC | ToNPC () |
EntityPickup | ToPickup () |
EntityFamiliar | ToFamiliar () |
EntityBomb | ToBomb () |
EntityKnife | ToKnife () |
EntityLaser | ToLaser () |
EntityTear | ToTear () |
EntityProjectile | ToProjectile () |
Public Attributes | |
float | Friction |
loaded from entity config More... | |
Vector | Position |
Vector | Velocity |
const EntityType | Type |
integer | Variant |
integer | SubType |
EntityType | SpawnerType |
integer | SpawnerVariant |
const Color & | SplatColor |
boolean | Visible |
const Vector & | PositionOffset |
integer | RenderZOffset |
boolean | FlipX |
const Vector & | SpriteOffset |
const Vector & | SpriteScale |
float | SpriteRotation |
Vector | SizeMulti |
float | Mass |
float | MaxHitPoints |
float | HitPoints |
const integer | Index |
const Vector & | TargetPosition |
GridCollisionClass | GridCollisionClass |
EntityCollisionClass | EntityCollisionClass |
float | CollisionDamage |
const integer | SpawnGridIndex |
Entity & | Parent |
Entity & | Child |
Entity & | Target |
Entity & | SpawnerEntity |
const integer | FrameCount |
const integer | InitSeed |
const integer | DropSeed |
float | DepthOffset |
float | Size |
Entity::AddBurn | ( | EntityRef | Source, |
integer | Duration, | ||
float | Damage | ||
) |
Adds a burn-effect to an enemy. Duration is in Number of Frames. Damage is the Damage taken per frame.
local player =Isaac.GetPlayer(0)
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddBurn(player,30,1)
end
Entity::AddCharmed | ( | integer | Duration | ) |
Adds a charmed-effect to an enemy. Duration is in Number of Frames. Charmed enemies are friendly towards isaac and attack other enemies. AddCharmed(-1)
makes the effect permanent and the enemy will follow you even to different rooms.
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddCharmed(30)
end
Entity::AddConfusion | ( | EntityRef | Source, |
integer | Duration, | ||
boolean | IgnoreBosses | ||
) |
Adds a confusion effect to an entity.
local player =Isaac.GetPlayer(0)
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddConfusion(player,30,true)
end
Entity::AddEntityFlags | ( | integer | Flags | ) |
Add EntityFlags to the entity. Flags are used to add specific effects like poisoning or freeze. You can add multiple flags at the same time by bitwise-concatenating them.
local player =Isaac.GetPlayer(0)
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddEntityFlags(EntityFlag.FLAG_SLOW | EntityFlag.FLAG_CONFUSION)
end
Entity::AddFear | ( | EntityRef | Source, |
integer | Duration | ||
) |
Adds a fear-effect to an entity.
local player =Isaac.GetPlayer(0)
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddFear(player, 30)
end
Entity::AddFreeze | ( | EntityRef | Source, |
integer | Duration | ||
) |
Freezes an entity, making it unable to move and attack.
local player =Isaac.GetPlayer(0)
for i, entity in ipairs(Isaac.GetRoomEntities()) do
entity:AddFreeze(player, 30)
end
Entity::AddHealth | ( | float | HitPoints | ) |
Heals an entity.
Entity::AddMidasFreeze | ( | EntityRef | Source, |
integer | Duration | ||
) |
Turns the entity into a gold statue (can't move, can't attack, drops coins when killed)
Entity::AddPoison | ( | EntityRef | Source, |
integer | Duration, | ||
float | Damage | ||
) |
Adds a poison effect to the entity.
Entity::AddShrink | ( | EntityRef | Source, |
integer | Duration | ||
) |
Adds a shrink effect to the entity.
Makes the friction higher.
Entity::AddVelocity | ( | Vector | Velocity | ) |
Adds velocity to the entity. This can be used to move him in a certain direktion (for example as a result of collision)
Entity::BloodExplode | ( | ) |
Explodes with gibs and blood.
boolean Entity::CanShutDoors | ( | ) |
enemies keep the doors shut.
Entity::ClearEntityFlags | ( | integer | Flags | ) |
Removes all EntityFlags from the entity.
boolean Entity::CollidesWithGrid | ( | ) |
Returns true, if the entity is able to collide with the grid.
Entity::Die | ( | ) |
Kills the entity and trigger its death animation.
boolean Entity::Exists | ( | ) |
Returns true, if this entity still exists.
BossId Entity::GetBossID | ( | ) |
If the entity is a boss, it returns its specific boss id. If it isnt a boss it will return 0.
const Color& Entity::GetColor | ( | ) |
Returns the Color object assosiated to this entity.
table Entity::GetData | ( | ) |
Returns a table that contains all data assosiated with the entity. This can be used to add custom data as well.
if type(entity:GetData()["MyValue"]) == type(nil) then -- checks, if the Data does exist already
entity:GetData()["MyValue"] = "Cool" -- assign a value to the data
else
print(entity:GetData()["MyValue"]) -- this will print "Cool" in the console
end
RNG& Entity::GetDropRNG | ( | ) |
Returns the assigned RNG object for the entity. This RNG is used to determine the items that are dropped on the entities death.
integer Entity::GetEntityFlags | ( | ) |
Get the EntityFlags of the entity. This will be a number which acts like a bitmask.
if entity:GetEntityFlags() & EntityFlag.FLAG_CONFUSION == EntityFlag.FLAG_CONFUSION then
print("This entity is confused!")
end
Entity& Entity::GetLastChild | ( | ) |
Returns the last entity spawned by this entity.
Entity& Entity::GetLastParent | ( | ) |
Returns the last parent of this entity.
Sprite& Entity::GetSprite | ( | ) |
Return the sprite object of the entity.
boolean Entity::HasCommonParentWithEntity | ( | Entity | Other | ) |
boolean Entity::HasEntityFlags | ( | integer | Flags | ) |
Returns true, if the entity has all named EntityFlags set.
if entity:HasEntityFlags(EntityFlag.FLAG_CONFUSION) then
print("This entity is confused!")
end
boolean Entity::HasFullHealth | ( | ) |
boolean Entity::HasMortalDamage | ( | ) |
The game adds taken damage to a damage buffer, which gets applied in the next frame. HasMortalDamage() returns true if the buffered damage is enough to kill the entity.
HasMortalDamage() will be updated additionally after TakeDamage() is called.
boolean Entity::IsActiveEnemy | ( | boolean | includeDead | ) |
return true for non background NPCs (ex: every enemy except fire and shopkeepers)
boolean Entity::IsBoss | ( | ) |
bosses display health bar
boolean Entity::IsDead | ( | ) |
boolean Entity::IsEnemy | ( | ) |
return true for NPCs that are not controlled by the player
boolean Entity::IsFlying | ( | ) |
boolean Entity::IsFrame | ( | integer | Frame, |
integer | Offset | ||
) |
true every X frames
boolean Entity::IsInvincible | ( | ) |
boolean Entity::IsVisible | ( | ) |
boolean Entity::IsVulnerableEnemy | ( | ) |
return true for enemies that can be damaged
Entity::Kill | ( | ) |
Kills the entity and makes a blood splat or gibs.
Entity::MultiplyFriction | ( | float | Value | ) |
Entity::PostRender | ( | ) |
Entity::Remove | ( | ) |
Remove the entity from the game instantly, without doing any additional effects/animations.
Entity::RemoveStatusEffects | ( | ) |
Removes all Status Effects from the entity.
Entity::Render | ( | Vector | Offset | ) |
Render the current sprite of the Entity at the current entity position + offset.
boolean Entity::RenderShadowLayer | ( | Vector | Offset | ) |
Render the shadow / shadow layer again.
Entity::SetColor | ( | Color | Color, |
integer | Duration, | ||
integer | Priority, | ||
boolean | Fadeout, | ||
boolean | Share | ||
) |
Set the colormask for the entity. This can be used to tint the sprites in different colors.
entity:SetColor(Color(1,1,1,1,255,255,255),15,1,false,false)
Entity::SetSize | ( | float | Size, |
Vector | SizeMulti, | ||
integer | NumGridCollisionPoints | ||
) |
Set the size ofthe entity.
Entity::SetSpriteFrame | ( | string | AnimationName, |
integer | FrameNum | ||
) |
Entity::SetSpriteOverlayFrame | ( | string | AnimationName, |
integer | FrameNum | ||
) |
boolean Entity::TakeDamage | ( | float | Damage, |
integer | Flags, | ||
EntityRef | Source, | ||
integer | DamageCountdown | ||
) |
EntityBomb Entity::ToBomb | ( | ) |
EntityEffect Entity::ToEffect | ( | ) |
EntityFamiliar Entity::ToFamiliar | ( | ) |
EntityKnife Entity::ToKnife | ( | ) |
EntityLaser Entity::ToLaser | ( | ) |
EntityNPC Entity::ToNPC | ( | ) |
EntityPickup Entity::ToPickup | ( | ) |
EntityPlayer Entity::ToPlayer | ( | ) |
EntityProjectile Entity::ToProjectile | ( | ) |
EntityTear Entity::ToTear | ( | ) |
Entity::Update | ( | ) |
Entity& Entity::Child |
float Entity::CollisionDamage |
float Entity::DepthOffset |
Get/Set the depth-offset of the entity. This value is added to the Y Position of the entity, which is then used to determine the rendering order of each entity. Default value is 0 for all entities.
entity1.Position.Y -- => 50
entity2.Position.Y -- => 45
-- Entity1 is rendered in front of Entity2
entity1.DepthOffset = -10
-- new Entity1 renderYPosition => 40
-- Entity2 is rendered in front of Entity1
const integer Entity::DropSeed |
Get/set the Seed of the Drop RNG.
EntityCollisionClass Entity::EntityCollisionClass |
boolean Entity::FlipX |
const integer Entity::FrameCount |
float Entity::Friction |
loaded from entity config
GridCollisionClass Entity::GridCollisionClass |
float Entity::HitPoints |
const integer Entity::Index |
const integer Entity::InitSeed |
float Entity::Mass |
float Entity::MaxHitPoints |
Entity& Entity::Parent |
Vector Entity::Position |
const Vector& Entity::PositionOffset |
integer Entity::RenderZOffset |
Vector Entity::SizeMulti |
Entity& Entity::SpawnerEntity |
EntityType Entity::SpawnerType |
integer Entity::SpawnerVariant |
const integer Entity::SpawnGridIndex |
const Color& Entity::SplatColor |
const Vector& Entity::SpriteOffset |
float Entity::SpriteRotation |
const Vector& Entity::SpriteScale |
integer Entity::SubType |
Entity& Entity::Target |
const Vector& Entity::TargetPosition |
const EntityType Entity::Type |
integer Entity::Variant |
Vector Entity::Velocity |
boolean Entity::Visible |
float Entity::Size |