djcev.com

//

Git Repos / fte_dogmode / qc / obituary.qc

Last update to this file was on 2025-08-13 at 05:20.

Show obituary.qc

//==============================================================================
// obituary.qc
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
void(entity targ, entity inflictor, entity attacker) ClientObituary;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
//----------------------------------------------------------------------
// ClientObituary -- called when a player dies
//----------------------------------------------------------------------
void(entity targ, entity inflictor, entity attacker) ClientObituary =
{
local float rnum;
local string deathstring, deathstring2;

rnum = random ();
deathstring = deathstring2 = "";

// refactored to remove one level of indentation -- CEV
if (targ.classname != "player")
return;

if (attacker.classname == "teledeath")
{
bprint (targ.netname);
bprint (" was telefragged by ");
bprint (attacker.owner.netname);
bprint ("\n");

attacker.owner.frags = attacker.owner.frags + 1;
return;
}

if (attacker.classname == "teledeath2")
{
bprint ("Satan's power deflects ");
bprint (targ.netname);
bprint ("'s telefrag\n");

targ.frags = targ.frags - 1;
return;
}

// 1998-07-26 Pentagram telefrag fix by Zoid/Maddes start
// double 666 telefrag
// (can happen often in deathmatch 4 and levels with more
// than one pentagram)
if (attacker.classname == "teledeath3")
{
bprint (targ.netname);
bprint (" was telefragged by ");
bprint (attacker.owner.netname);
bprint ("'s Satan's power\n");
// 1998-07-26 only tfrag player on spot by Maddes start
// targ.frags = targ.frags - 1;
attacker.owner.frags = attacker.owner.frags + 1;
// 1998-07-26 only tfrag player on spot by Maddes end
return;
}

// 1998-07-26 Pentagram telefrag fix by Zoid/Maddes end
if (attacker.classname == "player")
{
if (targ == attacker)
{
// killed self
attacker.frags = attacker.frags - 1;
bprint (targ.netname);

if (targ.weapon == 64 &&
targ.waterlevel > WATERLEVEL_FEET)
{
bprint (" discharges into the water.\n");
return;
}
if (targ.weapon == ITEM_SEQ_GRENADELAUNCHER)
bprint (" tries to put the pin back in\n");
else
bprint (" becomes bored with life\n");
return;
}
else if ((teamplay == 2) && (targ.team > 0) &&
(targ.team == attacker.team))
{
if (rnum < 0.25)
deathstring = " mows down a teammate\n";
else if (rnum < 0.50)
deathstring = " checks his glasses\n";
else if (rnum < 0.75)
deathstring = " gets a frag for the other "
"team\n";
else
deathstring = " loses another friend\n";
bprint (attacker.netname);
bprint (deathstring);
attacker.frags = attacker.frags - 1;
return;
}
else
{
attacker.frags = attacker.frags + 1;

rnum = attacker.weapon;
if (rnum == ITEM_SEQ_AXE)
{
deathstring = " was ax-murdered by ";
deathstring2 = "\n";
}
if (rnum == ITEM_SEQ_SHOTGUN)
{
deathstring = " chewed on ";
deathstring2 = "'s boomstick\n";
}
if (rnum == ITEM_SEQ_SUPERSHOTGUN)
{
deathstring = " ate 2 loads of ";
deathstring2 = "'s buckshot\n";
}
if (rnum == ITEM_SEQ_NAILGUN)
{
deathstring = " was nailed by ";
deathstring2 = "\n";
}
if (rnum == ITEM_SEQ_SUPERNAILGUN)
{
deathstring = " was punctured by ";
deathstring2 = "\n";
}
if (rnum == ITEM_SEQ_GRENADELAUNCHER)
{
deathstring = " eats ";
deathstring2 = "'s pineapple\n";
if (targ.health < -40)
{
deathstring = " was gibbed by ";
deathstring2 = "'s grenade\n";
}
}
if (rnum == ITEM_SEQ_ROCKETLAUNCHER)
{
deathstring = " rides ";
deathstring2 = "'s rocket\n";
if (targ.health < -40)
{
deathstring = " was gibbed by ";
deathstring2 = "'s rocket\n" ;
}
}
if (rnum == ITEM_SEQ_LIGHTNINGGUN)
{
deathstring = " accepts ";
if (attacker.waterlevel > WATERLEVEL_FEET)
deathstring2 = "'s discharge\n";
else
deathstring2 = "'s shaft\n";
}
bprint (targ.netname);
bprint (deathstring);
bprint (attacker.netname);
bprint (deathstring2);
}
return;
}
else
{
targ.frags = targ.frags - 1;
bprint (targ.netname);

// custom obituary messages
if (inflictor.deathtype != "")
{
bprint (" ");
bprint (inflictor.deathtype);
bprint ("\n");
return;
}
if (attacker.deathtype != "")
{
bprint (" ");
bprint (attacker.deathtype);
bprint ("\n");
return;
}

// killed by a monster?
if (attacker.flags & FL_MONSTER)
{
if (attacker.classname == "monster_army")
bprint (" was shot by a Grunt\n");
if (attacker.classname == "monster_demon1")
bprint (" was eviscerated by a Fiend\n");
if (attacker.classname == "monster_dog")
bprint (" was mauled by a Rottweiler\n");
if (attacker.classname == "monster_dragon")
bprint (" was fried by a Dragon\n");
if (attacker.classname == "monster_enforcer")
bprint (" was blasted by an Enforcer\n");
if (attacker.classname == "monster_fish")
bprint (" was fed to the Rotfish\n");
if (attacker.classname == "monster_hell_knight")
bprint (" was slain by a Death Knight\n");
if (attacker.classname == "monster_knight")
bprint (" was slashed by a Knight\n");
if (attacker.classname == "monster_ogre")
bprint (" was destroyed by an Ogre\n");
if (attacker.classname == "monster_ogre_marksman")
// dumptruck_ds
bprint (" was felled by a Marksman\n");
if (attacker.classname == "monster_oldone")
bprint (" became one with Shub-Niggurath\n");
if (attacker.classname == "monster_oldone2")
// dumptruck_ds
bprint (" became one with Shub-Niggurath\n");
if (attacker.classname == "monster_boss2")
// dumptruck_ds
bprint (" was exploded by Chthon\n");
if (attacker.classname == "monster_boss")
// dumptruck_ds
bprint (" was exploded by Chthon\n");
if (attacker.classname == "monster_shalrath")
bprint (" was exploded by a Vore\n");
if (attacker.classname == "monster_shambler")
bprint (" was smashed by a Shambler\n");
if (attacker.classname == "monster_vomit")
bprint (" was vomited on by a Vomitus\n");
if (attacker.classname == "monster_wizard")
bprint (" was scragged by a Scrag\n");
if (attacker.classname == "monster_zombie")
bprint (" joins the Zombies\n");

return;
}

// tricks and traps
if (attacker.classname == "explo_box" ||
attacker.classname == "play_explosion")
{
bprint (" blew up\n");
return;
}
if (attacker.classname == "func_laser")
{
bprint (" discovered that lasers are hot\n");
return;
}

/* TODO CEV
if ((attacker.solid == SOLID_BSP &&
attacker != world &&
attacker.classname != "togglewall") ||
(inflictor.classname == "func_movewall" &&
!(inflictor.spawnflags & MOVEWALL_TOUCH)))
{
bprint (" was squished\n");
return;
}
*/

if (attacker.classname == "trap_shooter" ||
attacker.classname == "trap_spikeshooter" ||
attacker.classname == "trap_switched_shooter")
{
// bprint (" was spiked\n");
// changed for custom shooters -- dumptruck_ds
bprint (" was unlucky\n");
return;
}
if (attacker.classname == "ltrail_start" ||
attacker.classname == "ltrail_relay")
{
bprint (" had an electrifying experience\n");
return;
}
if (attacker.classname == "fireball")
{
bprint (" ate a lavaball\n");
return;
}
if (attacker.classname == "trigger_changelevel")
{
bprint (" tried to leave\n");
return;
}

// in-liquid deaths
if (targ.deathtype == "drowning")
{
if (random() < 0.5)
bprint (" sleeps with the fishes\n");
else
bprint (" sucks it down\n");
return;
}
if (targ.deathtype == "slime")
{
if (random() < 0.5)
bprint (" gulped a load of slime\n");
else
bprint (" can't exist on slime alone\n");
return;
}
if (targ.deathtype == "lava")
{
if (targ.health < -15)
{
bprint (" burst into flames\n");
return;
}
if (random() < 0.5)
bprint (" turned into hot slag\n");
else
bprint (" visits the Volcano God\n");
return;
}

// fell to their death?
if (targ.deathtype == "falling")
{
bprint (" fell to his death\n");
return;
}

// hell if I know; he's just dead!!!
bprint (" died\n");
}
};
#endif

Return to the top of this page or return to the overview of this repo.

Log obituary.qc

Return to the top of this page or return to the overview of this repo.