Prototype/EntityWithHealth: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Optional properties: 1.1.28: healing_per_tick changes for trees)
(1.1.51: Prototype/EntityWithOwner added)
Line 6: Line 6:
== Extensions ==
== Extensions ==
<div class="factorio-list">
<div class="factorio-list">
* [[Prototype/Accumulator]] '''accumulator'''
* [[Prototype/EntityWithOwner]] <abstract>
* [[Prototype/ArtilleryTurret]] '''artillery-turret'''
** [[Prototype/Accumulator]] '''accumulator'''
* [[Prototype/Beacon]] '''beacon'''
** [[Prototype/ArtilleryTurret]] '''artillery-turret'''
* [[Prototype/Boiler]] '''boiler'''
** [[Prototype/Beacon]] '''beacon'''
* [[Prototype/BurnerGenerator]] '''burner-generator'''
** [[Prototype/Boiler]] '''boiler'''
* [[Prototype/Character]] '''character'''
** [[Prototype/BurnerGenerator]] '''burner-generator'''
* [[Prototype/Combinator]] <abstract>
** [[Prototype/Character]] '''character'''
** [[Prototype/ArithmeticCombinator]] '''arithmetic-combinator'''
** [[Prototype/Combinator]] <abstract>
** [[Prototype/DeciderCombinator]] '''decider-combinator'''
*** [[Prototype/ArithmeticCombinator]] '''arithmetic-combinator'''
* [[Prototype/ConstantCombinator]] '''constant-combinator'''
*** [[Prototype/DeciderCombinator]] '''decider-combinator'''
* [[Prototype/Container]] '''container'''
** [[Prototype/ConstantCombinator]] '''constant-combinator'''
** [[Prototype/LogisticContainer]] '''logistic-container'''
** [[Prototype/Container]] '''container'''
*** [[Prototype/InfinityContainer]] '''infinity-container'''
*** [[Prototype/LogisticContainer]] '''logistic-container'''
* [[Prototype/CraftingMachine]] <abstract>
**** [[Prototype/InfinityContainer]] '''infinity-container'''
** [[Prototype/AssemblingMachine]] '''assembling-machine'''
** [[Prototype/CraftingMachine]] <abstract>
*** [[Prototype/RocketSilo]] '''rocket-silo'''
*** [[Prototype/AssemblingMachine]] '''assembling-machine'''
** [[Prototype/Furnace]] '''furnace'''
**** [[Prototype/RocketSilo]] '''rocket-silo'''
* [[Prototype/ElectricEnergyInterface]] '''electric-energy-interface'''
*** [[Prototype/Furnace]] '''furnace'''
* [[Prototype/ElectricPole]] '''electric-pole'''
** [[Prototype/ElectricEnergyInterface]] '''electric-energy-interface'''
* [[Prototype/EnemySpawner]] '''unit-spawner'''
** [[Prototype/ElectricPole]] '''electric-pole'''
** [[Prototype/EnemySpawner]] '''unit-spawner'''
** [[Prototype/FlyingRobot]] <abstract>
*** [[Prototype/CombatRobot]] '''combat-robot'''
*** [[Prototype/RobotWithLogisticInterface]] <abstract>
**** [[Prototype/ConstructionRobot]] '''construction-robot'''
**** [[Prototype/LogisticRobot]] '''logistic-robot'''
** [[Prototype/Gate]] '''gate'''
** [[Prototype/Generator]] '''generator'''
** [[Prototype/HeatInterface]] '''heat-interface'''
** [[Prototype/HeatPipe]] '''heat-pipe'''
** [[Prototype/Inserter]] '''inserter'''
** [[Prototype/Lab]] '''lab'''
** [[Prototype/Lamp]] '''lamp'''
** [[Prototype/LandMine]] '''land-mine'''
** [[Prototype/LinkedContainer]] '''linked-container'''
** [[Prototype/Market]] '''market'''
** [[Prototype/MiningDrill]] '''mining-drill'''
** [[Prototype/OffshorePump]] '''offshore-pump'''
** [[Prototype/Pipe]] '''pipe'''
*** [[Prototype/InfinityPipe]] '''infinity-pipe'''
** [[Prototype/PipeToGround]] '''pipe-to-ground'''
** [[Prototype/PlayerPort]] '''player-port'''
** [[Prototype/PowerSwitch]] '''power-switch'''
** [[Prototype/ProgrammableSpeaker]] '''programmable-speaker'''
** [[Prototype/Pump]] '''pump'''
** [[Prototype/Radar]] '''radar'''
** [[Prototype/Rail]] <abstract>
*** [[Prototype/CurvedRail]] '''curved-rail'''
*** [[Prototype/StraightRail]] '''straight-rail'''
** [[Prototype/RailSignalBase]] <abstract>
*** [[Prototype/RailChainSignal]] '''rail-chain-signal'''
*** [[Prototype/RailSignal]] '''rail-signal'''
** [[Prototype/Reactor]] '''reactor'''
** [[Prototype/Roboport]] '''roboport'''
** [[Prototype/SimpleEntityWithOwner]] '''simple-entity-with-owner'''
*** [[Prototype/SimpleEntityWithForce]] '''simple-entity-with-force'''
** [[Prototype/SolarPanel]] '''solar-panel'''
** [[Prototype/StorageTank]] '''storage-tank'''
** [[Prototype/TrainStop]] '''train-stop'''
** [[Prototype/TransportBeltConnectable]] <abstract>
*** [[Prototype/LinkedBelt]] '''linked-belt'''
*** [[Prototype/Loader1x1]] '''loader-1x1'''
*** [[Prototype/Loader1x2]] '''loader'''
*** [[Prototype/Splitter]] '''splitter'''
*** [[Prototype/TransportBelt]] '''transport-belt'''
*** [[Prototype/UndergroundBelt]] '''underground-belt'''
** [[Prototype/Turret]] '''turret'''
*** [[Prototype/AmmoTurret]] '''ammo-turret'''
*** [[Prototype/ElectricTurret]] '''electric-turret'''
*** [[Prototype/FluidTurret]] '''fluid-turret'''
** [[Prototype/Unit]] '''unit'''
** [[Prototype/Vehicle]] <abstract>
*** [[Prototype/Car]] '''car'''
*** [[Prototype/RollingStock]] <abstract>
**** [[Prototype/ArtilleryWagon]] '''artillery-wagon'''
**** [[Prototype/CargoWagon]] '''cargo-wagon'''
**** [[Prototype/FluidWagon]] '''fluid-wagon'''
**** [[Prototype/Locomotive]] '''locomotive'''
*** [[Prototype/SpiderVehicle]] '''spider-vehicle'''
** [[Prototype/Wall]] '''wall'''
* [[Prototype/Fish]] '''fish'''
* [[Prototype/Fish]] '''fish'''
* [[Prototype/FlyingRobot]] <abstract>
** [[Prototype/CombatRobot]] '''combat-robot'''
** [[Prototype/RobotWithLogisticInterface]] <abstract>
*** [[Prototype/ConstructionRobot]] '''construction-robot'''
*** [[Prototype/LogisticRobot]] '''logistic-robot'''
* [[Prototype/Gate]] '''gate'''
* [[Prototype/Generator]] '''generator'''
* [[Prototype/HeatInterface]] '''heat-interface'''
* [[Prototype/HeatPipe]] '''heat-pipe'''
* [[Prototype/Inserter]] '''inserter'''
* [[Prototype/Lab]] '''lab'''
* [[Prototype/Lamp]] '''lamp'''
* [[Prototype/LandMine]] '''land-mine'''
* [[Prototype/LinkedContainer]] '''linked-container'''
* [[Prototype/Market]] '''market'''
* [[Prototype/MiningDrill]] '''mining-drill'''
* [[Prototype/OffshorePump]] '''offshore-pump'''
* [[Prototype/Pipe]] '''pipe'''
** [[Prototype/InfinityPipe]] '''infinity-pipe'''
* [[Prototype/PipeToGround]] '''pipe-to-ground'''
* [[Prototype/PlayerPort]] '''player-port'''
* [[Prototype/PowerSwitch]] '''power-switch'''
* [[Prototype/ProgrammableSpeaker]] '''programmable-speaker'''
* [[Prototype/Pump]] '''pump'''
* [[Prototype/Radar]] '''radar'''
* [[Prototype/Rail]] <abstract>
** [[Prototype/CurvedRail]] '''curved-rail'''
** [[Prototype/StraightRail]] '''straight-rail'''
* [[Prototype/RailSignalBase]] <abstract>
** [[Prototype/RailChainSignal]] '''rail-chain-signal'''
** [[Prototype/RailSignal]] '''rail-signal'''
* [[Prototype/Reactor]] '''reactor'''
* [[Prototype/Roboport]] '''roboport'''
* [[Prototype/SimpleEntity]] '''simple-entity'''
* [[Prototype/SimpleEntity]] '''simple-entity'''
* [[Prototype/SimpleEntityWithOwner]] '''simple-entity-with-owner'''
* [[Prototype/SimpleEntityWithForce]] '''simple-entity-with-force'''
* [[Prototype/SolarPanel]] '''solar-panel'''
* [[Prototype/SpiderLeg]] '''spider-leg'''
* [[Prototype/SpiderLeg]] '''spider-leg'''
* [[Prototype/StorageTank]] '''storage-tank'''
* [[Prototype/TrainStop]] '''train-stop'''
* [[Prototype/TransportBeltConnectable]] <abstract>
** [[Prototype/LinkedBelt]] '''linked-belt'''
** [[Prototype/Loader1x1]] '''loader-1x1'''
** [[Prototype/Loader1x2]] '''loader'''
** [[Prototype/Splitter]] '''splitter'''
** [[Prototype/TransportBelt]] '''transport-belt'''
** [[Prototype/UndergroundBelt]] '''underground-belt'''
* [[Prototype/Tree]] '''tree'''
* [[Prototype/Tree]] '''tree'''
* [[Prototype/Turret]] '''turret'''
** [[Prototype/AmmoTurret]] '''ammo-turret'''
** [[Prototype/ElectricTurret]] '''electric-turret'''
** [[Prototype/FluidTurret]] '''fluid-turret'''
* [[Prototype/Unit]] '''unit'''
* [[Prototype/Vehicle]] <abstract>
** [[Prototype/Car]] '''car'''
** [[Prototype/RollingStock]] <abstract>
*** [[Prototype/ArtilleryWagon]] '''artillery-wagon'''
*** [[Prototype/CargoWagon]] '''cargo-wagon'''
*** [[Prototype/FluidWagon]] '''fluid-wagon'''
*** [[Prototype/Locomotive]] '''locomotive'''
** [[Prototype/SpiderVehicle]] '''spider-vehicle'''
* [[Prototype/Wall]] '''wall'''
</div>
</div>



