A_DamageTracer

From ZDoom Wiki
Jump to navigation Jump to search

void A_DamageTracer (int amount [, name damagetype [, int flags [, class<Actor> filter [, name species [, int src [, int inflict]]]]]])

Usage

Damages the calling actor's tracer actor by the specified amount. Negative amounts heal it, instead. This function cannot damage player actors which are under the effect of god2, and they still survive with one point of health if under the effect of buddha2.

Parameters

  • amount: the amount of damage to inflict. Negative amounts heal. An amount of one million or higher is treated specially, and results in killing the actor regardless of health or any damage modifiers that may be in effect.
  • 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. For this flag to work, an inflictor is required (see inflict below). This flag is ignored if the actor is a player.
    • DMSS_FOILBUDDHA — if the damage is enough to kill the actor, it dies even if it is under the effect of buddha. For this flag to work, an inflictor is required (see inflict below). This flag is ignored if the actor is a player.
    • DMSS_NOPROTECT — damage bypasses the damage-modifying capability of items in the actor's inventory. A protection powerup is an example of such items.
    • DMSS_NOFACTOR — damage bypasses the the actor's damage factors.
    • DMSS_AFFECTARMOR — damage does not bypass the damage-absorbing capability of items in the actor's inventory. An armor is an example of such items.
    • DMSS_KILL — inflicts an amount of damage which is equal to the sum of the actor's current health and amount, killing the actor under normal conditions. This flag bypasses the actor's damage factors and the damage-absorbing capability (but not the damage-modifying one) of items in the actor's inventory.
    • DMSS_EXFILTER — inverts the case of the class name filter; the actor 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 actor is only damaged if its species does not match the value passed to species.
    • DMSS_EITHER — the actor is damaged if either 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 actor is only damaged if its class name matches the specified class. Default is null(ZScript only)/"None"(DECORATE only).
  • species: the actor species to damage. The actor is only damaged if its species matches the specified species. Default is "None".
  • src: the actor responsible for the damage (source). This is an actor pointer. If this is set to AAPTR_NULL, the actor is damaged without a source. Default is AAPTR_DEFAULT, which is the calling actor itself.
  • inflict: the actor doing the damage (inflictor). This is an actor pointer. If this is set to AAPTR_NULL, the actor is damaged without an inflictor (note that doing so renders both DMSS_FOILINVUL and DMSS_FOILBUDDHA ineffective). Default is AAPTR_DEFAULT, which is the calling actor itself.

Examples

This revenant's missile causes damage to the actor it seeks (tracer) every second while in-flight.

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_SpawnProjectile("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, "None", DMSS_NOPROTECT)
        Loop
    }
}