Types/BaseAttackParameters: Difference between revisions
Deadlock989 (talk | contribs) |
(0.18.0: ammo_categories and health and rotate penalties added) |
||
Line 34: | Line 34: | ||
Used 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 [[Prototype/Sticker#spread_fire_entity|spread_fire_entity]] set. | Used 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 [[Prototype/Sticker#spread_fire_entity|spread_fire_entity]] set. | ||
=== rotate_penalty === | |||
'''Type''': [[Types/float]] | |||
'''Default''': 0 | |||
=== health_penalty === | |||
'''Type''': [[Types/float]] | |||
'''Default''': 0 | |||
=== min_attack_distance === | === min_attack_distance === | ||
Line 51: | Line 61: | ||
'''Default''': 1 | '''Default''': 1 | ||
Must be greater than or equal to 0. | |||
=== cooldown_deviation === | === cooldown_deviation === | ||
Line 56: | Line 68: | ||
'''Default''': 0 | '''Default''': 0 | ||
Must be between 0 and 1. | |||
=== warmup === | === warmup === | ||
Line 72: | Line 86: | ||
<syntaxhighlight lang="lua">lead_target_for_projectile_speed = 0.2* 0.75 * 1.5, -- this is same as particle horizontal speed of flamethrower fire stream</syntaxhighlight> | <syntaxhighlight lang="lua">lead_target_for_projectile_speed = 0.2* 0.75 * 1.5, -- this is same as particle horizontal speed of flamethrower fire stream</syntaxhighlight> | ||
Presumably this should be set to the projectile speed to make the unit/turret lead their projectiles. | Presumably this should be set to the projectile speed to make the unit/turret lead their projectiles. | ||
=== movement_slow_down_cooldown === | |||
'''Type''': [[Types/float]] | |||
'''Default''': <code>cooldown</code> | |||
=== movement_slow_down_factor === | === movement_slow_down_factor === | ||
Line 77: | Line 96: | ||
'''Default''': 1 | '''Default''': 1 | ||
=== ammo_type === | === ammo_type === | ||
Line 87: | Line 101: | ||
Can be mandatory. | Can be mandatory. | ||
=== sound === | === sound === | ||
Line 111: | Line 120: | ||
'''Default''': false | '''Default''': false | ||
=== ammo_categories === | |||
'''Type''': [[Types/table]] (array) [[Types/string]] | |||
Names of [[Prototype/AmmoCategory|Prototype/AmmoCategories]]. | |||
=== ammo_category === | |||
'''Type''': [[Types/string]] | |||
The name of a [[Prototype/AmmoCategory]]. Mandatory if <code>ammo_type</code> and <code>ammo_category</code> is not given, otherwise ignored. |
Revision as of 13:49, 30 April 2020
The abstract base of all attack parameters.
Extensions
Mandatory properties
range
Type: Types/float
cooldown
Type: Types/float
Number of ticks in which it will be possible to shoot again. If < 1, multiple shots can be performed in one tick.
Optional properties
min_range
Type: Types/float
Default: 0
turn_range
Type: Types/float
Default: 1
If this is <= 0, it is set to 1.
fire_penalty
Type: Types/float
Default: 0
Used 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.
rotate_penalty
Type: Types/float
Default: 0
health_penalty
Type: Types/float
Default: 0
min_attack_distance
Type: Types/float
Default: range
If less than range
, the entity will choose a random distance between range
and min_attack_distance
and attack from that distance.
damage_modifier
Type: Types/float
Default: 1
ammo_consumption_modifier
Type: Types/float
Default: 1
Must be greater than or equal to 0.
cooldown_deviation
Type: Types/float
Default: 0
Must be between 0 and 1.
warmup
Type: Types/uint32
Default: 0
Number 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.
lead_target_for_projectile_speed
Type: Types/float
Default: 0
Base game uses
lead_target_for_projectile_speed = 0.2* 0.75 * 1.5, -- this is same as particle horizontal speed of flamethrower fire stream
Presumably this should be set to the projectile speed to make the unit/turret lead their projectiles.
movement_slow_down_cooldown
Type: Types/float
Default: cooldown
movement_slow_down_factor
Type: Types/double
Default: 1
ammo_type
Type: Types/AmmoType
Can be mandatory.
sound
Type: Types/Sound
animation
Type: Types/RotatedAnimation
cyclic_sound
Type: Types/table
Table with the following mandatory key/value pairs:
- begin_sound - Types/Sound
- middle_sound - Types/Sound
- end_sound - Types/Sound
use_shooter_direction
Type: Types/bool
Default: false
ammo_categories
Type: Types/table (array) Types/string
Names of Prototype/AmmoCategories.
ammo_category
Type: Types/string
The name of a Prototype/AmmoCategory. Mandatory if ammo_type
and ammo_category
is not given, otherwise ignored.