Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Attack Behavior
  4. Attack Component – Damage

Attack Component – Damage

Damage Settings of the attack component.

  1. Can Deal Damage: Enable this option in so that the attacker can deal damage to its target. If this is disabled, then the attacker can still pick a target and launch an attack but no damage will be dealt to the target.
  2. Unit Damage: Default damage to apply to units per attack.
  3. Building Damage: Default damage to apply to buildings per attack.
  4. Custom Damages: The attacker can also apply different damage points depending on the type of its target. For each custom damage, add an element to this array and input the faction entity’s Code/Category (pick the type and then add the codes/categories to the list) and the Damage value that will be dealt in case the faction entity with that code/category is engaged by this attacker.
  5. Area Attack Enabled: Enable this field in order to allow the attacker to apply an area of effect attack. When enabled, the following fields should be visible.Each element of the Attack Ranges defines a certain range where units and buildings would receive certain damage points. For each element:
    1. Range: Size of the range where units and building will be dealt damage. Make sure that each element has a smaller range than the range values defined for all elements that come after it.
    2. Unit Damage: Damage that will be dealt to units inside the defined range.
    3. Building Damage: Damage that will be dealt to buildings inside the defined range.
    4. Custom Damages: Allows to define custom damage values based on the code or category of the target.
  6. DoT (Damage over Time) Enabled: Enable this field if the attacker can execute damage over time for its target. When enabled the following fields should appear:
    1. Infinite: When enabled, then the DoT will be applied to the target until it is destroyed or the DoT effect is stopped using an external component.
    2. Duration: In the case where the DoT is not infinite, this presents the time, during which damage will be applied to the target.
    3. Cycle Duration: Each cycle, the defined damage will be applied to the target.
  7. Effect: An Effect Object that spawns on the target’s position whenever an attack is applied.
  8. Effect Life Time: The life time (in seconds) of the above effect object, during which the effect will be visible on the target.
  9. Reload Dealt Damage: The damage that the faction entity deals to its target can be retrieved using the public method “GetDealtDamage()” in the attack component. When this field is enabled, then the dealt damage counter will be reset every time a new target is assigned.

How can we help?