Prototype/Projectile: Difference between revisions
Muppet9010 (talk | contribs) (→Optional properties: add a note to hit_at_collision_position to elaborate on its effect) |
mNo edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
== Mandatory properties == | == Mandatory properties == | ||
This prototype inherits all the properties from [[Prototype/Entity]]. | This prototype inherits all the properties from [[Prototype/Entity]]. | ||
{{Prototype property|acceleration|[[Types/double|double]]}} | {{Prototype property|acceleration|[[Types/double|double]]}} | ||
Must be != 0 if turning_speed_increases_exponentially_with_projectile_speed is true. | |||
== Optional properties == | == Optional properties == | ||
{{Prototype property|animation|[[Types/Animation|Animation]]|optional=true}} | |||
{{Prototype property|rotatable|[[Types/bool|bool]]|true|optional=true}} | {{Prototype property|rotatable|[[Types/bool|bool]]|true|optional=true}} | ||
Whether the animation of the projectile is rotated to match the direction of travel. | |||
{{Prototype property|enable_drawing_with_mask|[[Types/bool|bool]]|false|optional=true}} | {{Prototype property|enable_drawing_with_mask|[[Types/bool|bool]]|false|optional=true}} | ||
{{Prototype property|direction_only|[[Types/bool|bool]]|false|optional=true}} | {{Prototype property|direction_only|[[Types/bool|bool]]|false|optional=true}} | ||
Setting this to true can be used to disable projectile homing behaviour. | |||
{{Prototype property|hit_at_collision_position|[[Types/bool|bool]]|false|optional=true}} | {{Prototype property|hit_at_collision_position|[[Types/bool|bool]]|false|optional=true}} | ||
Line 29: | Line 32: | ||
{{Prototype property|max_speed|[[Types/double|double]]|MAX_DOUBLE|optional=true}} | {{Prototype property|max_speed|[[Types/double|double]]|MAX_DOUBLE|optional=true}} | ||
Must be greater than or equal to 0. | Must be greater than or equal to 0. | ||
{{Prototype property|turn_speed|[[Types/float|float]]|1|optional=true}} | |||
Must be greater than or equal to 0. | |||
{{Prototype property|speed_modifier|[[Types/vector|vector]]|<nowiki>{1, 1}</nowiki>|optional=true}} | |||
{{Prototype property|height|[[Types/double|double]]|1|optional=true}} | {{Prototype property|height|[[Types/double|double]]|1|optional=true}} | ||
Line 43: | Line 51: | ||
{{Prototype property|hit_collision_mask|[[Types/CollisionMask|CollisionMask]]|<nowiki>{"player-layer", "train-layer"}</nowiki>|optional=true}} | {{Prototype property|hit_collision_mask|[[Types/CollisionMask|CollisionMask]]|<nowiki>{"player-layer", "train-layer"}</nowiki>|optional=true}} | ||
{{Prototype property|turning_speed_increases_exponentially_with_projectile_speed|[[Types/bool|bool]]|false|optional=true}} | |||
{{Prototype property|shadow|[[Types/Animation|Animation]]|optional=true}} | {{Prototype property|shadow|[[Types/Animation|Animation]]|optional=true}} |
Latest revision as of 16:08, 7 April 2022
Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/Projectile
Entity with limited lifetime that can hit other entities and has triggers when this happens.
Mandatory properties
This prototype inherits all the properties from Prototype/Entity.
acceleration
Type: double
Must be != 0 if turning_speed_increases_exponentially_with_projectile_speed is true.
Optional properties
animation
Type: Animation
rotatable
Type: bool
Default: true
Whether the animation of the projectile is rotated to match the direction of travel.
enable_drawing_with_mask
Type: bool
Default: false
direction_only
Type: bool
Default: false
Setting this to true can be used to disable projectile homing behaviour.
hit_at_collision_position
Type: bool
Default: false
When true the entity is hit at the position on its collision box the projectile first collides with. When false the entity is hit at its own position.
force_condition
Type: ForceCondition
Default: "all"
piercing_damage
Type: float
Default: 0
Whenever an entity is hit by the projectile, this number gets reduced by the health of the entity. If the number is then below 0, the final_action
is applied and the projectile destroyed. Otherwise, the projectile simply continues to its destination.
max_speed
Type: double
Default: MAX_DOUBLE
Must be greater than or equal to 0.
turn_speed
Type: float
Default: 1
Must be greater than or equal to 0.
speed_modifier
Type: vector
Default: {1, 1}
height
Type: double
Default: 1
action
Type: Trigger
Executed when the projectile hits something.
final_action
Type: Trigger
Executed when the projectile hits something, after action
and only if the entity that was hit was destroyed. The projectile is destroyed right after the final_action.
light
Type: LightDefinition
smoke
Type: Array of SmokeSource
hit_collision_mask
Type: CollisionMask
Default: {"player-layer", "train-layer"}
turning_speed_increases_exponentially_with_projectile_speed
Type: bool
Default: false
shadow
Type: Animation