Revision as of 19:25, 21 January 2022

Template:Prototype parent Abstract base of all entities with health in the game.

Template:Prototype TOC

Extensions

Optional properties

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

   max_health = 50

Template:Prototype property The amount of health automatically regenerated per tick. The entity must be active for this to work.
Trees will regenerate every 60 ticks with healing_per_tick × 60 and they don't need to be active.

  healing_per_tick = 0.01

Template:Prototype property

Template:Prototype property Either one ExplosionDefinition or an array of them. The entities that are spawned in place of this one when it dies.

Template:Prototype property

Template:Prototype property

Template:Prototype property The loot is dropped on the ground when the entity is killed.

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

Template:Prototype property See: Damage

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

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property Whether the resistances of this entity should be hidden in the entity tooltip.

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property Specifies the name(s) of the Prototype/Corpse entity to be used when this entity dies.

Template:Prototype property Sprite drawn on ground under the entity to make it feel more integrated into the ground.

Example

{
    type = "container",
    name = "wooden-chest",
    icon = "__base__/graphics/icons/wooden-chest.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 1, result = "wooden-chest"},
    max_health = 100,
    corpse = "small-remnants",
    collision_box = {{-0.35, -0.35}, {0.35, 0.35}},
    fast_replaceable_group = "container",
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    inventory_size = 16,
    open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
    close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
    vehicle_impact_sound =  { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
    picture =
    {
      filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
      priority = "extra-high",
      width = 46,
      height = 33,
      shift = {0.25, 0.015625}
    },
    circuit_wire_connection_point =
    {
      shadow =
      {
        red = {0.734375, 0.453125},
        green = {0.609375, 0.515625},
      },
      wire =
      {
        red = {0.40625, 0.21875},
        green = {0.40625, 0.375},
      }
    },
    circuit_connector_sprites = get_circuit_connector_sprites({0.1875, 0.15625}, nil, 18),
    circuit_wire_max_distance = 9
  }