A_DamageChildren
From ZDoom Wiki
A_DamageChildren (int amount, [string type])
Damages this actor's children by the specified amount. Negative values heal the children, instead. Remember that the actor to be damaged HAS to be spawned with A_SpawnItemEx with the master/child flag, provided they are not invulnerable.
- amount: Amount of damage to inflict. Use a negative value to heal.
- type: The type of damage to inflict.
Examples
The following actor is a variant of the doom imp, which will spawn clones of itself to attack you. If you attack the master, its painstate will trigger A_DamageChildren, with the "voodoo" damage type. This makes all the spawned clones of the monster become temporarily stunned with pain.
ACTOR VoodooLeaderImp : DoomImp { Health 100 Mass 1000 PainChance 255 States { Missile: TROO EF 8 A_FaceTarget TROO G 6 A_SpawnItemEx("SoldierImp", 50, 50, 60, 0, 0, 0, 0, SXF_SETMASTER) Goto See Pain: TROO H 2 TROO H 1 A_Pain TROO H 1 A_DamageChildren(1, "Voodoo") Goto See } }
Here is the soldier imp, the monster spawned by the voodoo leader imp.
ACTOR SoldierImp : DoomImp { States { Pain.Voodoo: TROO H 2 A_Pain TROO H 50 Goto See } }
| Children/Master/Siblings relationship codepointers | ||
|---|---|---|
| A_DamageChildren | A_DamageMaster | A_DamageSiblings |
| A_KillChildren | A_KillMaster | A_KillSiblings |
| A_RaiseChildren | A_RaiseMaster | A_RaiseSiblings |
| A_RemoveChildren | A_RemoveMaster | A_RemoveSiblings |
| Note: These functions only work with monsters. | ||