A_DamageSiblings
From ZDoom Wiki
A_DamageSiblings (int amount [, string damagetype [, int flags [, string filter [, string species [, int src [, int inflict]]]]]])
Usage
Damages this actor's siblings by the specified amount. Negative values heal the siblings, instead. Remember that the actor that uses this HAS to be spawned with A_SpawnItemEx with the master/child flag.
Parameters
- amount: amount of damage to inflict. Use a negative value to heal.
- damagetype: the type of damage to inflict. Default is "None".
- flags: the following flags can be combined using the | character between the constants names:
- DMSS_FOILINVUL — the actor is damaged even if it is invulnerable.
- DMSS_AFFECTARMOR — the actor's armor is not ignored when being damaged.
- DMSS_KILL — kills the actor. For this to have an effect on invulnerable actors, DMSS_FOILINVUL has to be passed, as well.
- DMSS_NOFACTOR — the affected actor's damage modifiers, if any, are ignored.
- DMSS_FOILBUDDHA — the buddha effect is ignored when dealing the damage.
- DMSS_NOPROTECT — the affected actor's protection powerups, if any, are ignored.
- DMSS_EXFILTER — inverts the case of the class name filter; the calling actor's siblings are only damaged if their class name does not match the value passed to filter.
- DMSS_EXSPECIES — inverts the case of the species filter; the calling actor's siblings are only damaged if their species does not match the value passed to species.
- DMSS_EITHER — the calling actor's siblings are damaged if either of their class name or species matches the values passed to filter and species, respectively.
- DMSS_INFLICTORDMGTYPE — ignores the specified damage type, and instead, uses the damage type of the actor doing the damage (inflictor).
- filter: the actor class to damage. The calling actor's siblings are only damaged if their class name matches the specified filter class. Default is "None".
- species: the actor species to damage. The calling actor's siblings are only damaged if their species matches the specified species filter. Default is "None".
- src: Indicates the actor pointer responsible for dealing the damage. A monster dealing the damage should use AAPTR_DEFAULT, and missiles should use AAPTR_TARGET (so monsters can identify missiles belonging to their owners and infight with them). Default is AAPTR_DEFAULT.
- inflict: The actor doing the actual damage. By changing this, the actor's flags upon the pointed actor are taken into account instead of the calling actor's own.
Examples
This is a monster spawned from a different monster, using the master/child flag. When this monster gets damaged by an attack with the "Curse" damage type, its pain state will trigger A_DamageSiblings, hurting all other monsters of the same type that were spawned by the same master.
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 } }
Children/Master/Siblings relationship codepointers | ||||
---|---|---|---|---|
A_DamageChildren | A_DamageMaster | A_DamageSiblings | A_DamageTarget | A_DamageTracer |
A_KillChildren | A_KillMaster | A_KillSiblings | A_KillTarget | A_KillTracer |
A_RaiseChildren | A_RaiseMaster | A_RaiseSiblings | ||
A_RemoveChildren | A_RemoveMaster | A_RemoveSiblings | A_RemoveTarget | A_RemoveTracer |
Note: Raise and damage functions only work with monsters. Kill functions can be used on monsters and missiles. |