A_KillMaster
From ZDoom Wiki
A_KillMaster (string damagetype)
Called by monsters to kill the monster that spawned this one. Currently the only function that sets the necessary information is A_SpawnItemEx. Optionally, a damagetype parameter can be given. Note that damage inflicted by this codepointer is not affected by damage factors.
Monsters spawned with A_CustomMissile are not affected by this. A_CustomMissile was never designed to spawn monsters.
Examples
The following is a variant of the doom imp, a monster spawned by a different monster with the master/child flag. If it gets killed with an attack with the "Curse" damage type, its death state will trigger A_KillMaster, killing the monster who spawned it.
ACTOR SoldierImp : DoomImp { States { Pain.Voodoo: TROO H 2 A_Pain TROO H 50 Goto See Pain.Curse: TROO H 2 A_Pain TROO H 2 A_DamageSiblings(15) Goto See Death: TROO I 8 A_DamageMaster(-25) TROO J 8 A_Scream TROO K 6 TROO L 6 A_NoBlocking TROO M -1 Stop Death.Curse: TROO I 8 A_KillMaster TROO J 8 A_Scream TROO K 6 TROO L 6 A_NoBlocking TROO M -1 Stop } }
| 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. | ||