Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# AttackParameters - Runtime Docs

## AttackParameters :: table

#### Table fields

type | :: `"projectile"` or `"stream"` or `"beam"` | The type of AttackParameter.
The type of AttackParameter.
range | :: float | Maximum range of attack.
Maximum range of attack.
min_range | :: float | Minimum range of attack. Used with flamethrower turrets to prevent self-immolation.
Minimum range of attack. Used with flamethrower turrets to prevent self-immolation.
range_mode | :: RangeMode | Defines how the range is determined.
Defines how the range is determined.
fire_penalty | :: float | When searching for the nearest enemy to attack, `fire_penalty` is added to the enemy's distance if they are on fire.
When searching for the nearest enemy to attack, `fire_penalty` is added to the enemy's distance if they are on fire.
rotate_penalty | :: float | When searching for an enemy to attack, a higher `rotate_penalty` will discourage targeting enemies that would take longer to turn to face.
When searching for an enemy to attack, a higher `rotate_penalty` will discourage targeting enemies that would take longer to turn to face.
health_penalty | :: float | When searching for an enemy to attack, a higher `health_penalty` will discourage targeting enemies with high health. A negative penalty will do the opposite.
When searching for an enemy to attack, a higher `health_penalty` will discourage targeting enemies with high health. A negative penalty will do the opposite.
min_attack_distance | :: float | If less than `range`, the entity will choose a random distance between `range` and `min_attack_distance` and attack from that distance. Used for spitters.
If less than `range`, the entity will choose a random distance between `range` and `min_attack_distance` and attack from that distance. Used for spitters.
turn_range | :: float | The arc that the entity can attack in as a fraction of a circle. A value of `1` means the full 360 degrees.
The arc that the entity can attack in as a fraction of a circle. A value of `1` means the full 360 degrees.
damage_modifier | :: float | Multiplier applied to the damage of an attack.
Multiplier applied to the damage of an attack.
ammo_consumption_modifier | :: float | Multiplier applied to the ammo consumption of an attack.
Multiplier applied to the ammo consumption of an attack.
cooldown | :: float | Minimum amount of ticks between shots. If this is less than `1`, multiple shots can be performed per tick.
Minimum amount of ticks between shots. If this is less than `1`, multiple shots can be performed per tick.
warmup | :: uint32 | Number of ticks it takes for the weapon to actually shoot after it has been ordered to do so.
Number of ticks it takes for the weapon to actually shoot after it has been ordered to do so.
movement_slow_down_factor | :: double |
movement_slow_down_cooldown | :: float |
ammo_type | :: AmmoType? |
ammo_categories | :: array[string]? | List of the names of compatible LuaAmmoCategoryPrototypes.
List of the names of compatible LuaAmmoCategoryPrototypes.

Other attributes may be specified depending on `type`:

#### `projectile`

projectile_center | :: Vector |
projectile_creation_distance | :: float |
projectile_orientation_offset | :: float |
shell_particle | :: CircularParticleCreationSpecification? |
projectile_creation_parameters | :: CircularProjectileCreationSpecification? |

#### `stream`

gun_barrel_length | :: float |
gun_center_shift | :: GunShift4Way |
fluid_consumption | :: float |
fluids | :: array[AttackParameterFluid]? |
projectile_creation_parameters | :: CircularProjectileCreationSpecification? |

Concept used in

- LuaEntityPrototype::attack_parameters
- LuaEntityPrototype::revenge_attack_parameters
- LuaEquipmentPrototype::attack_parameters
- LuaItemPrototype::attack_parameters
- CapsuleAction