Jump to content

PercentAtMax: Difference between revisions

From ModEnc²
en>DCoder
Rewrite
m 5 revisions imported
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|files={{Categ|Rules(md).ini}}
|files={{Categ|Rules(md).ini}}
|values=float
|values=float
|special=None
|default=100%
|default=100%
|types={{Categ|Warhead|Warheads}}
|types={{Categ|Warhead|Warheads}}
|games=[[RA2]], [[YR]]
|ra2=yes
|yr=yes
|rp=yes
}}
}}


This tag defines the multiplier to Damage applied continuously over the impact area outwards. See [[Damage calculation over area]].
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</code>
 
; 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]]''

Latest revision as of 22:00, 31 March 2025

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
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