ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

PercentAtMax

From ModEnc
Jump to navigation Jump to search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: PercentAtMax
File(s): Rules(md).ini
Values: float
Default: 100%
Applicable to: Warheads


This tag defines the multiplier to damage at the far-end of a Warhead's CellSpread. For objects in between the point of impact, and the CellSpread, the damage is adjusted linearly using this value.

Formula

To understand how damage is distributed across the cells, refer to the below formula:

M = 1 - (1 - P) × (D / S)

where,
M is the multiplier to damage. This is the value used to adjust the final damage.
P is PercentAtMax
S is CellSpread
D is the distance between the object and the center of impact, in cells.


Examples

Let's say there are 4 units around the target area - A is at the dead center of impact, B is 1 cell away, C is 3 cells away, and D is 5 cells away.

[Warhead1]
CellSpread=5.0
PercentAtMax=1.0

In this instance, using the above formula gives us a multiplier of 100% for A, B, C, and D.

Now take the same 4 units, and the warhead below:

[Warhead2]
CellSpread=7.0
PercentAtMax=0.02
Using the above formula gives us
A would still receive (1 - ( 1 - 0.02) * (0 / 7)) = 100% of the damage
B would receive (1 - ( 1 - 0.02) * (1 / 7)) = 86% of the damage
C would receive (1 - ( 1 - 0.02) * (3 / 7)) = 58% of the damage
D would receive (1 - ( 1 - 0.02) * (5 / 7)) = 30% of the damage
and of course, a unit standing exactly 7 cells away from impact would receive (1 - ( 1 - 0.02) * (7 / 7)) = 2% of the damage


See also: Damage calculation over area