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

ChainReaction

From ModEnc
Revision as of 06:19, 18 June 2024 by Crimsonum (talk | contribs) (Updated info on how Tiberium explosion anim is determined)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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: ChainReaction
File(s): art(md).ini
Values: Boolean values: yes or no, true or false, 1 or 0
Default: no
Applicable to: Overlays


Whether this overlay explodes violently when being damaged. This is not to be confused with TiberiumChainReaction on Animations.

The chain reaction effect described below is not working in Red Alert 2 and Yuri's Revenge, because the functions have been removed. Only minor parts of the logic remain.

The effect is triggered in the following three cases:

  • Terrain objects with SpawnsTiberium=yes are destroyed
  • Wave weapons deal ambient damage
  • A warhead deals damage to the cell. If the overlay has Tiberium=yes set, the warhead also must have Tiberium=yes set.

In the latter case, the cell's Tiberium grow stage is also reduced by Damage/10 after the effect. This is the only effect ChainReaction has in Red Alert 2 and later.

The Effect

If the cell's Tiberium grow stage is larger than 1 (of 12 grow steps for the three growing Tiberium types), there's a Grow Stage * 5% chance that it will react. Otherwise, none of the following happens.

The cell's Tiberium grow stage is halved. The number of grow stages removed by this (the other half) is multiplied by the Tiberium's Power, which constitutes the damage to deal. C4Warhead is used to deliver the damage, and the explosion animation is selected from its AnimList. Up to 6 animation indexes are selected from the list, with higher the Power values resulting in higher indexes. The animation selected from this range depends on the grow stage of the Tiberium patch, with more mature patches using higher animation indexes.

Below is the formula for determining the exact animation:

C4Warhead AnimList index [1-based] = trunc(((trunc(Tiberium grow stage [frame, 1-based] / 2) × Power) × 4) / 25) + 1

Each of the cell's eight surrounding cells that have any Tiberium type on them with a growth stage of more than 2 has an 80% probability to get hit with an animation of type INVISO, with a random delay between 15 and 120 frames (1 to 8 seconds on default speed).