From ZDoom Wiki
A_DamageTarget (int amount [, string damagetype [, int flags [, string filter [, string species [, int src [, int inflict]]]]]])
Damages the calling actor's target by the specified amount. Negative values heal the target, instead.
- 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 target is only damaged if its class name does not match the value passed to filter.
- DMSS_EXSPECIES — inverts the case of the species filter; the calling actor's target is only damaged if its species does not match the value passed to species.
- DMSS_EITHER — the calling actor's target is damaged if either of its 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 target is only damaged if its class name matches the specified filter class. Default is "None".
- species: the actor species to damage. The calling actor's target is only damaged if its 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.
|Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.|