Home

EntityWithHealthPrototype

Abstract base of all entities with health in the game.

Parent

Properties

max_health

The unit health can never go over the maximum. Default health of units on creation is set to max. Must be greater than 0.

Examples

max_health = 50

healing_per_tick

The amount of health automatically regenerated per tick. The entity must be active for this to work.

Examples

healing_per_tick = 0.01

repair_speed_modifier

Multiplier of RepairToolPrototype::speed for this entity prototype.

dying_explosion

The entities that are spawned in place of this one when it dies.

dying_trigger_effect

damaged_trigger_effect

loot

The loot is dropped on the ground when the entity is killed.

Examples

loot =
{
  {
    count_max = 10,
    count_min = 2,
    item = "stone",
    probability = 1
  }
}

resistances

See damage.

Examples

resistances =
{
  {
    type = "fire",
    percent = 80
  },
  {
    type = "explosion",
    percent = 30
  }
}

attack_reaction

repair_sound

Played when this entity is repaired with a RepairToolPrototype.

alert_when_damaged

hide_resistances

Whether the resistances of this entity should be hidden in the entity tooltip.

create_ghost_on_death

random_corpse_variation

integration_patch_render_layer

May also be defined inside graphics_set instead of directly in the entity prototype. This is useful for entities that use a graphics_set property to define their graphics, because then all graphics can be defined in one place.

corpse

Specifies the names of the CorpsePrototype to be used when this entity dies.

integration_patch

May also be defined inside graphics_set instead of directly in the entity prototype. This is useful for entities that use a graphics_set property to define their graphics, because then all graphics can be defined in one place.

Sprite drawn on ground under the entity to make it feel more integrated into the ground.

overkill_fraction

Fraction of health by which predicted damage must be exceeded before entity is considered as "predicted to die" causing turrets (and others) to stop shooting more projectiles. If entity is healing it is better to keep larger margin to avoid cases where not enough projectiles goes towards a target and it heals causing it to survive all the incoming projectiles. If entity does not heal, margin may be reduced. Must be >= 0.