Damage
| Flag: | Damage |
| File(s): | rules(md).ini, art(md).ini |
| Values: | Signed integers: All whole numbers from -2147483648 to 2147483647; in rare cases, only from -32768 to 32767.
|
| Default: | 0 |
| Applicable to: | Weapons, Particles, VoxelAnims, Animations |
In all cases, this flag specifies how many 'damage points' this weapon/animation/debris/particle delivers. The Verses and other warhead flags can alter this number before it is applied to the affected object(s).
(In Red Alert, this is only applicable to weapons, since the other applicable objects exist only in Tiberian Sun and later.)
IsLocomotor
On weapons whose warheads have IsLocomotor=yes, this specifies the maximum Size of the target that this weapon is allowed to affect. Meaning, if such a weapon has Damage=5, it won't be able to affect AircraftTypes and VehicleTypes which have Size exceeding 5.
- This does not affect targeting and firing, only whether the effect is effective.
Animations
On animations that don't have Bouncer=yes set, damage is dealt on each frame of the animation using the warhead specified in [CombatDamage]→FlameDamage2=. Unlike on other objects, Damage can be specified as a decimal number for such animations. If this value is less than 1, the game keeps track of a damage "counter" that increases by the given amount every time the animation frame is updated. Actual damage, worth of 1 hitpoint, is dealt only when this counter reaches an integer. If the counter is a decimal number when the animation ends, 1 hitpoint of damage is dealt regardless.
- Example
[FIRE1] Damage=.04 LoopCount=4
Suppose this animation is 18 frames long: 18 * 4 loops * 0.04 damage = 2.88 damage in total, which gets rounded up to 3. So, this animation will deal 3 damage using the warhead specified in FlameDamage2.
Animations that do have Bouncer=yes set deal the specified amount of damage on impact with the ground or an object, in an area specified by DamageRadius, using the specified Warhead. The animation must have a valid ExpireAnim value, and must not expire prematurely (i.e. due to completing all frames or loops before impact).
- The range is first determined by [Warheads]→CellSpread=float - cells. For each enclosed cell, [Animations]→DamageRadius=int - leptons is used internally to decide.
- If debris falls into water, only the impacted cell is ever recorded.
Notes
When Damage*Verses < 1, no actual damage will be dealt due to rounding down.
Particles do not retain house information, so they will inflict damage to any troops regardless of affiliation.
About Damage average value:
- If a techno's TurretCount= value is greater than 0 and IsGattling=no, then only the current weapon is used for targeting calculations (for the two multi-weapon cases other than IsGattling, IsChargeTurret=yes restricts usage to (Elite)Weapon1, while Gunner=yes only has the concept of current primary weapon).
- If a techno's TurretCount= value is greater than 0 and IsGattling=yes, then the sum of the Damage and AmbientDamage values of Weapon1 and Weapon2 is calculated, divided by the number of weapons (2), and rounded toward zero. If this value is greater than or equal to 0, the unit is considered to be attacking; otherwise, it is considered to be performing repairs (using the Repair cursor, requiring the target to be not at full health to fire... just like the Repair IFV in vanilla).
- If a techno satisfies neither the condition of TurretCount value greater than 0 and IsGattling=no, then the sum of all weapons' Damage and AmbientDamage is calculated and divided by the number of weapons the unit possesses. This also includes cases such as DeployFireWeapon, OpenTransportWeapon, and NoAmmoWeapon, which are essentially force-use-X-slot-weapon types that specify a weapon index.
Bugs/Side-Effects/Unexpected Limitations
Weapons that have a negative Damage value and have AnimList specified on their associated warheads would cause an Internal Error upon firing.
- This bug has been fixed in Ares 0.2.
Weapons that have a negative Damage value can only affect units of the same type as the firer, so it is impossible to create a repairman-style infantry to restore the HP of vehicles.
- This limitation was removed in Ares 0.D.
Weapons that have a negative Damage value does not use the Verses and PercentAtMax on the warhead.
- This bug has been fixed in Phobos Build#37. They can be made effective by adding ApplyModifiersOnNegativeDamage=yes on the warhead.
Weapons that have a negative Damage value will only affect objects within 8 leptons around the target point even if a larger CellSpread is set.
- This bug has been fixed in Phobos Build#39. CellSpread can be made effective by adding ApplyModifiersOnNegativeDamage=yes on the warhead.
Weapons that have a negative Damage value have a hardcoded search range of 512 leptons.
- Kratos has been changed to adhere to the weapon's Range, and in the KratosPP version, it needs to be manually changed to 2.
Weapons that have a negative Damage value are hardcoded to have an effect equivalent to AG=no on the projectile.
Weapons that have a negative Damage value are hardcoded to directly remove the internal parasite of the object being repaired.
Weapons that have a negative Damage value are hardcoded to prohibit attacking hostile targets. However, in situations where pathfinding rules require a unit to destroy a non-allied unit obstructing its movement to the destination in order to proceed, such weapons will still be considered like conventional weapons. If the enemy unit acting as an obstacle is not at full health[1], the unit will indeed perform repairs on the hostile object.
Footnotes
- ↑ Which meets the firing conditions for the repair weapon.
References
Starting from Phobos Build #45, whether a warhead can directly remove parasite can be customized. Refer to the Phobos documentation.