GetObituary

virtual string GetObituary (Actor victim, Actor inflictor, Name mod, bool playerattack)

Usage

Used to retrieve the obituary message to display upon the player's death. The function is not called if the player kills themselves, as the engine uses the self-killed obituary message (OB_KILLEDSELF) in this case.

Parameters

  • victim: a pointer to the killed actor.
  • inflictor: a pointer to the actor that inflicted the damage.
  • mod: the means of death. This is the damage type of the attack which killed victim.
  • playerattack: if this is true, the attack came from a player, and it is either a hitscan or rail attack.

Return value

The return value is a string that is used as the obituary message. If the string is empty, the engine falls back to a default message.

Predefined functionality

If not overridden, the function returns the telefrag-killed message (OB_MONTELEFRAG) if mod is Telefrag. If mod is Melee, and the calling actor's HitObituary is not an empty string, it returns that. If that fails, the calling actor's Obituary is returned.

Examples

One of three obituary messages are chosen if this archvile kills the player.

class Test_Archvile : Archvile
{
    override string GetObituary (Actor victim, Actor inflictor, Name mod, bool playerattack)
    {
        static const string messages[] =
        {
            "%o got blown up by an archvile.",
            "%o was burned to death by an archvile.",
            "An archvile made %o disappear."
        };

        return messages[Random(0, messages.Size() - 1)];
    }
}

See also

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.