Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
Public Member Functions | |
boolean | Morph (EntityType, integer Variant, integer SubType, integer ChampionColorIdx) |
KillUnique () | |
For entities with unique death animation, like Flush! vs poop enemies. More... | |
boolean | IsBoss () |
Entity & | GetPlayerTarget () |
if there are no modifiers (best friend) this will return the player More... | |
Vector | CalcTargetPosition (float DistanceLimit) |
integer | GetBossColorIdx () |
integer | GetChampionColorIdx () |
ResetPathFinderTarget () | |
boolean | CanBeDamagedFromVelocity (Vector Velocity) |
boolean | CanReroll () |
boolean | IsChampion () |
MakeChampion (integer Seed) | |
Forces a non champion to become a champion, resets hp to max hp. More... | |
PlaySound (SoundEffect ID, float Volume, integer FrameDelay, boolean Loop, float Pitch) | |
EntityEffect & | MakeSplat (float Size) |
integer | GetAliveEnemyCount () |
Used to redirect close door enemies to any enemies for friendly npcs. More... | |
FireProjectiles (Vector Pos, Vector Velocity, ProjectilesMode Mode, ProjectileParams Params) | |
EntityProjectile & | FireBossProjectiles (integer NumProjectiles, Vector TargetPos, float TrajectoryModifier, ProjectileParams Params) |
AnimWalkFrame (string HorizontalAnim, string VerticalAnim, float SpeedThreshold) | |
EntityList | QueryNPCsType (EntityType Type, integer Variant) |
EntityList | QueryNPCsSpawnerType (EntityType SpawnerType, EntityType Type, boolean OnlyEnemies) |
EntityList | QueryNPCsGroup (integer GroupIdx) |
Public Member Functions inherited from Entity | |
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 () |
Static Public Member Functions | |
static | ThrowSpider (Vector Position, Entity Spawner, Vector TargetPos, boolean Big, float YOffset) |
Public Attributes | |
boolean | CanShutDoors |
float | Scale |
const EntityNPC & | ParentNPC |
parent entity, for multi-entity NPCs like Larry Jr. More... | |
const EntityNPC & | ChildNPC |
Entity & | EntityRef |
integer | StateFrame |
PathFinder | Pathfinder |
integer | State |
integer | ProjectileCooldown |
integer | ProjectileDelay |
>0: projectile will be fired in n frames More... | |
Vector | V1 |
general usage for ai_* functions, initialized to (0,0) More... | |
Vector | V2 |
like m_V1, in case we need two of those More... | |
integer | I1 |
general usage ints for ai_ More... | |
integer | I2 |
same as m_I1 More... | |
integer | GroupIdx |
Used to identify multichunks groups. More... | |
Public Attributes inherited from Entity | |
float | Friction |
loaded from entity config More... | |
Vector | Position |
Vector | Velocity |
const EntityType | Type |
integer | Variant |
void SetType(eEntityType Type); More... | |
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 |
EntityNPC::AnimWalkFrame | ( | string | HorizontalAnim, |
string | VerticalAnim, | ||
float | SpeedThreshold | ||
) |
Vector EntityNPC::CalcTargetPosition | ( | float | DistanceLimit | ) |
boolean EntityNPC::CanBeDamagedFromVelocity | ( | Vector | Velocity | ) |
boolean EntityNPC::CanReroll | ( | ) |
EntityProjectile& EntityNPC::FireBossProjectiles | ( | integer | NumProjectiles, |
Vector | TargetPos, | ||
float | TrajectoryModifier, | ||
ProjectileParams | Params | ||
) |
fire a number of projectiles, optionally targeting the player direction is randomized, or slightly randomized when targeting the player FallingAccelModifier can be used to make projectiles fall faster to the ground returns a pointer to the projectile spawned last (useful e.g. when NumProjectiles=1)
EntityNPC::FireProjectiles | ( | Vector | Pos, |
Vector | Velocity, | ||
ProjectilesMode | Mode, | ||
ProjectileParams | Params | ||
) |
integer EntityNPC::GetAliveEnemyCount | ( | ) |
Used to redirect close door enemies to any enemies for friendly npcs.
integer EntityNPC::GetBossColorIdx | ( | ) |
This will return the boss color idx reduced by 1. To get the actual color as set in bosscolors.xml, add +1 to the result.
integer EntityNPC::GetChampionColorIdx | ( | ) |
A list of Champion colors can be found here : ChampionColorIdx
Entity& EntityNPC::GetPlayerTarget | ( | ) |
if there are no modifiers (best friend) this will return the player
boolean EntityNPC::IsBoss | ( | ) |
boolean EntityNPC::IsChampion | ( | ) |
EntityNPC::KillUnique | ( | ) |
For entities with unique death animation, like Flush! vs poop enemies.
EntityNPC::MakeChampion | ( | integer | Seed | ) |
Forces a non champion to become a champion, resets hp to max hp.
Hard to use because there are millions of possible seeds to input here.
Use Morph() to change the champion Color instead!
EntityEffect& EntityNPC::MakeSplat | ( | float | Size | ) |
boolean EntityNPC::Morph | ( | EntityType | , |
integer | Variant, | ||
integer | SubType, | ||
integer | ChampionColorIdx | ||
) |
Morph the current entity into another one.
ChampionColorIdx can be used to turn the entity into a champion. Use -1
to turn it into a regular entity.
A list of Champion colors can be found here : ChampionColorIdx
entity:ToNPC():Morph(EntityType.ENTITY_GAPER , 0, 0,-1)
EntityNPC::PlaySound | ( | SoundEffect | ID, |
float | Volume, | ||
integer | FrameDelay, | ||
boolean | Loop, | ||
float | Pitch | ||
) |
EntityList EntityNPC::QueryNPCsGroup | ( | integer | GroupIdx | ) |
EntityList EntityNPC::QueryNPCsSpawnerType | ( | EntityType | SpawnerType, |
EntityType | Type, | ||
boolean | OnlyEnemies | ||
) |
EntityList EntityNPC::QueryNPCsType | ( | EntityType | Type, |
integer | Variant | ||
) |
EntityNPC::ResetPathFinderTarget | ( | ) |
|
static |
boolean EntityNPC::CanShutDoors |
const EntityNPC& EntityNPC::ChildNPC |
Entity& EntityNPC::EntityRef |
integer EntityNPC::GroupIdx |
Used to identify multichunks groups.
integer EntityNPC::I1 |
general usage ints for ai_
integer EntityNPC::I2 |
same as m_I1
const EntityNPC& EntityNPC::ParentNPC |
parent entity, for multi-entity NPCs like Larry Jr.
PathFinder EntityNPC::Pathfinder |
integer EntityNPC::ProjectileCooldown |
projectiles can fire again when it reaches 0
integer EntityNPC::ProjectileDelay |
>0: projectile will be fired in n frames
float EntityNPC::Scale |
integer EntityNPC::State |
integer EntityNPC::StateFrame |
Vector EntityNPC::V1 |
general usage for ai_* functions, initialized to (0,0)
Vector EntityNPC::V2 |
like m_V1, in case we need two of those