The abstract base of all AttackParameters.
struct
floatfalseBefore an entity can attack, the distance (in tiles) between the entity and target must be less than or equal to this.
floatfalseNumber of ticks in which it will be possible to shoot again. If < 1, multiple shots can be performed in one tick.
floattrueThe minimum distance (in tiles) between an entity and target. If a unit's target is less than this, the unit will attempt to move away before attacking. A flamethrower turret does not move, but has a minimum range. Less than this, it is unable to target an enemy.
floattrueIf this is <= 0, it is set to 1. Arc from 0 to 1, so for example 0.25 is 90°. Used by the flamethrower turret in the base game. Arcs greater than 0.5 but less than 1 will be clamped to 0.5 as targeting in arcs larger than half circle is not implemented.
floattrueUsed when searching for the nearest enemy, when this is > 0, enemies that aren't burning are preferred over burning enemies. Definition of "burning" for this: Entity has sticker attached to it, and the sticker has a spread_fire_entity set.
floattrueA higher penalty will discourage turrets from targeting units that would take longer to turn to face.
floattrueA higher penalty will discourage turrets from targeting units with higher health. A negative penalty will encourage turrets to target units with higher health.
RangeModetruefloattrueIf less than range, the entity will choose a random distance between range and min_attack_distance and attack from that distance.
floattruefloattrueMust be greater than or equal to 0.
floattrueMust be between 0 and 1.
uint32trueNumber of ticks it takes for the weapon to actually shoot after the order for shooting has been made. This also allows to "adjust" the shooting animation to the effect of shooting.
CapsuleActions cannot have attack parameters with non-zero warmup.
floattrueSetting this to anything but zero causes homing projectiles to aim for the predicted location based on enemy movement instead of the current enemy location. If set, this property specifies the distance travelled per tick of the fired projectile.
-- this is same as particle horizontal speed of flamethrower fire stream
lead_target_for_projectile_speed = 0.2* 0.75 * 1.5
uint32trueSetting this to anything but zero causes projectiles to aim for the predicted location based on enemy movement instead of the current enemy location. If set, this property adds a flat number of ticks atop lead_target_for_projectile_speed that the shooter must lead.
floattruedoubletrueAmmoTypetrueCan be mandatory.
"shoot" | "throw" | "consume" | "activate"trueUsed in tooltips to set the tooltip category. It is also used to get the locale keys for activation instructions and speed of the action for the tooltip.
For example, an activation_type of "throw" will result in the tooltip category "thrown" and the tooltip locale keys "gui.instruction-to-throw" and "description.throwing-speed".
LayeredSoundtruePlayed once at the start of the attack if these are ProjectileAttackParameters.
RotatedAnimationtrueCyclicSoundtruePlayed during the attack.
booleantrueArray<AmmoCategoryID>trueMandatory if ammo_category is not defined.
AmmoCategoryIDtrueMandatory if ammo_categories is not defined.
booleantrueProjectile will be creation position and orientation will be collinear with shooter and target (unless offset projectile center is specified). Used for railgun turrets to avoid unexpected friendly fire incidents.