Rain of Chaos
Contract
ANrc is TFT/ROC CAbilityRainOfChaos (parent AAsm). TFT ANr3 is an
AbilityData alias whose code is ANrc (button layout variant), so both
share CAbilityRainOfChaos and read their own rows through
abilityitem_t.code.
Rain of Chaos is not Rain of Fire: it is a point-target simple spell with
no AB_CHANNEL. After cast, caster->channel.code stays 0 and the caster
may walk away; a dedicated thinker owns the remaining landings.
| Field | Meta | Meaning |
|---|---|---|
DataA |
Nrc1 |
Inferno ability rawcode (abilCode), stock ANin — use S_SpellDataId |
DataB |
Nrc2 |
Number of units created |
Dur |
— | Delay between landings (seconds) |
Area |
— | Scatter radius around the cast point |
Rng / Cool / Cost |
— | Cast range, cooldown, mana (stock cost 0) |
Stock TFT/ROC ANrc L1: DataA=ANin, DataB=2, Dur=1, Area=900,
Rng=1000, Cool=120. L2/L3 raise DataB and shorten Dur. ANr3 authors
DataB=2 as the button variant.
Each landing calls S_InfernoLand on the Inferno row linked by DataA (damage,
stun, DataC impact delay, UnitID + DataB timed life). See Inferno.
Data Flow
AbilityData.slk (ANrc / ANr3)
-> DataA (Inferno abilCode), DataB (count), Dur (interval), Area
CAbilityRainOfChaos
-> spawn thinker at cast point; first landing immediate
rain_of_chaos_think
-> S_InfernoLand(inferno row) -> delay/damage/stun/summon
-> schedule next landing after Dur; free when count exhausted
Zero Dur cannot schedule further landings: the thinker logs and frees
(Flame Strike-style), rather than spinning every frame.
Known Pitfalls
ability_audit -rawprints DataA asANin(abilCode). Always useS_SpellDataIdfor DataA;S_SpellDatareturns 0 for that cell.- Do not add
AB_CHANNELor clear the thinker when the caster moves. That is Rain of Fire behavior, not Rain of Chaos. - Scatter uses
rand()insideArea. Tests assert count, ownership,class_id, andBTLF, not exact coordinates.
Diagnostic Workflow
Verification
Focused tests cover procedure/flags for ANrc/ANr3, authored non-stock
count/interval/UnitID, immediate first landing, Dur-spaced later landings via
G_RunEntities, scatter within Area, and continuation after the caster moves.
Remaining Gaps
- Effect edict
XErc/CEffectRainOfChaospresentation. - Inferno tree destruction and meteor presentation (see inferno.md).