A_DamageTracer

From ZDoom Wiki
Jump to: navigation, search

A_DamageTracer (int amount [, string damagetype [, int flags [, string filter [, string species [, int src [, int inflict]]]]]])

Usage

Damages the calling actor's tracer by the specified amount. Negative values heal the tracer, instead.

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 tracer 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 tracer is only damaged if its species does not match the value passed to species.
    • DMSS_EITHER — the calling actor's tracer 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 tracer 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 tracer 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.

Examples

This is a modified revenant, whose projectile uses A_DamageTracer to cause damage to the target for every second its projectile flies.


ACTOR CurseRevenant : Revenant
{
 HitObituary "%o was punched by a cursed revenant."
 Obituary "%o was killed by the presence of a cursed revenant's fireball."
 States
 {
 Missile:
   SKEL J 0 Bright A_FaceTarget
   SKEL J 10 Bright A_FaceTarget
   SKEL K 10 A_Custommissile ("CurseTracer", 40)
   SKEL K 10 A_FaceTarget
   Goto See
 }
}

ACTOR CurseTracer : RevenantTracer
{
 States
 {
 Spawn:
   FATB ABABABAB 4 Bright A_SeekerMissile (45, 90, SMF_PRECISE)
   FATB A 3 Bright A_DamageTracer (1)
   Loop
 Death:
   FBXP A 8 Bright
   FBXP B 6 Bright
   FBXP C 4 Bright
   Stop
 }
}