2001-07-17 05:58:10 +00:00
/*======================================================
CLIENT . QC Custom TeamFortress v3 .2
( c ) TeamFortress Software Pty Ltd 29 / 2 / 97
( c ) William Kerney 16 / 9 / 00
( c ) Craig Hauser 19 / 3 / 00
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Handles obituaries , what happens when a client dies , respawns ,
connects & disconnects , and when a map changes levels
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
2001-07-23 20:52:47 +00:00
# include "defs.qh"
2001-07-17 05:58:10 +00:00
// prototypes
void ( ) W_WeaponFrame ;
void ( ) W_SetCurrentAmmo ;
void ( ) player_pain ;
void ( ) player_stand1 ;
void ( vector org ) spawn_tfog ;
void ( vector org , entity death_owner ) spawn_tdeath ;
float modelindex_eyes , modelindex_player , modelindex_null ;
float ( float v ) anglemod ;
//void () SetUpChrisRound;//-
void ( ) PrematchBegin ;
void ( ) TeamAllPlayers ;
//void (float winner) RoundStop;//-
//void () UpdateScores;
//void () roundtimer_think;//-
//void () EndRound;//-
// TeamFortress prototypes
void ( ) TeamFortress_MOTD ;
void ( ) TeamFortress_CheckTeamCheats ;
2001-07-24 16:03:08 +00:00
//float(float tno) TeamGetColor; //- OfN - not used here
2001-07-17 05:58:10 +00:00
void ( entity Viewer , float pc , float rpc ) TeamFortress_PrintClassName ;
void ( entity Viewer , float pc ) TeamFortress_PrintJobName ;
void ( ) TeamFortress_RemoveTimers ;
void ( float Suicided ) TeamFortress_SetupRespawn ;
void ( ) TeamFortress_ShowTF ;
float ( float pc ) IsLegalClass ;
void ( ) SetupTeamEqualiser ;
# ifdef QUAKE_WORLD
void ( entity p ) SetTeamName ;
# endif
void ( float number ) decrement_team_ammoboxes ;
void ( ) TeamFortress_DetonatePipebombs ;
void ( float f ) decrement_team_pipebombs ;
void ( ) PlayerObserverMode ;
// Hook prototypes
void ( ) Service_Grapple ;
// TeamFortressMap prototypes
void ( entity AD ) ParseTFDetect ;
entity ( float ino ) Finditem ;
void ( entity Item , entity AP , entity Goal ) tfgoalitem_GiveToPlayer ;
void ( entity Goal , entity AP , entity ActivatingGoal ) AttemptToActivate ;
void ( ) CTF_FlagCheck ;
//WK
void ( ) DropToCustomClassGen ;
void ( entity p ) TeamFortress_SetSpeed ;
void ( ) kill_my_demon ;
void ( ) DetonateAllGuns ; // SB
void ( ) Boot_Flamer_stream_touch ;
void ( entity foo , float bar ) makeImmune ;
// SB Extern
void ( entity targ ) GetRank ;
//void() SwitchFromCamera;
//==============// ofn
void ( entity mine_owner ) DetonateMines ;
void ( entity player ) RemoveHolo ;
string ( entity thebuilding ) GetBuildingName ;
string ( entity themonster ) GetMonsterName ;
void ( entity attacker ) MonsterKill ;
void ( ) DetonateAllGunsForced ;
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
LEVEL CHANGING / INTERMISSION
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
string nextmap ;
float intermission_running ;
float intermission_exittime ;
/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
This is the camera point for the intermission .
Use mangle instead of angle , so you can set pitch or roll as well as yaw . ' pitch roll yaw '
*/
void ( ) info_intermission =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
void ( ) SetChangeParms =
{
if ( self . health < = 0 )
{
SetNewParms ( ) ;
return ;
}
// remove items
2001-07-23 20:52:47 +00:00
self . items = self . items - ( self . items & ( IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD ) ) ;
2001-07-17 05:58:10 +00:00
// cap super health
if ( self . health > 100 )
self . health = 100 ;
if ( self . health < 50 )
self . health = 50 ;
parm1 = self . items ;
parm2 = self . health ;
parm3 = self . armorvalue ;
if ( self . ammo_shells < 25 )
parm4 = 25 ;
else
parm4 = self . ammo_shells ;
parm5 = self . ammo_nails ;
parm6 = self . ammo_rockets ;
parm7 = self . ammo_cells ;
parm8 = self . current_weapon ;
parm9 = self . armortype * 100 ;
// TeamFortress Parameters
parm10 = toggleflags ; // Store the global ToggleFlag settings
parm11 = 0 ; // Random Playerclass
parm12 = 0 ;
# ifdef COOP_MODE
2001-07-23 20:52:47 +00:00
if ( toggleflags & TFLAG_CLASS_PERSIST )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_RANDOMPC )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
parm11 = ( parm11 | TFSTATE_RANDOMPC ) ;
self . playerclass = 1 + floor ( random ( ) * ( PC_RANDOM - 1 ) ) ;
2001-07-17 05:58:10 +00:00
while ( ! IsLegalClass ( self . playerclass ) )
2001-07-23 20:52:47 +00:00
self . playerclass = 1 + floor ( random ( ) * ( PC_RANDOM - 1 ) ) ;
2001-07-17 05:58:10 +00:00
}
parm12 = self . playerclass ; // save the playerclass between levels in parm12
} // if the toggleflag CLASS_PERSIST is set
# endif
# ifdef STATUSBAR
parm13 = self . StatusBarRes ;
parm14 = self . StatusBarSize ;
# endif
# ifdef QUAKE_WORLD
parm15 = self . admin_flag ; //CH Pass along admin status :)
# endif
} ;
void ( ) SetNewParms =
{
parm1 = 0 ;
parm2 = 100 ;
parm3 = 0 ;
parm4 = 25 ;
parm5 = 0 ;
parm6 = 0 ;
parm6 = 0 ;
parm8 = 1 ;
parm9 = 0 ;
// TeamFortress Parameters
parm10 = 0 ;
parm11 = 0 ;
parm12 = 0 ;
parm13 = 0 ;
parm14 = 0 ;
parm15 = 0 ;
} ;
// This think kicks in 30 seconds into the map to
// turn autoteam on.
void ( ) autoteam_think =
{
local float loopc ;
local entity other , oself ;
// if (chris)
// SetUpChrisRound();
// if (!chris)
PrematchBegin ( ) ;
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_AUTOTEAM ;
2001-07-17 05:58:10 +00:00
dremove ( self ) ;
} ;
void ( ) PrematchBegin =
{
if ( prematch )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " <EFBFBD> The game has now started! <10> \n " ) ;
2001-07-17 05:58:10 +00:00
other = find ( world , classname , " player " ) ;
while ( other ! = world )
{
2001-07-23 20:52:47 +00:00
other . is_abouttodie = TRUE ;
other . items = other . items - ( other . items & IT_INVULNERABILITY ) ;
2001-07-17 05:58:10 +00:00
other . invincible_time = 0 ;
other . invincible_finished = 0 ;
2001-07-23 20:52:47 +00:00
other . effects = other . effects - ( other . effects & EF_DIMLIGHT ) ;
TF_T_Damage ( other , world , world , other . health + 20 , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
other = find ( other , classname , " player " ) ;
}
// - OfN - wtf
/*other = find(world, classname, "grunty");
while ( other ! = world )
{
2001-07-23 20:52:47 +00:00
other . is_abouttodie = TRUE ;
other . items = other . items - ( other . items & IT_INVULNERABILITY ) ;
2001-07-17 05:58:10 +00:00
other . invincible_time = 0 ;
other . invincible_finished = 0 ;
2001-07-23 20:52:47 +00:00
other . effects = other . effects - ( other . effects & EF_DIMLIGHT ) ;
TF_T_Damage ( other , world , world , other . health + 20 , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
other = find ( other , classname , " grunty " ) ;
} */
}
/* if (chris)
{
if ( self . classname = = " prematch_timer " )
dremove ( self ) ;
else
SetUpChrisRound ( ) ;
} */
} ;
/*void () SetUpChrisRound =
{
local entity other , oself ;
// Make sure everyone is on a team
TeamAllPlayers ( ) ;
// Clean up team player counts
team1total = 0 ;
team2total = 0 ;
team3total = 0 ;
team4total = 0 ;
oself = self ;
other = find ( world , classname , " player " ) ;
while ( other ! = world )
{
if ( livesperguy > 0 )
{
if ( other . team_no = = 1 ) team1total = team1total + livesperguy ;
if ( other . team_no = = 2 ) team2total = team2total + livesperguy ;
if ( other . team_no = = 3 ) team3total = team3total + livesperguy ;
if ( other . team_no = = 4 ) team4total = team4total + livesperguy ;
other . lives = livesperguy ;
}
self = other ;
kill_my_demon ( ) ;
DetonateAllGuns ( ) ;
2001-07-23 20:52:47 +00:00
TF_T_Damage ( other , world , world , other . health + 20 , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
other = find ( other , classname , " player " ) ;
}
newmis = spawn ( ) ;
newmis . classname = " chris_round_timer " ;
newmis . nextthink = time + roundtime ;
newmis . think = roundtimer_think ;
} ; */
/*void() roundtimer_think =
{
RoundStop ( 0 ) ;
dremove ( self ) ;
} ; */
void ( ) TeamAllPlayers =
{
local entity other , oself ;
other = find ( world , classname , " player " ) ;
while ( other ! = world )
{
if ( other . team_no < = 0 & & ! other . has_disconnected )
{
oself = self ;
self = other ;
Menu_Team_Input ( 5 ) ;
self = oself ;
}
other = find ( other , classname , " player " ) ;
}
} ;
/*void (float winner) RoundStop =
{
if ( winner = = 0 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The round has ended due to time. \n " ) ;
2001-07-17 05:58:10 +00:00
else
{
if ( winner = = 1 )
{
team1rounds = team1rounds + 1 ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The blue team wins the round. \n " ) ;
2001-07-17 05:58:10 +00:00
}
if ( winner = = 2 )
{
team2rounds = team2rounds + 1 ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " This round goes to the red team. \n " ) ;
2001-07-17 05:58:10 +00:00
}
if ( winner = = 3 )
{
team3rounds = team3rounds + 1 ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The yellow team are sponsored by SB-1 Tech and have won this round. \n " ) ;
2001-07-17 05:58:10 +00:00
}
if ( winner = = 4 )
{
team4rounds = team4rounds + 1 ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The green team are the winners of this round. \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
UpdateScores ( ) ;
newmis = spawn ( ) ;
newmis . nextthink = time + 1 ;
newmis . think = EndRound ;
} ; */
/*void() UpdateScores =
{
local entity guy ;
guy = find ( other , classname , " player " ) ;
while ( guy ! = world )
{
if ( guy . team_no = = 1 )
{
guy . frags = team1rounds * 10 ;
guy . real_frags = team1rounds * 10 ;
}
else if ( guy . team_no = = 2 )
{
guy . frags = team2rounds * 10 ;
guy . real_frags = team2rounds * 10 ;
}
else if ( guy . team_no = = 3 )
{
guy . frags = team3rounds * 10 ;
guy . real_frags = team3rounds * 10 ;
}
else if ( guy . team_no = = 4 )
{
guy . frags = team4rounds * 10 ;
guy . real_frags = team4rounds * 10 ;
}
guy = find ( guy , classname , " other " ) ;
}
} ; */ /////////////??/////////////7
/*void() EndRound =
{
local entity roundtimer , prematchtimer ;
local float winner , prematchtime ;
local string st ;
// Kill the round timer
other = find ( world , classname , " chris_round_timer " ) ;
// I deliberately don't do a contingency check here - if it screws up I wanna know about it
dremove ( other ) ;
st = infokey ( world , " pm " ) ;
if ( st = = string_null ) // if 'pm' isn't set, try 'prematch'
st = infokey ( world , " prematch " ) ;
if ( st = = " on " ) // if it reads 'on', do a 30 second prematch
prematchtime = time + 30 ;
else // if it doesn't read 'on'...
prematchtime = stof ( st ) ; // turn the string into a float
if ( prematchtime ) // if we have prematch
{
prematch = time + prematchtime ; // set it
}
else
2001-07-23 20:52:47 +00:00
prematch = FALSE ; // otherwise, no prematch
2001-07-17 05:58:10 +00:00
// Kill everyone
/* other = find(world, classname, "player");
while ( other ! = world )
{
2001-07-23 20:52:47 +00:00
TF_T_Damage ( other , world , world , other . health + 20 , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
other = find ( other , classname , " player " ) ;
} Don ' t kill everyone here or it drops the flag
*/
// Set up the timer
/*- if (team1rounds < roundstowin && team2rounds < roundstowin && team3rounds < roundstowin && team4rounds < roundstowin)
{
roundtimer = spawn ( ) ;
roundtimer . think = SetUpChrisRound ;
roundtimer . nextthink = time + 5 ;
prematchtimer = spawn ( ) ;
prematchtimer . classname = = " prematch_timer " ;
prematchtimer . nextthink = time + prematch ;
prematchtimer . think = PrematchBegin ;
}
else
{
newmis = spawn ( ) ;
newmis . nextthink = time + 5 ;
newmis . think = execute_changelevel ;
}
} ; */
void ( ) DecodeLevelParms =
{
local string st ;
local entity ent ;
local float prematchtime ;
if ( serverflags )
{
if ( world . model = = " maps/start.bsp " )
SetNewParms ( ) ; // take away all stuff on starting new episode
}
self . items = parm1 ;
self . health = parm2 ;
self . armorvalue = parm3 ;
self . ammo_shells = parm4 ;
self . ammo_nails = parm5 ;
self . ammo_rockets = parm6 ;
self . ammo_cells = parm7 ;
self . current_weapon = parm8 ;
self . armortype = parm9 * 0.01 ;
// TeamFortress Parameters
// Detect whether this is the first entrance into a map
if ( toggleflags = = 0 )
{
toggleflags = parm10 ;
allow_hook = 0 ;
2001-07-23 20:52:47 +00:00
invis_only = SPY_INVIS_ONLY ;
2001-07-17 05:58:10 +00:00
if ( coop | | ! deathmatch )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_CLASS_PERSIST ;
2001-07-17 05:58:10 +00:00
nextmap = mapname ;
# ifdef GRAPPLING_HOOK
2001-07-23 20:52:47 +00:00
allow_hook = TRUE ;
2001-07-17 05:58:10 +00:00
# endif
// Is this a FortressMap?
ent = find ( world , classname , " info_tfdetect " ) ;
if ( ent ! = world )
{
// Turn on Teamplay
if ( teamplay = = 0 )
cvar_set ( " teamplay " , " 21?TeamFortress " ) ;
// Parse the rest of the Detection details
ParseTFDetect ( ent ) ;
// If the number_of_teams wasn't set, then there's not TF
// spawnpoints on this lvl... so guess at 4 teams.
if ( number_of_teams < = 0 | | number_of_teams > = 5 )
number_of_teams = 4 ;
}
else
{
// Is this a CTF map?
ent = find ( world , classname , " info_player_team1 " ) ;
2001-07-23 20:52:47 +00:00
if ( ( ent ! = world ) | | ( CTF_Map = = TRUE ) )
2001-07-17 05:58:10 +00:00
{
// Turn on CTF MAP
2001-07-23 20:52:47 +00:00
CTF_Map = TRUE ;
2001-07-17 05:58:10 +00:00
// Turn on Teamplay
if ( teamplay = = 0 )
cvar_set ( " teamplay " , " 21?TeamFortress " ) ;
// Setup the CTF FlagCheck Timer
ent = spawn ( ) ;
ent . nextthink = time + 30 ;
ent . think = CTF_FlagCheck ;
number_of_teams = 2 ;
}
else // Normal map
{
number_of_teams = 4 ;
}
// Set speed limits
# ifndef QUAKE_WORLD
cvar_set ( " sv_maxspeed " , " 1000 " ) ;
# endif
// set aiming level
# ifndef NET_SERVER
cvar_set ( " sv_aim " , " 1 " ) ;
# endif
// Set life limits
team1lives = - 1 ;
team2lives = - 1 ;
team3lives = - 1 ;
team4lives = - 1 ;
// WK Clear our nextspam counters
team1nextspam = - 1 ;
team2nextspam = - 1 ;
team3nextspam = - 1 ;
team4nextspam = - 1 ;
// Set illegal playerclasses
illegalclasses1 = 0 ;
illegalclasses2 = 0 ;
illegalclasses3 = 0 ;
illegalclasses4 = 0 ;
// Set Team Limits
team1maxplayers = 100 ;
team2maxplayers = 100 ;
team3maxplayers = 100 ;
team4maxplayers = 100 ;
civilianteams = 0 ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> : " ) ;
bprint ( PRINT_HIGH , mapname ) ;
bprint ( PRINT_HIGH , " \n " ) ;
2001-07-17 05:58:10 +00:00
SetupTeamEqualiser ( ) ;
2001-07-23 20:52:47 +00:00
if ( NEVER_TEAMFRAGS )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags - ( toggleflags & TFLAG_TEAMFRAGS ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
if ( ALWAYS_TEAMFRAGS )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_TEAMFRAGS ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
if ( CHECK_SPEEDS )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_CHEATCHECK ;
2001-07-17 05:58:10 +00:00
}
# ifdef QUAKE_WORLD
st = infokey ( world , " temp1 " ) ;
2001-07-23 20:52:47 +00:00
toggleflags = ( toggleflags | TFLAG_FIRSTENTRY | stof ( st ) ) ;
2001-07-17 05:58:10 +00:00
# else
2001-07-23 20:52:47 +00:00
toggleflags = ( toggleflags | TFLAG_FIRSTENTRY | cvar ( " temp1 " ) ) ;
2001-07-17 05:58:10 +00:00
# endif
local float autoteam_time ;
autoteam_time = 30 ;
# ifdef QUAKE_WORLD
// check all serverinfo settings, to set the appropriate toggleflags
local string st ;
// AUTOTEAM
st = infokey ( world , " a " ) ;
if ( st = = string_null )
st = infokey ( world , " autoteam " ) ;
if ( st = = " on " )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_AUTOTEAM ;
2001-07-17 05:58:10 +00:00
else if ( st = = " off " )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags - ( toggleflags & TFLAG_AUTOTEAM ) ;
2001-07-17 05:58:10 +00:00
else if ( stof ( st ) ! = 0 )
{
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_AUTOTEAM ;
2001-07-17 05:58:10 +00:00
autoteam_time = stof ( st ) ;
}
// TEAMFRAGS
st = infokey ( world , " t " ) ;
if ( st = = string_null )
st = infokey ( world , " teamfrags " ) ;
if ( st = = " on " )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_TEAMFRAGS ;
2001-07-17 05:58:10 +00:00
else if ( st = = " off " )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags - ( toggleflags & TFLAG_TEAMFRAGS ) ;
2001-07-17 05:58:10 +00:00
//WK JELLO WATER
st = infokey ( world , " j " ) ;
if ( st = = string_null )
st = infokey ( world , " jello " ) ;
if ( st = = " on " )
2001-07-23 20:52:47 +00:00
jello = TRUE ;
2001-07-17 05:58:10 +00:00
else {
local float numba ;
numba = stof ( st ) ;
if ( numba )
jello = numba ;
else
2001-07-23 20:52:47 +00:00
jello = FALSE ;
2001-07-17 05:58:10 +00:00
}
//WK JELLO WATER
2001-07-23 20:52:47 +00:00
light_damage = FALSE ;
2001-07-17 05:58:10 +00:00
st = infokey ( world , " ld " ) ;
if ( st = = string_null )
st = infokey ( world , " lightdamage " ) ;
if ( st = = " on " )
2001-07-23 20:52:47 +00:00
light_damage = TRUE ;
2001-07-17 05:58:10 +00:00
// SB New, improved TF 2.9 fake prematch mode!
// We can make a class, come in, run around, play tag the flag, but can't do anything
// useful until the prematch is over!
st = infokey ( world , " pm " ) ;
if ( st = = string_null ) // if 'pm' isn't set, try 'prematch'
st = infokey ( world , " prematch " ) ;
if ( st = = " on " ) // if it reads 'on', do a 30 second prematch
prematchtime = time + 30 ;
else // if it doesn't read 'on'...
prematchtime = stof ( st ) ; // turn the string into a float
if ( prematchtime ) // if we have prematch
{
prematch = time + prematchtime ; // set it
autoteam_time = prematchtime ;
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_AUTOTEAM ;
2001-07-17 05:58:10 +00:00
}
else
2001-07-23 20:52:47 +00:00
prematch = FALSE ; // otherwise, no prematch
2001-07-17 05:58:10 +00:00
//WK Bounty System
st = infokey ( world , " bounty " ) ;
if ( st = = string_null )
st = infokey ( world , " moola " ) ;
if ( st = = " on " )
2001-07-23 20:52:47 +00:00
bounty = TRUE ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bounty = FALSE ;
2001-07-17 05:58:10 +00:00
//CH Sets the starting amount of money :)
st = infokey ( world , " m " ) ;
if ( st = = string_null )
st = infokey ( world , " money " ) ;
local float numba ;
numba = stof ( st ) ;
if ( numba )
custom_money = numba ;
else
2001-07-23 20:52:47 +00:00
custom_money = SPENDING_LIMIT ;
2001-07-17 05:58:10 +00:00
// GRAPPLING HOOK
st = infokey ( world , " g " ) ;
if ( st = = string_null )
st = infokey ( world , " grapple " ) ;
if ( st = = " off " )
2001-07-23 20:52:47 +00:00
allow_hook = FALSE ;
if ( ! ( toggleflags & TFLAG_GRAPPLE ) & & st ! = " on " )
allow_hook = FALSE ;
2001-07-17 05:58:10 +00:00
// SPY OFF
st = infokey ( world , " spy " ) ;
if ( st = = " off " )
2001-07-23 20:52:47 +00:00
spy_off = TRUE ;
2001-07-17 05:58:10 +00:00
// SPY INVIS ONLY
st = infokey ( world , " s " ) ;
if ( st = = string_null )
st = infokey ( world , " spyinvis " ) ;
2001-07-23 20:52:47 +00:00
if ( st = = " on " | | toggleflags & TFLAG_SPYINVIS )
invis_only = TRUE ;
2001-07-17 05:58:10 +00:00
else if ( st = = " off " )
2001-07-23 20:52:47 +00:00
invis_only = FALSE ;
2001-07-17 05:58:10 +00:00
// RespawnDelay
st = infokey ( world , " rd " ) ;
if ( st = = string_null )
st = infokey ( world , " respawn_delay " ) ;
respawn_delay_time = stof ( st ) ;
if ( respawn_delay_time )
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags | TFLAG_RESPAWNDELAY ;
2001-07-17 05:58:10 +00:00
# else
// GRAPPLING HOOK
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_GRAPPLE ) & & ( CTF_Map = = FALSE ) )
allow_hook = FALSE ;
2001-07-17 05:58:10 +00:00
# endif
// If no Respawndelay has been specified, set the default
2001-07-23 20:52:47 +00:00
if ( toggleflags & TFLAG_RESPAWNDELAY & & respawn_delay_time = = 0 )
respawn_delay_time = RESPAWN_DELAY_TIME ;
2001-07-17 05:58:10 +00:00
// Prevent autoteam from kicking in for 30 seconds.
// Allows restructuring of the teams from the last map nicely.
2001-07-23 20:52:47 +00:00
if ( toggleflags & TFLAG_AUTOTEAM )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
toggleflags = toggleflags - ( toggleflags & TFLAG_AUTOTEAM ) ;
2001-07-17 05:58:10 +00:00
ent = spawn ( ) ;
ent . nextthink = time + autoteam_time ;
ent . think = autoteam_think ;
}
}
if ( parm11 )
self . tfstate = parm11 ;
if ( self . playerclass = = 0 )
self . playerclass = parm12 ;
# ifdef STATUSBAR
if ( parm13 )
self . StatusBarRes = parm13 ;
if ( parm14 )
self . StatusBarSize = parm14 ;
# endif
# ifdef QUAKE_WORLD
if ( parm15 )
self . admin_flag = parm15 ; //CH Admin status :)
# endif
} ;
/*
= = = = = = = = = = = =
FindIntermission
Returns the entity to view from
= = = = = = = = = = = =
*/
entity ( ) FindIntermission =
{
local entity spot ;
local float cyc ;
// look for info_intermission first
spot = find ( world , classname , " info_intermission " ) ;
if ( spot )
{ // pick a random one
cyc = random ( ) * 1 ;
// Following removed for the observer code
/*while (cyc > 1)
{
spot = find ( spot , classname , " info_intermission " ) ;
if ( ! spot )
spot = find ( spot , classname , " info_intermission " ) ;
cyc = cyc - 1 ;
} */
return spot ;
}
// then look for the start position
spot = find ( world , classname , " info_player_start " ) ;
if ( spot )
return spot ;
// then look through the deathmatch starts
spot = find ( world , classname , " info_player_deathmatch " ) ;
if ( spot )
{
// pick a random one
cyc = random ( ) * 6 ;
while ( cyc > 1 )
{
spot = find ( spot , classname , " info_player_deathmatch " ) ;
if ( ! spot )
spot = find ( spot , classname , " info_player_deathmatch " ) ;
cyc = cyc - 1 ;
}
return spot ;
}
objerror ( " FindIntermission: no spot " ) ;
} ;
/*===========================
FindNextIntermission
returns the next intermission point
= = = = = = = = = = = = = = = = = = = = = = = = = = = */
entity ( entity start_point ) FindNextIntermission =
{
local entity spot ;
local float cyc ;
if ( deathmatch )
{
// look through info_intermission first
if ( start_point . classname = = " info_intermission " | | start_point = = world )
{
spot = find ( start_point , classname , " info_intermission " ) ;
if ( spot )
return spot ;
else
start_point = world ;
}
// then look through the deathmatch starts
if ( start_point . classname = = " info_player_deathmatch " | | start_point = = world )
{
spot = find ( start_point , classname , " info_player_deathmatch " ) ;
if ( spot )
return spot ;
}
// at the end of the list
spot = find ( world , classname , " info_intermission " ) ;
if ( spot )
return spot ;
spot = find ( world , classname , " info_player_deathmatch " ) ;
if ( spot )
return spot ;
}
else // do not cycle though in co-op or single
{
spot = find ( world , classname , " info_player_start " ) ;
if ( spot )
return spot ;
}
// it should never reach this point
return FindIntermission ( ) ;
} ;
/*==================================================
TF_MovePlayer
Moves the player to another intermission viewpoint
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
void ( ) TF_MovePlayer =
{
local entity place ;
place = FindNextIntermission ( self . observer_list ) ;
self . observer_list = place ;
setorigin ( self , place . origin + ' 0 0 1 ' ) ;
self . angles = place . angles ;
2001-07-23 20:52:47 +00:00
self . fixangle = TRUE ; // turn this way immediately
2001-07-17 05:58:10 +00:00
} ;
float ( ) GetNoPlayers ;
# define CYCLED 2
float ( ) DoExtraCycle =
{
//-------------------------------------------------//
//- OfN - I tried to make this work like in tf2.8 -//
local string nfmap , temp ;
nfmap = infokey ( world , " nmap " ) ;
if ( nfmap ! = string_null )
{
local float minplayers , maxplayers , itsok , currentpl ;
if ( infokey ( world , " minp " ) ! = " " )
minplayers = stof ( infokey ( world , " minp " ) ) ;
else
minplayers = 0 ;
if ( infokey ( world , " maxp " ) ! = " " )
maxplayers = stof ( infokey ( world , " maxp " ) ) ;
else
maxplayers = 32 ;
2001-07-23 20:52:47 +00:00
itsok = TRUE ;
2001-07-17 05:58:10 +00:00
currentpl = GetNoPlayers ( ) ;
//check conditions
if ( minplayers > currentpl )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " Map " ) ;
2001-07-17 05:58:10 +00:00
nfmap = infokey ( world , " nmap " ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , nfmap ) ;
bprint ( PRINT_HIGH , " skipped - minimum players " ) ;
2001-07-17 05:58:10 +00:00
temp = ftos ( minplayers ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , temp ) ;
bprint ( PRINT_HIGH , " (currently " ) ;
2001-07-17 05:58:10 +00:00
temp = ftos ( currentpl ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , temp ) ;
bprint ( PRINT_HIGH , " ) \n " ) ;
itsok = FALSE ;
2001-07-17 05:58:10 +00:00
}
else
{
if ( maxplayers < currentpl )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " Map " ) ;
2001-07-17 05:58:10 +00:00
nfmap = infokey ( world , " nmap " ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , nfmap ) ;
bprint ( PRINT_HIGH , " skipped - maximum players " ) ;
2001-07-17 05:58:10 +00:00
temp = ftos ( maxplayers ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , temp ) ;
bprint ( PRINT_HIGH , " (currently " ) ;
2001-07-17 05:58:10 +00:00
temp = ftos ( currentpl ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , temp ) ;
bprint ( PRINT_HIGH , " ) \n " ) ;
itsok = FALSE ;
2001-07-17 05:58:10 +00:00
}
}
//cleanup..
localcmd ( " localinfo minp \" \" \n " ) ;
localcmd ( " localinfo maxp \" \" \n " ) ;
//locals clean
//execute map conditions ok
if ( itsok )
{
nfmap = infokey ( world , " nmap " ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " \n Loading " ) ;
bprint ( PRINT_HIGH , nfmap ) ;
bprint ( PRINT_HIGH , " map file... \n " ) ;
2001-07-17 05:58:10 +00:00
localcmd ( " localinfo nmap \" \" \n " ) ;
localcmd ( " map " ) ;
localcmd ( nfmap ) ;
localcmd ( " \n " ) ;
2001-07-23 20:52:47 +00:00
return TRUE ;
2001-07-17 05:58:10 +00:00
}
else //conditions not passed...
{
localcmd ( " localinfo nmap \" \" \n " ) ;
2001-07-23 20:52:47 +00:00
return FALSE ;
2001-07-17 05:58:10 +00:00
}
}
2001-07-23 20:52:47 +00:00
return FALSE ;
2001-07-17 05:58:10 +00:00
} ;
void ( ) GotoNextMap ;
void ( ) cycle_timer_think =
{
GotoNextMap ( ) ;
dremove ( self ) ;
} ;
void ( ) SetCycleTimer =
{
newmis = spawn ( ) ;
newmis . classname = " cyclemap_timer " ;
newmis . nextthink = time + 0.1 ;
newmis . think = cycle_timer_think ;
} ;
2001-07-23 15:08:39 +00:00
float ( ) GetNextMapNum =
{
local float desc ;
local string st ;
local string infostring ;
local float infonum ;
infostring = infokey ( world , " n " ) ;
infonum = stof ( infostring ) ;
if ( infostring ! = " " ) // always use info when available
return infonum ;
if ( cvar ( " crudefile_quota " ) < 0 )
return infonum ;
desc = cfopen ( " nextmapnum " , " r " ) ;
if ( desc < 0 )
return infonum ;
st = cfread ( desc ) ;
if ( st = = " " )
{
cfclose ( desc ) ;
return infonum ;
}
cfclose ( desc ) ;
return stof ( st ) ;
} ;
void ( float mapnum ) SetNextMapNum =
{
local float desc ;
local string mapstring ;
mapstring = ftos ( mapnum ) ;
if ( cvar ( " crudefile_quota " ) > = 0 )
{
desc = cfopen ( " nextmapnum " , " w " ) ;
// if nextmapnum has a num in it, but we can't modify it.. stuck in a loop
if ( desc > = 0 )
{
cfwrite ( desc , mapstring ) ;
cfclose ( desc ) ;
}
}
localcmd ( " serverinfo n \" \" \n " ) ; // use localinfo instead
localcmd ( " localinfo n " ) ;
localcmd ( mapstring ) ;
localcmd ( " \n " ) ;
} ;
void ( ) LoadNextMap =
2001-07-17 05:58:10 +00:00
{
local float nextlevel ;
local string cyc ;
2001-07-23 15:08:39 +00:00
local float desc ;
local float mapcount ;
local string map ;
nextlevel = GetNextMapNum ( ) ;
nextlevel = nextlevel + 1 ; // next level
SetNextMapNum ( nextlevel ) ;
// get count of maps
mapcount = 0 ;
desc = cfopen ( " mapcycle " , " r " ) ;
while ( cfread ( desc ) ! = " " )
mapcount = mapcount + 1 ;
2001-07-23 18:54:41 +00:00
cfclose ( desc ) ;
2001-07-23 15:08:39 +00:00
if ( mapcount > 0 )
{
if ( nextlevel > mapcount )
{
while ( nextlevel > mapcount )
nextlevel = nextlevel - mapcount ;
SetNextMapNum ( nextlevel ) ;
}
desc = cfopen ( " mapcycle " , " r " ) ;
local float i ;
i = 0 ;
while ( i < nextlevel )
{
i = i + 1 ;
map = cfread ( desc ) ;
}
if ( map = = " " )
mapcount = 0 ; // fall back to old mapcycle method
else
localcmd ( " map " + map + " \n " ) ;
}
if ( mapcount = = 0 )
{
cyc = infokey ( world , " cycledir " ) ;
if ( cyc = = string_null )
cyc = " qwmcycle " ;
localcmd ( " exec " ) ;
localcmd ( cyc ) ;
localcmd ( " /map " ) ;
localcmd ( ftos ( nextlevel ) ) ;
localcmd ( " .cfg \n " ) ;
2001-07-23 20:52:47 +00:00
already_chosen_map = CYCLED ;
2001-07-23 15:08:39 +00:00
}
} ;
void ( ) GotoNextMap =
{
2001-07-17 05:58:10 +00:00
if ( nextmap ! = mapname )
{
changelevel ( nextmap ) ;
2001-07-23 20:52:47 +00:00
already_chosen_map = TRUE ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
if ( already_chosen_map = = FALSE | | already_chosen_map = = CYCLED )
2001-07-17 05:58:10 +00:00
{
if ( DoExtraCycle ( ) )
2001-07-23 20:52:47 +00:00
already_chosen_map = TRUE ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
already_chosen_map = FALSE ;
2001-07-17 05:58:10 +00:00
}
//- OfN - super new map cycling code :)
2001-07-23 20:52:47 +00:00
if ( already_chosen_map = = FALSE )
2001-07-23 15:08:39 +00:00
LoadNextMap ( ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 15:08:39 +00:00
if ( GetNextMapNum ( ) = = 0 )
2001-07-23 20:52:47 +00:00
already_chosen_map = FALSE ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
if ( already_chosen_map = = FALSE ) // nothing was done yet, so set the damn timer..
2001-07-17 05:58:10 +00:00
{
SetCycleTimer ( ) ;
return ;
}
2001-07-23 20:52:47 +00:00
if ( already_chosen_map = = CYCLED ) // if we executed a mapx.cfg
2001-07-17 05:58:10 +00:00
SetCycleTimer ( ) ; // set the timer to check the real map afte 0.1 seconds
} ;
void ( ) ExitIntermission =
{
RPrint ( " Exiting intermission... \n " ) ;
// skip any text in deathmatch
if ( deathmatch )
{
RPrint ( " Exit Intermission in Deathmatch. \n " ) ;
GotoNextMap ( ) ;
return ;
}
intermission_exittime = time + 1 ;
intermission_running = intermission_running + 1 ;
//
// run some text if at the end of an episode
//
if ( intermission_running = = 2 )
{
if ( world . model = = " maps/e1m7.bsp " )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_CDTRACK ) ;
WriteByte ( MSG_ALL , 2 ) ;
WriteByte ( MSG_ALL , 3 ) ;
2001-07-17 05:58:10 +00:00
if ( ! cvar ( " registered " ) )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " As the corpse of the monstrous entity \n Chthon sinks back into the lava whence \n it rose, you grip the Rune of Earth \n Magic tightly. Now that you have \n conquered the Dimension of the Doomed, \n realm of Earth Magic, you are ready to \n complete your task in the other three \n haunted lands of Quake. Or are you? If \n you don't register Quake, you'll never \n know what awaits you in the Realm of \n Black Magic, the Netherworld, and the \n Elder World! " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " As the corpse of the monstrous entity \n Chthon sinks back into the lava whence \n it rose, you grip the Rune of Earth \n Magic tightly. Now that you have \n conquered the Dimension of the Doomed, \n realm of Earth Magic, you are ready to \n complete your task. A Rune of magic \n power lies at the end of each haunted \n land of Quake. Go forth, seek the \n totality of the four Runes! " ) ;
2001-07-17 05:58:10 +00:00
}
return ;
}
else if ( world . model = = " maps/e2m6.bsp " )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_CDTRACK ) ;
WriteByte ( MSG_ALL , 2 ) ;
WriteByte ( MSG_ALL , 3 ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " The Rune of Black Magic throbs evilly in \n your hand and whispers dark thoughts \n into your brain. You learn the inmost \n lore of the Hell-Mother; Shub-Niggurath! \n You now know that she is behind all the \n terrible plotting which has led to so \n much death and horror. But she is not \n inviolate! Armed with this Rune, you \n realize that once all four Runes are \n combined, the gate to Shub-Niggurath's \n Pit will open, and you can face the \n Witch-Goddess herself in her frightful \n otherworld cathedral. " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else if ( world . model = = " maps/e3m6.bsp " )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_CDTRACK ) ;
WriteByte ( MSG_ALL , 2 ) ;
WriteByte ( MSG_ALL , 3 ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " The charred viscera of diabolic horrors \n bubble viscously as you seize the Rune \n of Hell Magic. Its heat scorches your \n hand, and its terrible secrets blight \n your mind. Gathering the shreds of your \n courage, you shake the devil's shackles \n from your soul, and become ever more \n hard and determined to destroy the \n hideous creatures whose mere existence \n threatens the souls and psyches of all \n the population of Earth. " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else if ( world . model = = " maps/e4m7.bsp " )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_CDTRACK ) ;
WriteByte ( MSG_ALL , 2 ) ;
WriteByte ( MSG_ALL , 3 ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " Despite the awful might of the Elder \n World, you have achieved the Rune of \n Elder Magic, capstone of all types of \n arcane wisdom. Beyond good and evil, \n beyond life and death, the Rune \n pulsates, heavy with import. Patient and \n potent, the Elder Being Shub-Niggurath \n weaves her dire plans to clear off all \n life from the Earth, and bring her own \n foul offspring to our world! For all the \n dwellers in these nightmare dimensions \n are her descendants! Once all Runes of \n magic power are united, the energy \n behind them will blast open the Gateway \n to Shub-Niggurath, and you can travel \n there to foil the Hell-Mother's plots \n in person. " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
GotoNextMap ( ) ;
}
if ( intermission_running = = 3 )
{
if ( ! cvar ( " registered " ) )
{ // shareware episode has been completed, go to sell screen
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_SELLSCREEN ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( ( serverflags & 15 ) = = 15 )
{
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_FINALE ) ;
WriteString ( MSG_ALL , " Now, you have all four Runes. You sense \n tremendous invisible forces moving to \n unseal ancient barriers. Shub-Niggurath \n had hoped to use the Runes Herself to \n clear off the Earth, but now instead, \n you will use them to enter her home and \n confront her as an avatar of avenging \n Earth-life. If you defeat her, you will \n be remembered forever as the savior of \n the planet. If she conquers, it will be \n as if you had never been born. " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
RPrint ( " Exit Intermission. \n " ) ;
GotoNextMap ( ) ;
} ;
/*
= = = = = = = = = = = =
IntermissionThink
When the player presses attack or jump , change to the next level
= = = = = = = = = = = =
*/
void ( ) IntermissionThink =
{
if ( time < intermission_exittime )
return ;
if ( ! self . button0 & & ! self . button1 & & ! self . button2 )
return ;
# ifdef QUAKE_WORLD
if ( ! triggered_cycle )
{
RPrint ( " Intermission think. \n " ) ;
2001-07-23 20:52:47 +00:00
triggered_cycle = TRUE ;
2001-07-17 05:58:10 +00:00
GotoNextMap ( ) ;
}
# else
ExitIntermission ( ) ;
# endif
} ;
# ifndef QUAKE_WORLD
void ( ) execute_changelevel =
{
local entity pos ;
intermission_running = 1 ;
// enforce a wait time before allowing changelevel
if ( deathmatch )
intermission_exittime = time + 5 ;
else
intermission_exittime = time + 2 ;
// OfN TODO: remove this?
2001-07-23 20:52:47 +00:00
/* WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte ( MSG_ALL , 3 ) ;
WriteByte ( MSG_ALL , 3 ) ; */
2001-07-17 05:58:10 +00:00
pos = FindIntermission ( ) ;
other = find ( world , classname , " player " ) ;
while ( other ! = world )
{
other . view_ofs = ' 0 0 0 ' ;
other . angles = other . v_angle = pos . mangle ;
2001-07-23 20:52:47 +00:00
other . fixangle = TRUE ; // turn this way immediately
2001-07-17 05:58:10 +00:00
other . nextthink = time + 0.5 ;
2001-07-23 20:52:47 +00:00
other . takedamage = DAMAGE_NO ;
other . solid = SOLID_NOT ;
other . movetype = MOVETYPE_NONE ;
2001-07-17 05:58:10 +00:00
other . modelindex = 0 ;
setorigin ( other , pos . origin ) ;
other = find ( other , classname , " player " ) ;
}
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_INTERMISSION ) ;
2001-07-17 05:58:10 +00:00
} ;
# else
void ( ) PrintResults ;
void ( ) execute_changelevel =
{
local entity pos ;
RPrint ( " execute_changelevel() \n " ) ;
PrintResults ( ) ;
intermission_running = 1 ;
// enforce a wait time before allowing changelevel
intermission_exittime = time + 5 ;
pos = FindIntermission ( ) ;
// play intermission music
2001-07-23 20:52:47 +00:00
WriteByte ( MSG_ALL , SVC_CDTRACK ) ;
WriteByte ( MSG_ALL , 3 ) ;
WriteByte ( MSG_ALL , SVC_INTERMISSION ) ;
WriteCoord ( MSG_ALL , pos . origin_x ) ;
WriteCoord ( MSG_ALL , pos . origin_y ) ;
WriteCoord ( MSG_ALL , pos . origin_z ) ;
WriteAngle ( MSG_ALL , pos . mangle_x ) ;
WriteAngle ( MSG_ALL , pos . mangle_y ) ;
WriteAngle ( MSG_ALL , pos . mangle_z ) ;
2001-07-17 05:58:10 +00:00
other = find ( world , classname , " player " ) ;
while ( other ! = world )
{
2001-07-23 20:52:47 +00:00
other . takedamage = DAMAGE_NO ;
other . solid = SOLID_NOT ;
other . movetype = MOVETYPE_NONE ;
2001-07-17 05:58:10 +00:00
other . modelindex = 0 ;
other = find ( other , classname , " player " ) ;
}
} ;
# endif
void ( ) changelevel_touch =
{
local entity pos ;
local float ne ;
local string st ;
if ( other . classname ! = " player " )
return ;
# ifndef QUAKE_WORLD
if ( ( cvar ( " noexit " ) = = 1 ) | | ( ( cvar ( " noexit " ) = = 2 ) & & ( mapname ! = " start " ) ) )
{
T_Damage ( other , self , self , 50000 ) ;
return ;
}
# else
if ( cvar ( " samelevel " ) = = 2 | | ( cvar ( " samelevel " ) = = 3 & & mapname ! = " start " ) )
return ;
# endif
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , other . netname ) ;
bprint ( PRINT_HIGH , " exited the level \n " ) ;
2001-07-17 05:58:10 +00:00
nextmap = self . map ;
SUB_UseTargets ( ) ;
if ( ( self . spawnflags & 1 ) & & ( deathmatch = = 0 ) )
{ // NO_INTERMISSION
GotoNextMap ( ) ;
return ;
}
self . touch = SUB_Null ;
// we can't move people right now, because touch functions are called
// in the middle of C movement code, so set a think time to do it
self . think = execute_changelevel ;
self . nextthink = time + 0.1 ;
} ;
/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
When the player touches this , he gets sent to the map listed in the " map " variable . Unless the NO_INTERMISSION flag is set , the view will go to the info_intermission spot and display stats .
*/
void ( ) trigger_changelevel =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
if ( ! self . map )
objerror ( " changelevel trigger doesn't have map " ) ;
InitTrigger ( ) ;
self . touch = changelevel_touch ;
} ;
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
PLAYER GAME EDGE FUNCTIONS
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
void ( ) set_suicide_frame ;
// called by ClientKill and DeadThink
void ( ) respawn =
{
2001-07-23 20:52:47 +00:00
/* if (!(self.done_custom == 0 || (self.done_custom & CUSTOM_ON_SPAWN))) // do not spawn in prematch
2001-07-17 05:58:10 +00:00
if ( prematch < time )
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Sorry, there are still " ) ;
sprint ( self , PRINT_HIGH , prematch - time ) ;
sprint ( self , PRINT_HIGH , " seconds of prematch remaining. Type custom to recreate your class. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
*/
if ( coop )
{
// make a copy of the dead body for appearances sake
CopyToBodyQue ( self ) ;
// get the spawn parms as they were at level start
setspawnparms ( self ) ;
// respawn
PutClientInServer ( ) ;
}
else if ( deathmatch )
{
// make a copy of the dead body for appearances sake
CopyToBodyQue ( self ) ;
// set default spawn parms
SetNewParms ( ) ;
// respawn
PutClientInServer ( ) ;
}
else
{ // restart the entire server
localcmd ( " restart \n " ) ;
}
} ;
/*
= = = = = = = = = = = =
ClientKill
Player entered the suicide command
= = = = = = = = = = = =
*/
void ( ) ClientKill =
{
local float finished ;
local entity te ;
//WK Stop music
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_MUSIC , " items/r_item1.wav " , 0.1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
if ( self . suicide_time > time )
return ;
if ( self . deadflag )
return ;
// players can't suicide again for 10 seconds
self . suicide_time = time + 5 + ( random ( ) * 5 ) ;
//WK If building class, remove flag and start over
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_CUSTOM & & ( self . done_custom & CUSTOM_BUILDING ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " You can type 'custom' again to start over! \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
2001-07-23 20:52:47 +00:00
//WK self.done_custom = CUSTOM_ON_SPAWN | CUSTOM_FINISHED;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " You aren't alive! \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( prematch < time )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , self . netname ) ;
bprint ( PRINT_MEDIUM , " suicides \n " ) ;
2001-07-17 05:58:10 +00:00
}
set_suicide_frame ( ) ;
self . modelindex = modelindex_player ;
// If infected, give the medic a frag
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_INFECTED )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
finished = FALSE ;
2001-07-17 05:58:10 +00:00
te = find ( world , classname , " timer " ) ;
while ( te )
{
if ( te . owner = = self & & te . think = = BioInfection_Decay )
{
# ifdef QUAKE_WORLD
logfrag ( te , self ) ;
# endif
te . enemy . real_frags = te . enemy . real_frags + 1 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
te . enemy . frags = te . enemy . real_frags ;
2001-07-23 20:52:47 +00:00
finished = TRUE ; //Thanks lostman
2001-07-17 05:58:10 +00:00
}
te = find ( te , classname , " timer " ) ;
if ( finished ) te = world ;
}
}
# ifdef QUAKE_WORLD
else
logfrag ( self , self ) ;
# endif
self . real_frags = self . real_frags - 1 ;
2001-07-23 20:52:47 +00:00
if ( teamplay & TEAMPLAY_VAMPIRE ) //WK
2001-07-17 05:58:10 +00:00
self . real_frags = self . real_frags - 1 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
self . frags = self . real_frags ;
self . weaponmodel = " " ;
self . view_ofs = ' 0 0 - 8 ' ;
2001-07-23 20:52:47 +00:00
self . movetype = MOVETYPE_NONE ;
2001-07-17 05:58:10 +00:00
//WK If building class, remove flag and start over
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_CUSTOM & & ( self . done_custom & CUSTOM_BUILDING ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " You can type 'custom' again to start over! \n " ) ;
self . done_custom = CUSTOM_ON_SPAWN | CUSTOM_FINISHED ;
2001-07-17 05:58:10 +00:00
return ; //ch
}
// Remove all timers for this player
TeamFortress_RemoveTimers ( ) ;
2001-07-23 20:52:47 +00:00
TeamFortress_SetupRespawn ( TRUE ) ;
2001-07-17 05:58:10 +00:00
self . health = - 1 ;
self . th_die ( ) ;
2001-07-23 20:52:47 +00:00
self . deadflag = DEAD_RESPAWNABLE ;
self . tfstate = self . tfstate | TFSTATE_RESPAWN_READY ;
2001-07-17 05:58:10 +00:00
// self.respawn_time = time;
} ;
////////////////////////////////////
// FindTeamSpawnPoint
//////////
entity lastspawn_team1 ;
entity lastspawn_team2 ;
entity lastspawn_team3 ;
entity lastspawn_team4 ;
entity ( float team_num ) FindTeamSpawnPoint =
{
local entity spot ;
local entity at_spot ;
local float spot_found ;
local float attempts ;
if ( team_num = = 1 )
{
spot = lastspawn_team1 ;
attempts = 0 ;
// search through until found or end-of-list
while ( 1 )
{
attempts = attempts + 1 ;
spot = find ( spot , team_str_home , " ts1 " ) ;
if ( spot = = world )
spot = find ( world , team_str_home , " ts1 " ) ;
if ( spot = = world )
return world ;
at_spot = findradius ( spot . origin , 40 ) ;
2001-07-23 20:52:47 +00:00
spot_found = TRUE ;
2001-07-17 05:58:10 +00:00
while ( at_spot ! = world )
{
2001-07-23 20:52:47 +00:00
if ( at_spot . classname = = " player " & & at_spot . deadflag = = DEAD_NO )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
}
at_spot = at_spot . chain ;
}
// Check the Criteria of the spawnpoint
if ( ! Activated ( spot , self ) )
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
if ( ( spot_found ) | | ( attempts > = 30 ) )
{
lastspawn_team1 = spot ;
return spot ;
}
}
}
else if ( team_num = = 2 )
{
spot = lastspawn_team2 ;
attempts = 0 ;
// search through until found or end-of-list
while ( 1 )
{
attempts = attempts + 1 ;
spot = find ( spot , team_str_home , " ts2 " ) ;
if ( spot = = world )
spot = find ( world , team_str_home , " ts2 " ) ;
if ( spot = = world )
return world ;
at_spot = findradius ( spot . origin , 40 ) ;
2001-07-23 20:52:47 +00:00
spot_found = TRUE ;
2001-07-17 05:58:10 +00:00
while ( at_spot ! = world )
{
2001-07-23 20:52:47 +00:00
if ( at_spot . classname = = " player " & & at_spot . deadflag = = DEAD_NO )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
}
at_spot = at_spot . chain ;
}
// Check the Criteria of the spawnpoint
if ( ! Activated ( spot , self ) )
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
if ( ( spot_found ) | | ( attempts > = 30 ) )
{
lastspawn_team2 = spot ;
return spot ;
}
}
}
else if ( team_num = = 3 )
{
spot = lastspawn_team3 ;
attempts = 0 ;
// search through until found or end-of-list
while ( 1 )
{
attempts = attempts + 1 ;
spot = find ( spot , team_str_home , " ts3 " ) ;
if ( spot = = world )
spot = find ( world , team_str_home , " ts3 " ) ;
if ( spot = = world )
return world ;
at_spot = findradius ( spot . origin , 40 ) ;
2001-07-23 20:52:47 +00:00
spot_found = TRUE ;
2001-07-17 05:58:10 +00:00
while ( at_spot ! = world )
{
2001-07-23 20:52:47 +00:00
if ( at_spot . classname = = " player " & & at_spot . deadflag = = DEAD_NO )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
}
at_spot = at_spot . chain ;
}
// Check the Criteria of the spawnpoint
if ( ! Activated ( spot , self ) )
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
if ( ( spot_found ) | | ( attempts > = 30 ) )
{
lastspawn_team3 = spot ;
return spot ;
}
}
}
else if ( team_num = = 4 )
{
spot = lastspawn_team4 ;
attempts = 0 ;
// search through until found or end-of-list
while ( 1 )
{
attempts = attempts + 1 ;
spot = find ( spot , team_str_home , " ts4 " ) ;
if ( spot = = world )
spot = find ( world , team_str_home , " ts4 " ) ;
if ( spot = = world )
return world ;
at_spot = findradius ( spot . origin , 40 ) ;
2001-07-23 20:52:47 +00:00
spot_found = TRUE ;
2001-07-17 05:58:10 +00:00
while ( at_spot ! = world )
{
2001-07-23 20:52:47 +00:00
if ( at_spot . classname = = " player " & & at_spot . deadflag = = DEAD_NO )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
}
at_spot = at_spot . chain ;
}
// Check the Criteria of the spawnpoint
if ( ! Activated ( spot , self ) )
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
if ( ( spot_found ) | | ( attempts > = 30 ) )
{
lastspawn_team4 = spot ;
return spot ;
}
}
}
// failure
return world ;
} ;
/*
= = = = = = = = = = = =
SelectSpawnPoint
Returns the entity to spawn at
= = = = = = = = = = = =
*/
entity ( ) SelectSpawnPoint =
{
local entity spot ;
local entity at_spot ;
local float spot_found ;
local float attempts ;
// testinfo_player_start is only found in regioned levels
/*
spot = find ( world , classname , " testplayerstart " ) ;
if ( spot )
return spot ;
*/
// If FortressMap option is on, we want to make the player spawn on a
// spawnpoint marked as being one for his/her team.
// The team that owns a spawnpoint is kept in the spawnpoints's teamno
if ( self . team_no ! = 0 )
{
spot = FindTeamSpawnPoint ( self . team_no ) ;
if ( spot ! = world )
return spot ;
// failure to find a team spawn point for that player
// just move on
}
// choose a info_player_deathmatch point
if ( coop )
{
lastspawn = find ( lastspawn , classname , " info_player_coop " ) ;
if ( lastspawn = = world )
lastspawn = find ( world , classname , " info_player_coop " ) ;
if ( lastspawn ! = world )
return lastspawn ;
}
else if ( deathmatch )
{
// search through
spot = find ( lastspawn , classname , " info_player_deathmatch " ) ;
if ( spot = = world )
spot = find ( world , classname , " info_player_deathmatch " ) ;
attempts = 0 ;
while ( spot ! = world & & attempts < 100 )
{
attempts = attempts + 1 ;
// reject spot if other players are found at point
at_spot = findradius ( spot . origin , 40 ) ;
2001-07-23 20:52:47 +00:00
spot_found = TRUE ;
2001-07-17 05:58:10 +00:00
while ( at_spot )
{
2001-07-23 20:52:47 +00:00
if ( at_spot . classname = = " player " & & at_spot . deadflag = = DEAD_NO )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
spot_found = FALSE ;
2001-07-17 05:58:10 +00:00
}
at_spot = at_spot . chain ;
}
// Make sure we don't get locked by people standing on all
// the spawnpoints.
if ( ( spot_found ) | | ( attempts > = 10 ) )
{
lastspawn = spot ;
return spot ;
}
spot = find ( spot , classname , " info_player_deathmatch " ) ;
if ( spot = = world )
spot = find ( world , classname , " info_player_deathmatch " ) ;
}
}
if ( serverflags )
{ // return with a rune to start
spot = find ( world , classname , " info_player_start2 " ) ;
if ( spot )
return spot ;
}
spot = find ( world , classname , " info_player_start " ) ;
if ( ! spot )
error ( " PutClientInServer: no info_player_start on level \n " ) ;
return spot ;
} ;
/*
= = = = = = = = = = =
PutClientInServer
called each time a player is spawned
= = = = = = = = = = = =
*/
void ( ) DecodeLevelParms ;
void ( ) PlayerDie ;
void ( ) TeamFortress_SetHealth ;
void ( ) TeamFortress_SetEquipment ;
void ( ) player_touch ;
void ( entity p ) TeamFortress_SetSpeed ;
void ( entity p ) TeamFortress_SetSkin ;
void ( ) PutClientInServer =
{
local string st ;
local float iszoom , oldclass ;
local entity spot , te ;
self . touch = player_touch ;
self . classname = " player " ;
2001-07-23 20:52:47 +00:00
if ( self . playerclass ! = PC_CUSTOM )
2001-07-17 05:58:10 +00:00
{
self . max_health = 100 ;
self . health = 100 ;
}
//Check_Admin_Password(self); //CH check pass and sets flags
2001-07-23 20:52:47 +00:00
self . takedamage = DAMAGE_AIM ;
self . solid = SOLID_SLIDEBOX ;
self . movetype = MOVETYPE_WALK ;
2001-07-17 05:58:10 +00:00
self . show_hostile = 0 ;
self . is_malfunctioning = 0 ;
self . is_abouttodie = 0 ;
// OfN
self . has_holo = 0 ;
2001-07-23 20:52:47 +00:00
self . is_killed = FALSE ;
2001-07-17 05:58:10 +00:00
//////////////////
/* if (self.is_cameraviewing)
SwitchFromCamera ( ) ; */
self . FlashTime = 0 ;
2001-07-23 20:52:47 +00:00
self . flags = FL_CLIENT ;
2001-07-17 05:58:10 +00:00
self . aura = 0 ; //- OfN
self . crusader_inspirator = world ; // OfN - needed?
self . gravity = 1 ; //WK
self . air_finished = time + 12 ;
self . dmg = 2 ; // initial water damage
self . super_damage_finished = 0 ;
self . radsuit_finished = 0 ;
self . invisible_finished = 0 ;
self . invincible_finished = 0 ;
self . effects = 0 ;
self . invincible_time = 0 ;
self . reload_shotgun = 0 ;
self . reload_super_shotgun = 0 ;
self . reload_grenade_launcher = 0 ;
self . reload_rocket_launcher = 0 ;
self . reload_light_assault = 0 ;
self . reload_laser_cannon = 0 ;
//self.is_undercover = 0;
//self.undercover_team = 0;
self . last_attacked_time = 0 ; //WK For chaplan healing purposes
makeImmune ( self , time + 5 ) ;
// grapple stuff
2001-07-23 20:52:47 +00:00
self . on_hook = FALSE ;
self . hook_out = FALSE ;
self . fire_held_down = FALSE ;
2001-07-17 05:58:10 +00:00
DecodeLevelParms ( ) ;
# ifdef COOP_MODE
// Force all players to be on the same team in Coop mode
if ( coop )
{
teamplay = 21 ;
cvar_set ( " teamplay " , " 21?TeamFortress " ) ;
TeamFortress_TeamSet ( 1 ) ;
}
# endif
// Set the Civilian Class of anyone in a Civilian Team
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
{
if ( TeamFortress_TeamIsCivilian ( self . team_no ) )
{
self . impulse = 1 ;
TeamFortress_ChangeClass ( ) ;
}
}
// For players who've changed their classes in deathmatch 3,
// their class may be PC_RANDOM, in which case we set the toggleflag
if ( ( deathmatch = = 3 ) & & ( self . nextpc ! = 0 ) )
{
self . playerclass = self . nextpc ;
2001-07-23 20:52:47 +00:00
if ( self . nextpc = = PC_RANDOM )
self . tfstate = self . tfstate | TFSTATE_RANDOMPC ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
self . tfstate = self . tfstate - ( self . tfstate & TFSTATE_RANDOMPC ) ;
2001-07-17 05:58:10 +00:00
}
// some states are kept
iszoom = 0 ;
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_ZOOMOFF )
2001-07-17 05:58:10 +00:00
iszoom = 1 ;
// Reset all tfstate flags, except for RANDOMPC
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_RANDOMPC )
2001-07-17 05:58:10 +00:00
{
oldclass = self . playerclass ;
2001-07-23 20:52:47 +00:00
self . playerclass = 1 + floor ( random ( ) * ( PC_RANDOM - 1 ) ) ;
2001-07-17 05:58:10 +00:00
while ( ! IsLegalClass ( self . playerclass ) | | ( self . playerclass = = oldclass ) )
2001-07-23 20:52:47 +00:00
self . playerclass = 1 + floor ( random ( ) * ( PC_RANDOM - 1 ) ) ;
self . tfstate = TFSTATE_RANDOMPC ;
2001-07-17 05:58:10 +00:00
}
else
self . tfstate = 0 ;
if ( iszoom = = 1 )
2001-07-23 20:52:47 +00:00
self . tfstate = self . tfstate | TFSTATE_ZOOMOFF ;
2001-07-17 05:58:10 +00:00
// Display the Player's Class
2001-07-23 20:52:47 +00:00
if ( ! ( self . done_custom = = 0 | | ( self . done_custom & CUSTOM_ON_SPAWN ) ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( self . playerclass ! = PC_CUSTOM )
TeamFortress_PrintClassName ( self , self . playerclass , ( self . tfstate & TFSTATE_RANDOMPC ) ) ;
2001-07-17 05:58:10 +00:00
else
TeamFortress_PrintJobName ( self , self . job ) ;
}
// Set the weapons and ammo for the player based on class
TeamFortress_SetEquipment ( ) ;
// Set the health for the player based on class
TeamFortress_SetHealth ( ) ;
// Set the speed for the player based on class
TeamFortress_SetSpeed ( self ) ;
// Set the skin for the player based on class
TeamFortress_SetSkin ( self ) ;
stuffcmd ( self , " v_idlescale 0 \n " ) ;
stuffcmd ( self , " v_cshift 0 0 0 0 \n " ) ;
//WK Clear Bastard Rotation
stuffcmd ( self , " -left;-right;cl_yawspeed 140 \n " ) ;
//WK Again, since they could lose their sentrygun in SetEquip...
DetonateAllGuns ( ) ;
# ifdef QUAKE_WORLD
SetTeamName ( self ) ;
# endif
W_SetCurrentAmmo ( ) ;
self . attack_finished = time + 0.3 ;
self . th_pain = player_pain ;
self . th_die = PlayerDie ;
// make sure that autozoom is reset
if ( self . height ! = 0 )
{
self . height = 0 ;
TF_zoom ( 90 ) ;
}
2001-07-23 20:52:47 +00:00
self . deadflag = DEAD_NO ;
2001-07-17 05:58:10 +00:00
// pausetime is set by teleporters to keep the player from moving a while
self . pausetime = 0 ;
spot = SelectSpawnPoint ( ) ;
2001-07-23 20:52:47 +00:00
if ( self . playerclass ! = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
spawn_tdeath ( spot . origin , self ) ;
self . observer_list = spot ;
self . origin = spot . origin + ' 0 0 1 ' ;
self . angles = spot . angles ;
2001-07-23 20:52:47 +00:00
self . fixangle = TRUE ; // turn this way immediately
2001-07-17 05:58:10 +00:00
# ifdef MAP_DEBUG
RPrint ( self . netname ) ;
RPrint ( " spawned at a " ) ;
RPrint ( spot . classname ) ;
if ( spot . team_no ! = 0 )
{
RPrint ( " , team_no of " ) ;
st = ftos ( spot . team_no ) ;
RPrint ( st ) ;
}
RPrint ( " \n " ) ;
# endif
// If this is a TeamSpawnpoint, check to see if it
// gives out a GoalItem, or displays a message
if ( spot . classname = = " info_player_teamspawn " )
{
if ( spot . items ! = 0 )
{
te = Finditem ( spot . items ) ;
if ( te )
tfgoalitem_GiveToPlayer ( te , self , self ) ;
2001-07-23 20:52:47 +00:00
if ( ! ( spot . goal_activation & TFSP_MULTIPLEITEMS ) )
2001-07-17 05:58:10 +00:00
spot . items = 0 ;
}
// Display teamspawn message
if ( spot . message )
{
CenterPrint ( self , spot . message ) ;
2001-07-23 20:52:47 +00:00
if ( ! ( spot . goal_activation & TFSP_MULTIPLEMSGS ) )
2001-07-17 05:58:10 +00:00
spot . message = string_null ;
}
// Activate a Goal if needed
if ( spot . activate_goal_no ! = 0 )
{
te = Findgoal ( spot . activate_goal_no ) ;
if ( te )
AttemptToActivate ( te , self , spot ) ;
}
// TeamSpawn points can remove themselves after being spawned on
2001-07-23 20:52:47 +00:00
if ( spot . goal_effects = = TFSP_REMOVESELF )
2001-07-17 05:58:10 +00:00
{
spot . classname = " deadpoint " ;
spot . team_str_home = string_null ;
spot . nextthink = time + 1 ;
spot . think = SUB_Remove ;
}
}
# ifdef QUAKE_WORLD
setmodel ( self , string_null ) ;
modelindex_null = self . modelindex ;
# endif
setmodel ( self , " progs/eyes.mdl " ) ;
modelindex_eyes = self . modelindex ;
setmodel ( self , " progs/player.mdl " ) ;
modelindex_player = self . modelindex ;
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
{
# ifdef QUAKE_WORLD
self . modelindex = modelindex_null ;
# else
setmodel ( self , string_null ) ;
# endif
self . current_menu = 1 ;
self . gravity = 0 ;
}
//WK DropIntoCustomClassGeneration
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_CUSTOM )
2001-07-17 05:58:10 +00:00
{
//WK Done_custom is initialized to 0, hackish yes.
//There are two entries, unintialized 0, or a person having issued a 'custom' command
2001-07-23 20:52:47 +00:00
//which sets the CUSTOM_ON_SPAWN flag
if ( self . done_custom = = 0 | | ( self . done_custom & CUSTOM_ON_SPAWN ) )
2001-07-17 05:58:10 +00:00
{
DropToCustomClassGen ( ) ;
}
else
{
self . maxspeed = self . custom_speed ; //Reset our speed
}
}
else {
self . done_custom = 0 ; //Unitialize this. Maybe set to ON_SPAWN...
}
2001-07-23 20:52:47 +00:00
setsize ( self , VEC_HULL_MIN , VEC_HULL_MAX ) ;
2001-07-17 05:58:10 +00:00
self . view_ofs = ' 0 0 22 ' ;
player_stand1 ( ) ;
if ( deathmatch | | coop )
{
makevectors ( self . angles ) ;
2001-07-23 20:52:47 +00:00
if ( self . playerclass ! = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
spawn_tfog ( self . origin + v_forward * 10 ) ;
}
# ifdef QUAKE_WORLD
// Set Rocket Jump Modifiers
if ( stof ( infokey ( world , " rj " ) ) ! = 0 )
rj = stof ( infokey ( world , " rj " ) ) ;
else
rj = 1 ;
# endif
//This code is in three places. client,custom & tfort.qc
//WK Give them invincibility if they are a normal class or bought it
2001-07-23 20:52:47 +00:00
if ( ( self . playerclass > = PC_SCOUT & & self . playerclass < = PC_RANDOM ) | |
self . tf_items & NIT_RESPAWN_GUARD ) {
self . items = self . items + IT_INVULNERABILITY ;
2001-07-17 05:58:10 +00:00
self . invincible_time = 1 ;
2001-07-23 20:52:47 +00:00
self . invincible_finished = time + RESPAWN_GUARD_TIME ;
2001-07-17 05:58:10 +00:00
if ( self . custom_speed > 300 )
self . invincible_finished = self . invincible_finished - 1 ;
if ( self . custom_speed > 400 )
self . invincible_finished = self . invincible_finished - 1 ;
}
} ;
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
QUAKED FUNCTIONS
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level .
*/
void ( ) info_player_start =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
/*QUAKED info_player_start2 (1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode .
*/
void ( ) info_player_start2 =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
/*
saved out by quaked in region mode
*/
void ( ) testplayerstart =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for deathmatch games
*/
void ( ) info_player_deathmatch =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for coop games
*/
void ( ) info_player_coop =
{
2001-07-23 20:52:47 +00:00
if ( CheckExistence ( ) = = FALSE )
2001-07-17 05:58:10 +00:00
{
dremove ( self ) ;
return ;
}
} ;
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
RULES
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
void ( entity c ) PrintClientScore =
{
if ( c . frags > - 10 & & c . frags < 0 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " " ) ;
2001-07-17 05:58:10 +00:00
else if ( c . frags > = 0 )
{
if ( c . frags < 100 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " " ) ;
2001-07-17 05:58:10 +00:00
if ( c . frags < 10 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , ftos ( c . frags ) ) ;
bprint ( PRINT_MEDIUM , " " ) ;
bprint ( PRINT_MEDIUM , c . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
} ;
void ( ) DumpScore =
{
local entity e , sort , walk ;
if ( world . chain )
error ( " DumpScore: world.chain is set " ) ;
// build a sorted lis
e = find ( world , classname , " player " ) ;
sort = world ;
while ( e )
{
if ( ! sort )
{
sort = e ;
e . chain = world ;
}
else
{
if ( e . frags > sort . frags )
{
e . chain = sort ;
sort = e ;
}
else
{
walk = sort ;
do
{
if ( ! walk . chain )
{
e . chain = world ;
walk . chain = e ;
}
else if ( walk . chain . frags < e . frags )
{
e . chain = walk . chain ;
walk . chain = e ;
}
else
walk = walk . chain ;
} while ( walk . chain ! = e ) ;
}
}
e = find ( e , classname , " player " ) ;
}
// print the list
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
while ( sort )
{
PrintClientScore ( sort ) ;
sort = sort . chain ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
} ;
/*
go to the next level for deathmatch
*/
float already_cycled ;
void ( ) NextLevel =
{
local entity o ;
local string st ;
if ( already_cycled )
return ;
2001-07-23 20:52:47 +00:00
already_cycled = TRUE ;
2001-07-17 05:58:10 +00:00
o = spawn ( ) ;
o . map = nextmap ;
o . think = execute_changelevel ;
o . nextthink = time + 0.1 ;
} ;
2001-07-23 15:08:39 +00:00
float cyclenow ;
2001-07-17 05:58:10 +00:00
/*
= = = = = = = = = = = =
CheckRules
Exit deathmatch games upon conditions
= = = = = = = = = = = =
*/
void ( ) CheckRules =
{
2001-07-23 15:08:39 +00:00
local string st ;
st = infokey ( world , " cyclenow " ) ;
if ( ! cyclenow & & ( st = = " 1 " | | st = = " on " ) )
{
cyclenow = 1 ;
localcmd ( " serverinfo cyclenow \" \" \n " ) ;
localcmd ( " localinfo cyclenow \" \" \n " ) ;
dprint ( " Cycling Map. \n " ) ;
2001-07-17 05:58:10 +00:00
NextLevel ( ) ;
2001-07-23 15:08:39 +00:00
}
else if ( cyclenow
| | ( timelimit & & time > = timelimit )
| | ( fraglimit & & self . frags > = fraglimit ) )
2001-07-17 05:58:10 +00:00
NextLevel ( ) ;
} ;
//============================================================================
void ( ) PlayerDeathThink =
{
local entity old_self ;
local float forward ;
2001-07-23 20:52:47 +00:00
if ( ( self . flags & FL_ONGROUND ) )
2001-07-17 05:58:10 +00:00
{
forward = vlen ( self . velocity ) ;
forward = forward - 20 ;
if ( forward < = 0 )
self . velocity = ' 0 0 0 ' ;
else
self . velocity = forward * normalize ( self . velocity ) ;
}
// wait for all buttons released
2001-07-23 20:52:47 +00:00
if ( self . deadflag = = DEAD_DEAD )
2001-07-17 05:58:10 +00:00
{
if ( self . button2 | | self . button1 | | self . button0 )
return ;
2001-07-23 20:52:47 +00:00
self . deadflag = DEAD_RESPAWNABLE ;
2001-07-17 05:58:10 +00:00
// make sure that respawn flag has not been set
2001-07-23 20:52:47 +00:00
self . tfstate = self . tfstate - ( self . tfstate & TFSTATE_RESPAWN_READY ) ;
2001-07-17 05:58:10 +00:00
return ;
}
// wait for any button down
if ( ! self . button2 & & ! self . button1 & & ! self . button0 )
{
// if no buttons, but respawn_ready flag is set, respawn
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_RESPAWN_READY )
2001-07-17 05:58:10 +00:00
{
if ( self . respawn_time < = time )
{
self . button0 = 0 ;
self . button1 = 0 ;
self . button2 = 0 ;
respawn ( ) ;
}
}
return ;
}
else
{
// button has been pressed, player is ready to respawn
2001-07-23 20:52:47 +00:00
self . tfstate = self . tfstate | TFSTATE_RESPAWN_READY ;
2001-07-17 05:58:10 +00:00
if ( self . respawn_time < = time )
{
self . button0 = 0 ;
self . button1 = 0 ;
self . button2 = 0 ;
respawn ( ) ;
}
return ;
}
} ;
void ( ) PlayerJump =
{
local vector start , end ;
2001-07-23 20:52:47 +00:00
if ( self . flags & FL_WATERJUMP )
2001-07-17 05:58:10 +00:00
return ;
if ( self . waterlevel > = 2 )
{
2001-07-23 20:52:47 +00:00
if ( self . watertype = = CONTENT_WATER )
2001-07-17 05:58:10 +00:00
self . velocity_z = 100 ;
2001-07-23 20:52:47 +00:00
else if ( self . watertype = = CONTENT_SLIME )
2001-07-17 05:58:10 +00:00
self . velocity_z = 80 ;
else
self . velocity_z = 50 ;
//WK
2001-07-23 20:52:47 +00:00
if ( self . tf_items & NIT_SCUBA )
2001-07-17 05:58:10 +00:00
self . velocity_z = 250 ;
// play swiming sound
2001-07-23 20:52:47 +00:00
if ( self . cutf_items & CUTF_STEALTH ) // SB no noise if we have stealth
2001-07-17 05:58:10 +00:00
return ;
if ( self . swim_flag < time )
{
self . swim_flag = time + 1 ;
if ( random ( ) < 0.5 )
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_BODY , " misc/water1.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_BODY , " misc/water2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
}
return ;
}
2001-07-23 20:52:47 +00:00
if ( ! ( self . flags & FL_ONGROUND ) )
2001-07-17 05:58:10 +00:00
return ;
2001-07-23 20:52:47 +00:00
if ( ! ( self . flags & FL_JUMPRELEASED ) )
2001-07-17 05:58:10 +00:00
return ; // don't pogo stick
2001-07-23 20:52:47 +00:00
self . flags = self . flags - ( self . flags & FL_JUMPRELEASED ) ;
2001-07-17 05:58:10 +00:00
self . button2 = 0 ;
// player jumping sound
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) ) // Only play it if we don't have stealth
sound ( self , CHAN_BODY , " player/plyrjmp8.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
//WK Sprinters jump higher
//SB No, people with high jump do
2001-07-23 20:52:47 +00:00
if ( self . cutf_items & CUTF_HIGHJUMP )
2001-07-17 05:58:10 +00:00
self . velocity_z = self . velocity_z + 400 ;
# ifndef QUAKE_WORLD
self . velocity_z = self . velocity_z + 270 ;
# endif
} ;
/*
= = = = = = = = = = =
WaterMove
= = = = = = = = = = = =
*/
. float dmgtime ;
void ( ) WaterMove =
{
// RPrint (ftos(self.waterlevel));
2001-07-23 20:52:47 +00:00
if ( self . movetype = = MOVETYPE_NOCLIP )
2001-07-17 05:58:10 +00:00
return ;
if ( self . health < 0 )
return ;
//WK Poison attacks
2001-07-23 20:52:47 +00:00
if ( self . tfstate & ( TFSTATE_HALLUCINATING | TFSTATE_TRANQUILISED ) )
2001-07-17 05:58:10 +00:00
{
if ( self . air_finished < time )
{ // drown!
if ( self . pain_finished < time )
{
self . dmg = self . dmg + 0.5 ;
if ( self . dmg = = 2.5 ) //Initial damage is 2
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Your lungs are still paralyzed. Try to minimize your exposure to poison \n " ) ;
2001-07-17 05:58:10 +00:00
if ( self . dmg > 6 )
self . dmg = 2.2 ;
if ( self . dmg < self . health - 1 )
2001-07-23 20:52:47 +00:00
TF_T_Damage ( self , world , world , self . dmg , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
self . pain_finished = time + 1 ;
}
}
}
else if ( self . waterlevel ! = 3 )
{
if ( self . air_finished < time )
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_VOICE , " player/gasp2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
else if ( self . air_finished < time + 9 )
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_VOICE , " player/gasp1.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
self . air_finished = time + 12 ;
self . dmg = 2 ;
}
else if ( self . air_finished < time )
{ // drown!
if ( self . pain_finished < time )
{
self . dmg = self . dmg + 2 ;
if ( self . dmg > 15 )
self . dmg = 10 ;
2001-07-23 20:52:47 +00:00
TF_T_Damage ( self , world , world , self . dmg , TF_TD_IGNOREARMOUR , TF_TD_OTHER ) ;
2001-07-17 05:58:10 +00:00
self . pain_finished = time + 1 ;
}
}
if ( ! self . waterlevel )
{
2001-07-23 20:52:47 +00:00
if ( self . flags & FL_INWATER )
2001-07-17 05:58:10 +00:00
{
// play leave water sound
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) ) // SB only if no stealth
sound ( self , CHAN_BODY , " misc/outwater.wav " , 1 , ATTN_NORM ) ;
self . flags = self . flags - FL_INWATER ;
2001-07-17 05:58:10 +00:00
//WK Setspeed for Scuba commando
2001-07-23 20:52:47 +00:00
if ( self . tf_items & NIT_SCUBA )
2001-07-17 05:58:10 +00:00
TeamFortress_SetSpeed ( self ) ;
}
return ;
}
2001-07-23 20:52:47 +00:00
if ( self . watertype = = CONTENT_LAVA )
2001-07-17 05:58:10 +00:00
{ // do damage
if ( self . dmgtime < time )
{
if ( self . radsuit_finished > time )
self . dmgtime = time + 1 ;
else
self . dmgtime = time + 0.2 ;
// Asbestos armor helps against lava, but I doubt it'll save you :)
2001-07-23 20:52:47 +00:00
TF_T_Damage ( self , world , world , 10 * self . waterlevel , 0 , TF_TD_FIRE ) ;
2001-07-17 05:58:10 +00:00
}
}
2001-07-23 20:52:47 +00:00
else if ( self . watertype = = CONTENT_SLIME )
2001-07-17 05:58:10 +00:00
{ // do damage
if ( self . dmgtime < time & & self . radsuit_finished < time )
{
self . dmgtime = time + 1 ;
//T_Damage (self, world, world, 4*self.waterlevel);
2001-07-23 20:52:47 +00:00
TF_T_Damage ( self , world , world , 4 * self . waterlevel , 0 , TF_TD_ELECTRICITY ) ;
2001-07-17 05:58:10 +00:00
}
}
2001-07-23 20:52:47 +00:00
if ( ! ( self . flags & FL_INWATER ) )
2001-07-17 05:58:10 +00:00
{
// player enter water sound
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) )
if ( self . watertype = = CONTENT_LAVA )
sound ( self , CHAN_BODY , " player/inlava.wav " , 1 , ATTN_NORM ) ;
else if ( self . watertype = = CONTENT_WATER )
sound ( self , CHAN_BODY , " player/inh2o.wav " , 1 , ATTN_NORM ) ;
else if ( self . watertype = = CONTENT_SLIME )
sound ( self , CHAN_BODY , " player/slimbrn2.wav " , 1 , ATTN_NORM ) ;
self . flags = self . flags + FL_INWATER ;
2001-07-17 05:58:10 +00:00
self . dmgtime = 0 ;
//WK Setspeed for scuba commando
2001-07-23 20:52:47 +00:00
if ( self . tf_items & NIT_SCUBA )
2001-07-17 05:58:10 +00:00
TeamFortress_SetSpeed ( self ) ;
}
# ifndef QUAKE_WORLD
2001-07-23 20:52:47 +00:00
if ( ! ( self . flags & FL_WATERJUMP ) )
2001-07-17 05:58:10 +00:00
self . velocity = self . velocity - 0.8 * self . waterlevel * frametime * self . velocity ;
# endif
} ;
void ( ) CheckWaterJump =
{
local vector start , end ;
// check for a jump-out-of-water
makevectors ( self . angles ) ;
start = self . origin ;
start_z = start_z + 8 ;
v_forward_z = 0 ;
normalize ( v_forward ) ;
end = start + v_forward * 24 ;
2001-07-23 20:52:47 +00:00
traceline ( start , end , TRUE , self ) ;
2001-07-17 05:58:10 +00:00
if ( trace_fraction < 1 )
{ // solid at waist
start_z = start_z + self . maxs_z - 8 ;
end = start + v_forward * 24 ;
self . movedir = trace_plane_normal * - 50 ;
2001-07-23 20:52:47 +00:00
traceline ( start , end , TRUE , self ) ;
2001-07-17 05:58:10 +00:00
if ( trace_fraction = = 1 )
{ // open at eye level
2001-07-23 20:52:47 +00:00
self . flags = self . flags | FL_WATERJUMP ;
2001-07-17 05:58:10 +00:00
self . velocity_z = 225 ;
2001-07-23 20:52:47 +00:00
self . flags = self . flags - ( self . flags & FL_JUMPRELEASED ) ;
2001-07-17 05:58:10 +00:00
self . teleport_time = time + 2 ; // safety net
return ;
}
}
} ;
/*
= = = = = = = = = = = = = = = =
PlayerPreThink
Called every frame before physics are run
= = = = = = = = = = = = = = = =
*/
void ( ) PlayerPreThink =
{
local float mspeed , aspeed , r ;
local vector src ;
//WK -- For LPB calculation
local string foo ;
local float ping ;
if ( self . is_feigning & & self . waterlevel = = 1 )
{
2001-07-23 20:52:47 +00:00
self . watertype = CONTENT_WATER ;
2001-07-17 05:58:10 +00:00
self . waterlevel = 3 ;
}
if ( self . cheat_level > 0 )
self . cheat_level = self . cheat_level - 1 ;
if ( self . speed_level > 0 ) //Cyto
self . speed_level = self . speed_level - 1 ;
if ( intermission_running )
{
IntermissionThink ( ) ; // otherwise a button could be missed between
return ; // the think tics
}
makevectors ( self . v_angle ) ; // is this still used?
# ifdef QUAKE_WORLD // culled by KK. was QUAKE_WORLD
if ( infokey ( world , " ceasefire " ) = = " on " ) //Cyto
{
# ifndef ceasefire_allows_to_move
if ( self . lip )
self . origin = self . oldorigin ;
else
{
self . velocity_z = - 5000 ;
self . velocity_x = 0 ;
self . velocity_y = 0 ;
2001-07-23 20:52:47 +00:00
if ( self . flags & FL_ONGROUND )
2001-07-17 05:58:10 +00:00
{
self . oldorigin = self . origin ;
2001-07-23 20:52:47 +00:00
self . lip = TRUE ;
2001-07-17 05:58:10 +00:00
}
}
# endif
CenterPrint ( self , " Ceasefire Applies " ) ;
if ( ! Good_Impulse ( self . impulse ) ) //See admin.qc
self . impulse = 0 ;
self . button0 = 0 ;
self . button1 = 0 ;
self . button2 = 0 ;
}
else if ( self . lip )
{
2001-07-23 20:52:47 +00:00
self . lip = FALSE ;
2001-07-17 05:58:10 +00:00
centerprint ( self , " " ) ;
}
# endif
// End Cyt0
CheckRules ( ) ;
//xxxx
//WK Supercharged observer mode!
2001-07-23 20:52:47 +00:00
if ( self . playerclass = = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
{
if ( self . button0 )
{
//WK Nifty code to push through walls only if we really want to
if ( vlen ( self . velocity ) < 200 )
{
src = self . origin + normalize ( v_forward ) * 5 ;
setorigin ( self , src ) ;
}
self . velocity = normalize ( v_forward ) * 400 ;
}
else
{
foo = infokey ( self , " ping " ) ;
ping = 200 ;
if ( foo ! = string_null )
ping = stof ( foo ) ;
if ( ping < 300 ) {
self . velocity_x = floor ( ( 3 * self . velocity_x ) / 4 ) ;
self . velocity_y = floor ( ( 3 * self . velocity_y ) / 4 ) ;
self . velocity_z = floor ( ( 3 * self . velocity_z ) / 4 ) ;
}
}
if ( self . button2 )
self . velocity = ' 0 0 0 ' ;
return ;
//WK Removed jump == autoteam
//WK Removed all the demo stuff stuff.
}
if ( self . view_ofs = = ' 0 0 0 ' )
return ; // intermission or finale
2001-07-23 20:52:47 +00:00
if ( self . playerclass ! = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
WaterMove ( ) ;
# ifndef QUAKE_WORLD
2001-07-23 20:52:47 +00:00
if ( self . waterlevel = = 2 & & self . playerclass ! = PC_UNDEFINED )
2001-07-17 05:58:10 +00:00
CheckWaterJump ( ) ;
# endif
2001-07-23 20:52:47 +00:00
if ( self . deadflag > = DEAD_DEAD )
2001-07-17 05:58:10 +00:00
{
PlayerDeathThink ( ) ;
return ;
}
if ( self . undercover_team | | self . undercover_skin | | self . is_undercover )
{
2001-07-23 20:52:47 +00:00
if ( self . effects & ( EF_DIMLIGHT | EF_BRIGHTLIGHT ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_MEDIUM , " The glowing removes your disguise. \n " ) ;
2001-07-17 05:58:10 +00:00
Spy_RemoveDisguise ( self ) ;
}
}
2001-07-23 20:52:47 +00:00
/*if (self.job & JOB_THIEF && self.job & JOB_FULL_HIDE)
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( self . effects & ( EF_DIMLIGHT | EF_BRIGHTLIGHT ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_MEDIUM , " The glowing removes your full invisibility. \n " ) ;
self . job = self . job - ( self . job & JOB_FULL_HIDE ) ;
self . job = self . job | JOB_ACTIVE ;
2001-07-17 05:58:10 +00:00
}
} */
2001-07-23 20:52:47 +00:00
if ( self . deadflag = = DEAD_DYING )
2001-07-17 05:58:10 +00:00
return ; // dying, so do nothing
if ( ! self . is_feigning )
{
if ( self . button2 )
{
PlayerJump ( ) ; //WK This just does noises for jumps
}
else
2001-07-23 20:52:47 +00:00
self . flags = self . flags | FL_JUMPRELEASED ;
2001-07-17 05:58:10 +00:00
}
//WK Scuba commando treads water :)
2001-07-23 20:52:47 +00:00
if ( ( self . tf_items & NIT_SCUBA ) & & self . waterlevel > 1 ) {
2001-07-17 05:58:10 +00:00
if ( self . velocity_z > = - 25 & & self . velocity_z < 0 )
self . velocity_z = 10 ; //Tread water if near a stop
}
//Jello Water :)
else if ( jello & & self . waterlevel > 1 ) {
2001-07-23 20:52:47 +00:00
if ( jello = = TRUE ) //Binary on/off
2001-07-17 05:58:10 +00:00
self . velocity_z = 1000 ; //900 is a better number for 2forts
else
self . velocity_z = jello ;
}
// teleporters can force a non-moving pause time
if ( time < self . pausetime )
self . velocity = ' 0 0 0 ' ;
2001-07-23 20:52:47 +00:00
if ( time > self . attack_finished & & self . currentammo = = 0 & & self . weapon > WEAP_AXE )
2001-07-17 05:58:10 +00:00
{
self . weapon = W_BestWeapon ( ) ;
W_SetCurrentAmmo ( ) ;
}
// Do grapple stuff if I'm on a hook
if ( self . on_hook )
{
Service_Grapple ( ) ;
if ( self . button2 & & self . velocity_z > 10 )
self . velocity_z = 10 ; //WK Allow more creative physics with hook
}
//WK Add Hover Boot Support
2001-07-23 20:52:47 +00:00
if ( self . tf_items & NIT_HOVER_BOOTS ) {
2001-07-17 05:58:10 +00:00
if ( self . button2 & & self . velocity_z < 0 & & self . hover_time > 0 & & self . waterlevel = = 0 )
{ //Try to hover
self . velocity_z = 100 ; //+10 == hover
self . hover_time = self . hover_time - 0.25 ; //0.1 == tick time
if ( self . hover_time < = 0 ) {
self . hover_time = - 5 ; //3 second penalty for draining it
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Your boots are out of fuel, let them recharge \n " ) ;
2001-07-17 05:58:10 +00:00
}
//Spit out fire from them!
if ( self . search_time < time ) {
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " weapons/flmfire2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
local entity flame ;
flame = spawn ( ) ;
2001-07-23 20:52:47 +00:00
flame . owner = self ; flame . movetype = MOVETYPE_FLYMISSILE ;
flame . solid = SOLID_BBOX ; flame . classname = " flamerflame " ;
2001-07-17 05:58:10 +00:00
makevectors ( self . v_angle ) ;
flame . velocity = - 1 * v_up ; flame . velocity = flame . velocity * 600 ;
flame . touch = Boot_Flamer_stream_touch ; flame . think = s_explode1 ;
flame . nextthink = time + 0.1 ; setmodel ( flame , " progs/s_explod.spr " ) ;
setsize ( flame , ' 0 0 0 ' , ' 0 0 0 ' ) ;
setorigin ( flame , self . origin + v_up * - 16 ) ;
self . search_time = time + 0.15 ;
}
}
else { //Recharger <- That's French for "recharge"
self . hover_time = self . hover_time + 0.01 ; //0.05 is a half-tick
2001-07-23 20:52:47 +00:00
if ( self . hover_time > MAX_HOVER_FUEL & & ( ! ( self . tf_items & NIT_HOVER_BOOTS_UPGRADE ) ) )
self . hover_time = MAX_HOVER_FUEL ;
if ( self . hover_time > ( MAX_HOVER_FUEL * 2 ) & & self . tf_items & NIT_HOVER_BOOTS_UPGRADE )
self . hover_time = ( MAX_HOVER_FUEL * 2 ) ;
2001-07-17 05:58:10 +00:00
}
}
} ;
/*
= = = = = = = = = = = = = = = =
CheckPowerups
Check for turning off powerups
= = = = = = = = = = = = = = = =
*/
void ( ) CheckPowerups =
{
local float lighton ;
local entity te ;
if ( self . health < = 0 )
return ;
// Invisibility
//WK Made people invis during building, and during thief's full hide
//WK And while being inspired by chaplan
2001-07-23 20:52:47 +00:00
if ( self . done_custom & CUSTOM_BUILDING | | //We are building a custom class
self . playerclass = = PC_UNDEFINED | | //Or we're in observer mode
( self . job & JOB_THIEF & & self . job & JOB_FULL_HIDE ) | | //Or we are fully hiding thieves
//(self.tfstate & TFSTATE_INSPIRED && !(self.job & JOB_CHAPLAN)) || //ofN comented by
self . aura = = AURA_INVIS ) //- OfN
2001-07-17 05:58:10 +00:00
{
self . modelindex = modelindex_null ; // don't use eyes
}
2001-07-23 20:52:47 +00:00
else if ( ( self . is_undercover = = 1 & & invis_only = = TRUE ) | | ( self . job & JOB_THIEF & & self . job & JOB_ACTIVE ) )
2001-07-17 05:58:10 +00:00
{
self . frame = 0 ;
self . modelindex = modelindex_eyes ;
}
else if ( self . invisible_finished )
{
// If this is being given by a goalitem, extend the time
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_INVISIBLE )
2001-07-17 05:58:10 +00:00
{
if ( self . invisible_finished < time + 10 )
self . invisible_finished = time + 666 ;
}
// sound and screen flash when items starts to run out
if ( self . invisible_sound < time )
{
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " items/inv3.wav " , 0.5 , ATTN_IDLE ) ;
2001-07-17 05:58:10 +00:00
self . invisible_sound = time + ( ( random ( ) * 3 ) + 1 ) ;
}
if ( self . invisible_finished < time + 3 )
{
if ( self . invisible_time = = 1 )
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Ring of Shadows magic is fading \n " ) ;
2001-07-17 05:58:10 +00:00
stuffcmd ( self , " bf \n " ) ;
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " items/inv2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
self . invisible_time = time + 1 ;
}
if ( self . invisible_time < time )
{
self . invisible_time = time + 1 ;
stuffcmd ( self , " bf \n " ) ;
}
}
if ( self . invisible_finished < time )
{ // just stopped
2001-07-23 20:52:47 +00:00
self . items = self . items - IT_INVISIBILITY ;
2001-07-17 05:58:10 +00:00
self . invisible_finished = 0 ;
self . invisible_time = 0 ;
}
// use the eyes
self . frame = 0 ;
self . modelindex = modelindex_eyes ;
}
else
self . modelindex = modelindex_player ; // don't use eyes
// invincibility
if ( self . invincible_finished )
{
// If this is being given by a goalitem, extend the time
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_INVINCIBLE )
2001-07-17 05:58:10 +00:00
{
if ( self . invincible_finished < time + 10 )
self . invincible_finished = time + 666 ;
}
// sound and screen flash when items starts to run out
if ( self . invincible_finished < time + 3 )
{
if ( self . invincible_time = = 1 )
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Protection is almost burned out \n " ) ;
2001-07-17 05:58:10 +00:00
stuffcmd ( self , " bf \n " ) ;
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " items/protect2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
self . invincible_time = time + 1 ;
}
if ( self . invincible_time < time )
{
self . invincible_time = time + 1 ;
stuffcmd ( self , " bf \n " ) ;
}
}
if ( self . invincible_finished < time )
{ // just stopped
2001-07-23 20:52:47 +00:00
self . items = self . items - IT_INVULNERABILITY ;
2001-07-17 05:58:10 +00:00
self . invincible_time = 0 ;
self . invincible_finished = 0 ;
}
if ( self . invincible_finished > time )
2001-07-23 20:52:47 +00:00
self . effects = self . effects | EF_DIMLIGHT ;
2001-07-17 05:58:10 +00:00
else
{
// Only remove dimlight if it's not being supplied by a GoalItem
2001-07-23 20:52:47 +00:00
lighton = FALSE ;
2001-07-17 05:58:10 +00:00
te = find ( world , classname , " item_tfgoal " ) ;
while ( te )
{
if ( te . owner = = self )
{
2001-07-23 20:52:47 +00:00
if ( te . goal_activation & TFGI_GLOW )
lighton = TRUE ;
2001-07-17 05:58:10 +00:00
}
te = find ( te , classname , " item_tfgoal " ) ;
}
if ( ! lighton )
2001-07-23 20:52:47 +00:00
self . effects = self . effects - ( self . effects & EF_DIMLIGHT ) ;
2001-07-17 05:58:10 +00:00
}
}
// super damage
if ( self . super_damage_finished )
{
// If this is being given by a goalitem, extend the time
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_QUAD )
2001-07-17 05:58:10 +00:00
{
if ( self . super_damage_finished = = time + 10 )
self . super_damage_finished = time + 666 ;
}
// sound and screen flash when items starts to run out
2001-07-23 20:52:47 +00:00
if ( self . super_damage_finished < time + 3 & & ! ( self . tfstate & TFSTATE_INSPIRED ) )
2001-07-17 05:58:10 +00:00
{
if ( self . super_time = = 1 )
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Quad Damage is wearing off \n " ) ;
2001-07-17 05:58:10 +00:00
stuffcmd ( self , " bf \n " ) ;
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " items/damage2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
self . super_time = time + 1 ;
}
if ( self . super_time < time )
{
self . super_time = time + 1 ;
stuffcmd ( self , " bf \n " ) ;
}
}
if ( self . super_damage_finished < time )
{ // just stopped
2001-07-23 20:52:47 +00:00
self . items = self . items - IT_QUAD ;
2001-07-17 05:58:10 +00:00
self . super_damage_finished = 0 ;
self . super_time = 0 ;
//WK If inspired, remove inspiration
2001-07-23 20:52:47 +00:00
self . tfstate = self . tfstate - ( self . tfstate & TFSTATE_INSPIRED ) ;
2001-07-17 05:58:10 +00:00
}
if ( self . super_damage_finished > time )
2001-07-23 20:52:47 +00:00
self . effects = self . effects | EF_DIMLIGHT ;
2001-07-17 05:58:10 +00:00
else
{
// Only remove dimlight if it's not being supplied by a GoalItem
2001-07-23 20:52:47 +00:00
lighton = FALSE ;
2001-07-17 05:58:10 +00:00
te = find ( world , classname , " item_tfgoal " ) ;
while ( te )
{
if ( te . owner = = self )
{
2001-07-23 20:52:47 +00:00
if ( te . goal_activation & TFGI_GLOW )
lighton = TRUE ;
2001-07-17 05:58:10 +00:00
}
te = find ( te , classname , " item_tfgoal " ) ;
}
if ( ! lighton )
2001-07-23 20:52:47 +00:00
self . effects = self . effects - ( self . effects & EF_DIMLIGHT ) ;
2001-07-17 05:58:10 +00:00
}
}
// suit
if ( self . radsuit_finished )
{
self . air_finished = time + 12 ; // don't drown
// If this is being given by a goalitem, extend the time
2001-07-23 20:52:47 +00:00
if ( self . tfstate & TFSTATE_RADSUIT | | self . tf_items & NIT_SCUBA )
2001-07-17 05:58:10 +00:00
{
//WK Do we need this? if (self.radsuit_finished == time + 10)
self . radsuit_finished = time + 666 ;
}
// sound and screen flash when items starts to run out
if ( self . radsuit_finished < time + 3 )
{
if ( self . rad_time = = 1 )
{
2001-07-23 20:52:47 +00:00
sprint ( self , PRINT_HIGH , " Air supply in Biosuit expiring \n " ) ;
2001-07-17 05:58:10 +00:00
stuffcmd ( self , " bf \n " ) ;
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_AUTO , " items/suit2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
self . rad_time = time + 1 ;
}
if ( self . rad_time < time )
{
self . rad_time = time + 1 ;
stuffcmd ( self , " bf \n " ) ;
}
}
if ( self . radsuit_finished < time )
{ // just stopped
2001-07-23 20:52:47 +00:00
self . items = self . items - IT_SUIT ;
2001-07-17 05:58:10 +00:00
self . rad_time = 0 ;
self . radsuit_finished = 0 ;
}
}
2001-07-23 20:52:47 +00:00
if ( self . aura = = AURA_INVIS )
2001-07-17 05:58:10 +00:00
if ( self . aura_time < time )
{
if ( self . invisible_finished < time )
2001-07-23 20:52:47 +00:00
self . items = self . items - ( self . items & IT_INVISIBILITY ) ;
2001-07-17 05:58:10 +00:00
self . aura = 0 ;
}
} ;
void ( ) DeadImpulses ;
/*
= = = = = = = = = = = = = = = =
Called every frame after physics are run
= = = = = = = = = = = = = = = =
*/
void ( ) PlayerPostThink =
{
local float mspeed , aspeed ;
local float r ;
if ( self . view_ofs = = ' 0 0 0 ' )
return ; // intermission or finale
# ifdef QUAKE_WORLD // culled by KK. was QUAKE_WORLD
if ( infokey ( world , " ceasefire " ) = = " on " ) //Cyto
if ( ! Good_Impulse ( self . impulse ) ) //See admin.qc
self . impulse = 0 ;
# endif
if ( self . deadflag )
{
DeadImpulses ( ) ; // check for dead-only commands
self . impulse = 0 ;
return ;
}
// check to see if player landed and play landing sound
2001-07-23 20:52:47 +00:00
if ( self . takedamage & & ( self . jump_flag < - 300 ) & & ( self . flags & FL_ONGROUND ) & & ( self . health > 0 ) )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( self . watertype = = CONTENT_WATER )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) )
sound ( self , CHAN_BODY , " player/h2ojump.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
}
else if ( self . jump_flag < - 650 )
{
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) ) { //WK Judo teaches falling... SB ceaf judo
2001-07-17 05:58:10 +00:00
self . deathtype = " falling " ;
T_Damage ( self , world , world , 5 ) ;
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_VOICE , " player/land2.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
}
}
else
2001-07-23 20:52:47 +00:00
if ( ! ( self . cutf_items & CUTF_STEALTH ) ) //WK Judo teaches falling... SB ceaf judo
sound ( self , CHAN_VOICE , " player/land.wav " , 1 , ATTN_NORM ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-19 11:56:52 +00:00
self . netname = infokey ( self , " name " ) ;
2001-07-17 05:58:10 +00:00
self . jump_flag = self . velocity_z ;
CheckPowerups ( ) ;
W_WeaponFrame ( ) ;
// Display MOTD
// Sync this with tforthlp.qc and menu.qc
2001-07-23 20:52:47 +00:00
if ( self . motd < MOTD_FINISHED )
2001-07-17 05:58:10 +00:00
TeamFortress_MOTD ( ) ;
else if ( self . cheat_check = = 0 )
self . cheat_check = time + 10 ;
# ifdef STATUSBAR
else if ( time > self . StatusRefreshTime & & self . StatusBarSize ! = 0 )
{
if ( self . StatusBarScreen = = 1 )
RefreshStatusBar1 ( self ) ; //Sentry screen
else if ( self . StatusBarScreen = = 2 )
RefreshStatusBar2 ( self ) ; //Spy screen
else if ( self . StatusBarScreen = = 3 )
RefreshStatusBar3 ( self ) ; //Misc screen
else if ( self . StatusBarScreen = = 4 )
RefreshStatusBar4 ( self ) ; //Tesla screen
else if ( self . StatusBarScreen = = 5 )
RefreshStatusBar5 ( self ) ; //Scanner screen
else
RefreshStatusBar ( self ) ; //Normal scores and clip
}
# endif
// Check for Team Cheats
if ( self . cheat_check < = time )
{
TeamFortress_CheckTeamCheats ( ) ;
# ifdef QUAKE_WORLD
self . cheat_check = time + 5 ;
# else
self . cheat_check = time + 1 ;
# endif
}
} ;
/*
= = = = = = = = = = =
ClientConnect
called when a player connects to a server
= = = = = = = = = = = =
*/
void ( ) ClientConnect =
{
local string st ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , self . netname ) ;
bprint ( PRINT_HIGH , " has joined the server \n " ) ;
2001-07-17 05:58:10 +00:00
//- OfN - shouldnt be needed anyway...
self . admin_kick = world ;
// Set Default autozoom
2001-07-23 20:52:47 +00:00
if ( DEFAULT_AUTOZOOM = = OFF )
self . tfstate = self . tfstate | TFSTATE_ZOOMOFF ;
2001-07-17 05:58:10 +00:00
// Set the MOTD on
self . motd = 0 ;
// Clear the Alias Flag
self . got_aliases = 0 ;
self . ff_count = 0 ; //WK Clear the friendly-fire counter
# ifdef QUAKE_WORLD
//RJM
st = infokey ( self , " sbr " ) ;
if ( st = = string_null )
//RJM
st = infokey ( self , " sbar_res " ) ;
if ( st = = " 768 " )
self . StatusBarRes = 8 ;
else if ( st = = " 600 " )
self . StatusBarRes = 7 ;
else if ( st = = " 480 " )
self . StatusBarRes = 6 ;
else if ( st = = " 400 " )
self . StatusBarRes = 5 ;
else if ( st = = " 384 " )
self . StatusBarRes = 4 ;
else if ( st = = " 350 " )
self . StatusBarRes = 3 ;
else if ( st = = " 300 " )
self . StatusBarRes = 2 ;
else if ( st = = " 240 " )
self . StatusBarRes = 1 ;
else
self . StatusBarRes = 0 ;
//RJM
st = infokey ( self , " sbs " ) ;
if ( st = = string_null )
//RJM
st = infokey ( self , " sbar_size " ) ;
self . StatusBarSize = stof ( st ) ;
if ( self . StatusBarSize > 2 | | self . StatusBarSize < 0 )
self . StatusBarSize = 0 ;
# endif
2001-07-23 20:52:47 +00:00
self . has_disconnected = FALSE ;
2001-07-17 05:58:10 +00:00
//PlayerObserverMode(); //ofn already commented out
self . gravity = 0 ;
2001-07-23 20:52:47 +00:00
self . movetype = MOVETYPE_FLY ;
2001-07-17 05:58:10 +00:00
// a client connecting during an intermission can cause problems
if ( intermission_running )
GotoNextMap ( ) ;
//- OfN
if ( mapname = = " huntedr " )
{
local float result ;
2001-07-23 20:52:47 +00:00
result = floor ( TeamFortress_TeamGetNoPlayers ( 2 ) * HUNTED_YELLOWTEAM_FACTOR ) ;
2001-07-17 05:58:10 +00:00
team3maxplayers = result ;
if ( team3maxplayers < 1 ) team3maxplayers = 1 ;
}
} ;
/*
= = = = = = = = = = =
ClientDisconnect
called when a player disconnects from a server
= = = = = = = = = = = =
*/
void ( ) ClientDisconnect =
{
local float teamsup ;
local entity te ;
# ifndef QUAKE_WORLD
if ( gameover )
return ;
# endif
local string st ;
st = ftos ( floor ( self . real_frags ) ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , self . netname ) ;
bprint ( PRINT_HIGH , " has left the game with " ) ;
bprint ( PRINT_HIGH , st ) ;
bprint ( PRINT_HIGH , " frags and " ) ;
2001-07-17 05:58:10 +00:00
st = ftos ( floor ( self . ff_count ) ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , st ) ;
bprint ( PRINT_HIGH , " teamkills \n " ) ;
2001-07-17 05:58:10 +00:00
//- he got significant score?
/*local float temp_scr;
local float avr_team_scr ;
avr_team_scr = ( team1score + team2score + team3score + team4score ) / number_of_teams ;
temp_scr = fabs ( self . real_frags ) + self . ff_count ;
if ( ( temp_scr > time | | time > 20 ) & & time < 60 * 60 & & deathmatch = = 3 )
{
local float final_score ;
final_score = self . real_frags - self . ff_count * 3 - avr_team_scr / 2 ;
if ( final_score < - 50 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " bad enough to ban him! hehe \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 0 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " damn newbie! \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 10 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " he was not doing much \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 30 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " a regular player \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 50 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " not bad! \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 75 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " good score \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 100 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " cool score! \n " ) ;
2001-07-17 05:58:10 +00:00
else if ( final_score < 125 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " he is a real master of customTF! \n " ) ;
else bprint ( PRINT_HIGH , " omg! did he cheat? awesome score! \n " ) ;
2001-07-17 05:58:10 +00:00
} */
//- OfN
if ( mapname = = " huntedr " )
{
local float result ;
2001-07-23 20:52:47 +00:00
result = floor ( TeamFortress_TeamGetNoPlayers ( 2 ) * HUNTED_YELLOWTEAM_FACTOR ) ;
2001-07-17 05:58:10 +00:00
team3maxplayers = result ;
if ( team3maxplayers < 1 ) team3maxplayers = 1 ;
}
2001-07-23 20:52:47 +00:00
sound ( self , CHAN_BODY , " player/tornoff2.wav " , 1 , ATTN_NONE ) ;
self . has_disconnected = TRUE ;
2001-07-17 05:58:10 +00:00
if ( debug_target = = self )
debug_target = world ;
// Remove Timers
TeamFortress_RemoveTimers ( ) ;
// Remove Buildings
DetonateAllGunsForced ( ) ;
/*Find_And_Dmg("building_dispenser", self, 1);
Find_And_Dmg ( " building_sentrygun " , self , 1 ) ;
Find_And_Dmg ( " building_tesla " , self , 1 ) ;
Find_And_Dmg ( " building_camera " , self , 1 ) ;
Find_And_Dmg ( " building_teleporter " , self , 1 ) ;
Find_And_Dmg ( " building_sensor " , self , 1 ) ; //sb*/
//WK Added demon cleanup
kill_my_demon ( ) ;
//WK Added ammobox/pipebomb fix
te = find ( world , classname , " ammobox " ) ;
while ( te )
{
if ( te . enemy = = self ) {
num_world_ammoboxes = num_world_ammoboxes - 1 ;
if ( te . enemy . team_no ! = 0 )
decrement_team_ammoboxes ( self . team_no ) ;
}
te . think = SUB_Remove ;
te . nextthink = time + 0.1 ;
te = find ( te , classname , " ammobox " ) ;
}
te = find ( world , classname , " pipebomb " ) ;
while ( te )
{
if ( te . owner = = self ) {
num_world_pipebombs = num_world_pipebombs - 1 ;
decrement_team_pipebombs ( self . team_no ) ;
te . think = SUB_Remove ;
te . nextthink = time + 0.1 ;
}
te = find ( te , classname , " pipebomb " ) ;
}
// OfN - Remove holograph if player disconnects!
if ( self . has_holo > 0 ) RemoveHolo ( self ) ;
DetonateMines ( self ) ;
RemoveArmyTimer ( ) ;
// Remove Detpacks
te = find ( world , classname , " detpack " ) ;
while ( te )
{
if ( te . owner = = self )
{
if ( te . weaponmode = = 1 ) // Detpack was being disarmed
{
2001-07-23 20:52:47 +00:00
te . enemy . tfstate = te . enemy . tfstate - ( te . enemy . tfstate & TFSTATE_CANT_MOVE ) ;
2001-07-17 05:58:10 +00:00
# ifdef QUAKE_WORLD
TeamFortress_SetSpeed ( te . enemy ) ;
# else
te . enemy . pausetime = time ;
# endif
dremove ( te . oldenemy ) ; // CountDown
dremove ( te . observer_list ) ; // Disarm timer
}
dremove ( te ) ;
te = world ;
}
te = find ( te , classname , " detpack " ) ;
}
set_suicide_frame ( ) ;
self . netname = string_null ;
self . team_no = 0 ;
2001-07-23 20:52:47 +00:00
self . solid = SOLID_NOT ;
self . movetype = MOVETYPE_NONE ; //WK Stop crashing MOVETYPE_WALK bug?
2001-07-17 05:58:10 +00:00
setsize ( self , ' 0 0 0 ' , ' 0 0 0 ' ) ;
} ;
/*
= = = = = = = = = = =
ClientObituary
called when a player dies
= = = = = = = = = = = =
*/
void ( entity targ , entity attacker ) ClientObituary =
{
local float rnum ;
local string deathstring , deathstring2 ;
local float attackerteam , targteam ;
local entity te ;
local entity oself ;
// FIXME:
//- OfN - Unidentified kill ---------//
deathstring = " is killed by " ;
deathstring2 = " \n " ;
// I still have no idea when this is used
//-----------------------------------//
if ( prematch > = time )
return ;
rnum = random ( ) ;
if ( targ . classname = = " player " )
{
//WK No Obituary for the cursed!
if ( targ . penance_time > time - 1 )
{
Give_Frags_Out ( targ , targ , - 1 , 0 , 1 , 1 , 0 ) ;
/* targ.real_frags = targ.real_frags - 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
targ . frags = targ . real_frags ;
*/ return ;
}
if ( targ . martyr_enemy ! = targ )
deathmsg = targ . stored_deathmsg ;
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_CYBERNET )
2001-07-17 05:58:10 +00:00
{
//local string tst;
//tst=GetBuildingName(attacker);
//if (rnum < 0.5)
//{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " will abort the hack next time \n " ) ;
//bprint (PRINT_MEDIUM, attacker.real_owner.netname);
//bprint (PRINT_MEDIUM, "'s hack-protected");
//bprint (PRINT_MEDIUM, tst);
//bprint (PRINT_MEDIUM, "\n");
2001-07-17 05:58:10 +00:00
//}
/*else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " has been lost in the cybernet! \n " ) ; */
//bprint (PRINT_MEDIUM, attacker.real_owner.netname);
//bprint (PRINT_MEDIUM, "'s ");
//bprint (PRINT_MEDIUM, tst);
//bprint (PRINT_MEDIUM, "\n");
2001-07-17 05:58:10 +00:00
//}
/*else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " dies hacking a \n " ) ;
//bprint (PRINT_MEDIUM, attacker.real_owner.netname);
//bprint (PRINT_MEDIUM, "'s ");
bprint ( PRINT_MEDIUM , tst ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
} */
Give_Frags_Out ( targ , targ , - 1 , 0 , 1 , 1 , 0 ) ;
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_ANTIHACK )
2001-07-17 05:58:10 +00:00
{
local string tst ;
tst = GetBuildingName ( attacker ) ;
if ( rnum < 0.5 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is electrocuted trying to hack " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
bprint ( PRINT_MEDIUM , tst ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " should never tried to hack " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
bprint ( PRINT_MEDIUM , tst ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
Give_Frags_Out ( targ , targ , - 1 , 0 , 1 , 1 , 0 ) ;
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_ANTIDISM )
2001-07-17 05:58:10 +00:00
{
local string tst ;
tst = GetBuildingName ( attacker ) ;
if ( rnum < 0.5 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " tries to dismantle " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
bprint ( PRINT_MEDIUM , tst ) ;
bprint ( PRINT_MEDIUM , " with the wrong tool \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is electrocuted trying to dismantle " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
bprint ( PRINT_MEDIUM , tst ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
Give_Frags_Out ( targ , targ , - 1 , 0 , 1 , 1 , 0 ) ;
return ;
}
//- OfN - Wizard death stuff
if ( attacker . classname = = " monster_wizard " )
{
custom_demon_name ( attacker ) ; //CH
//If our own demon killed us, kill demon and cost 2 frags
if ( attacker . real_owner = = targ ) {
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , - 2 , 0 , 1 , 1 , 0 ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " kills his owner, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
//kill_my_demon(); //Demon dies too
return ;
}
else if ( ( ! Teammate ( targ . team_no , attacker . real_owner . team_no ) ) | | attacker . real_owner . team_no < 1 )
{
if ( rnum > 0.6 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was nullified by the scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum > 0.3 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " didn't survive " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) acid \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " , removes " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , 1 , 0 , 1 , 1 , 0 ) ;
return ;
}
else if ( Teammate ( targ . team_no , attacker . real_owner . team_no ) )
{
if ( rnum < 0.5 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The supposed friendly scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) " ) ;
bprint ( PRINT_MEDIUM , " killed " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM, "");
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) proves that scrags are able to teamkill with " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " 's help \n " ) ;
2001-07-17 05:58:10 +00:00
}
//Give_Frags_Out(attacker.real_owner, attacker.real_owner, -1, 0, 1, 1, 0);
return ;
}
}
//WK
if ( attacker . classname = = " monster_demon1 " )
{
custom_demon_name ( attacker ) ; //CH
//If our own demon killed us, kill demon and cost 2 frags
if ( attacker . real_owner = = targ ) {
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , - 2 , 0 , 1 , 1 , 0 ) ;
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags - 2;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_DEMON_FIRE )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " threw his rage to his owner " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
if ( rnum < 0.5 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " exacts revenge on its summoner, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is dragged into the pit by his own demon, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
//kill_my_demon(); //Demon dies too
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_DEMON_FIRE )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.2 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was burned alive by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.5 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " thought he was safe from " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.75 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " died from " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) fire balls \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " , burned " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " to a crisp \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
if ( rnum < 0.1 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was eviscerated by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.50 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was ripped limb from limb by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
2001-07-17 05:58:10 +00:00
if ( rnum < 0.75 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " , claws apart " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " , rends apart " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
if ( ! Teammate ( targ . team_no , attacker . real_owner . team_no ) | | attacker . real_owner . team_no < 1 )
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
return ;
}
// Grunt demon death stuff
if ( attacker . classname = = " monster_army " ) //SB-1 Tech - Share and Enjoy!
{
custom_demon_name ( attacker ) ; //CH
GetRank ( attacker ) ; // Sponsored by SB-1 Tech
//If our own demon killed us, kill demon and cost 2 frags
if ( attacker . real_owner = = targ )
{
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , - 2 , 0 , 1 , 1 , 0 ) ;
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags - 2;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
/*if (rnum < 0.5)
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " greets his client " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " with a bullet in the back of the head \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{ */
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is killed by his own mercenary " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
//}
return ;
}
if ( Teammate ( targ . team_no , attacker . real_owner . team_no ) )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
2001-07-17 05:58:10 +00:00
if ( rnum < 0.25 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " mows down a teammate \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.50 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " checks his glasses \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.75 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " gets a frag for the other team \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " loses another friend \n " ) ;
2001-07-17 05:58:10 +00:00
}
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_AXE )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( attacker . cutf_items & CUTF_KNIFE )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is sliced and diced by " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) blade \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is split in two by a powerful axe blow from " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BACKSTAB )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is filleted by " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SHOTGUN )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " practices being " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) clay pigeon \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_NAILGUN )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is turned into " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) pincushion \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_ROCKETL )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " declares that " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " IS the rocket man \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SSHOTGUN )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is turned into swiss cheese by " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) buckshot \n " ) ;
2001-07-17 05:58:10 +00:00
}
if ( ! Teammate ( targ . team_no , attacker . real_owner . team_no ) | | attacker . real_owner . team_no < 1 )
{
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , 1 , 0 , 1 , 1 , 0 ) ;
Give_Frags_Out ( attacker , attacker , 1 , 0 , 1 , 1 , 0 ) ;
}
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
return ;
}
if ( attacker . classname = = " monster_shambler " )
{
custom_demon_name ( attacker ) ; //CH
//If our own demon killed us, kill demon and cost 2 frags
if ( attacker . real_owner = = targ ) {
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , - 2 , 0 , 1 , 1 , 0 ) ;
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags - 2;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_LIGHTNING )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " annihilates its owner " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " with a bolt of lightning \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DEMON_FIRE )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " detonates its owner " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " with a fireball \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
if ( rnum < 0.5 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " gets sick of its owner " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " screams as " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " turns on his owner \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
//kill_my_demon(); //Demon dies too - OfN nope!
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_LIGHTNING )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.2 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " 's body crackles with electricity as " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) claims another victim \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.5 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " meets a bolt of lightning directed by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.75 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " 's goose is cooked by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) lightning \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " , teaches " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " to cook without gas \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DEMON_FIRE )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is obliterated by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " )'s fireball \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is turned into little " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " s by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " )'s fireball \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
if ( rnum < 0.02 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " screams as " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " )'s claws slash down \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.1 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was torn asunder by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.50 ) {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is smashed into next week by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else {
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
2001-07-17 05:58:10 +00:00
if ( rnum < 0.75 )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " , tears " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " , rips " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " to shreds \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
if ( ! Teammate ( targ . team_no , attacker . real_owner . team_no ) | | attacker . real_owner . team_no < 1 )
Give_Frags_Out ( attacker . real_owner , attacker . real_owner , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.real_owner.real_frags = attacker.real_owner.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
return ;
}
if ( attacker . classname = = " teledeath " )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " was telefragged by " ) ;
bprint ( PRINT_MEDIUM , attacker . owner . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
if ( ! Teammate ( targ . team_no , attacker . owner . team_no ) | | attacker . owner . team_no < 1 )
Give_Frags_Out ( attacker . owner , attacker . owner , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.owner.real_frags = attacker.owner.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . owner . frags = attacker . owner . real_frags ;
*/
return ;
}
if ( attacker . classname = = " teledeath2 " )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " Satan's power deflects " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " 's telefrag \n " ) ;
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( targ , targ , - 1 , 1 , 1 , 1 , 0 ) ;
/* targ.real_frags = targ.real_frags - 1;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
targ . frags = targ . real_frags ;
# ifdef QUAKE_WORLD
logfrag ( targ , targ ) ;
# endif
*/
return ;
}
// Killed by a goal
if ( attacker . classname = = " info_tfgoal " )
{
if ( attacker . deathtype ! = " " )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , attacker . deathtype ) ;
2001-07-17 05:58:10 +00:00
}
# ifdef QUAKE_WORLD
logfrag ( targ , targ ) ;
# endif
return ;
}
if ( attacker . classname = = " player " )
{
if ( targ = = attacker )
{
// killed self
Give_Frags_Out ( attacker , attacker , - 1 , 0 , 1 , 1 , 1 ) ;
/* attacker.real_frags = attacker.real_frags - 1;
2001-07-23 20:52:47 +00:00
if ( teamplay & TEAMPLAY_VAMPIRE ) //WK
2001-07-17 05:58:10 +00:00
attacker . real_frags = attacker . real_frags - 1 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . frags = attacker . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
2001-07-17 05:58:10 +00:00
deathstring = " kills himself! \n " ;
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_GREN_HAND )
2001-07-17 05:58:10 +00:00
deathstring = " grenades himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_MARTYR )
2001-07-17 05:58:10 +00:00
{
//if (rnum <= 0.5)
deathstring = " dies for the cause \n " ;
//else
// deathstring = " is persecuted to death\n";
/*
2001-07-23 20:52:47 +00:00
//if (!(targ.job & JOB_MARTYR_ENEMY)) {
2001-07-17 05:58:10 +00:00
if ( rnum < = 0.5 )
deathstring = " dies for the heck of it \n " ;
else
deathstring = " dies with style \n " ;
else {
//Give last person who attacked him a frag
2001-07-23 20:52:47 +00:00
if ( targ . martyr_enemy . classname = = " player " & & targ . martyr_enemy . has_disconnected = = FALSE ) {
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( targ . martyr_enemy , targ , 1 , 1 , 1 , 1 , 0 ) ;
}
if ( rnum < = 0.5 )
deathstring = " dies for the cause \n " ;
else
deathstring = " is persecuted to death \n " ;
} */
}
2001-07-23 20:52:47 +00:00
/*else if (deathmsg == DMSG_EXPBODY) - OfN - No need!
2001-07-17 05:58:10 +00:00
{
deathstring = " 's body explodes! \n " ;
} */
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BERSERK )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
deathstring = " collapses from exhaustion \n " ;
else
deathstring = " goes down fighting \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_NAIL )
2001-07-17 05:58:10 +00:00
deathstring = " hammers himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_FRAG )
2001-07-17 05:58:10 +00:00
deathstring = " fragments himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LAND_MINE )
2001-07-17 05:58:10 +00:00
deathstring = " forgot where he put his minefield \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_MIRV )
2001-07-17 05:58:10 +00:00
deathstring = " goes to pieces \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_PIPE )
2001-07-17 05:58:10 +00:00
deathstring = " ambushes himself with his own pipebombs \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_GAS )
2001-07-17 05:58:10 +00:00
deathstring = " chokes on his own gas \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_EMP )
2001-07-17 05:58:10 +00:00
deathstring = " explodes his ammo and body \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_FLASH )
2001-07-17 05:58:10 +00:00
deathstring = " is charred by his own flash grenade \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_EMP_AMMO )
2001-07-17 05:58:10 +00:00
deathstring = " detonates an ammo box too close to him \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DETPACK )
2001-07-17 05:58:10 +00:00
deathstring = " set the detpack and forgot to run \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BIOWEAPON )
2001-07-17 05:58:10 +00:00
deathstring = " died by his own infection! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FORCEFIELD )
2001-07-17 05:58:10 +00:00
deathstring = " is fried in his own force field \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_STUCK_FORCEFIELD )
2001-07-17 05:58:10 +00:00
deathstring = " is caught and shocked to death in his own force field \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SPANNERFIELD )
2001-07-17 05:58:10 +00:00
deathstring = " learns something about spanners and force fields... \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_MAUSER )
2001-07-17 05:58:10 +00:00
deathstring = " assassinated himself! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DAEDALUS )
2001-07-17 05:58:10 +00:00
deathstring = " flew too close to the sun! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AIRG | | deathmsg = = DMSG_AIRG_WATER )
2001-07-17 05:58:10 +00:00
deathstring = " Airfists his own ass! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_JUDOKA )
2001-07-17 05:58:10 +00:00
deathstring = " broke his own arms! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AXE )
2001-07-17 05:58:10 +00:00
deathstring = " drove an axe through his own head! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BACKSTAB )
2001-07-17 05:58:10 +00:00
deathstring = " drove a knife into his own heart! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FGTRAP )
2001-07-17 05:58:10 +00:00
deathstring = " explodes with his own (trapped) field generator! \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_CALTROP )
2001-07-17 05:58:10 +00:00
deathstring = " stepped on too many of his own caltrops \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FLYCALTROP )
2001-07-17 05:58:10 +00:00
deathstring = " was spiked by his own catlrop \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_ROCKETL )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
deathstring = " becomes bored with life \n " ;
else
deathstring = " checks if his weapon is loaded \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_CLUSTER_ROCKET )
2001-07-17 05:58:10 +00:00
deathstring = " eats his clusters \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LASERCANNON )
2001-07-17 05:58:10 +00:00
deathstring = " blasts himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_INCENDIARY )
2001-07-17 05:58:10 +00:00
deathstring = " chars himself with an incendiary rocket \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GRENADEL )
2001-07-17 05:58:10 +00:00
deathstring = " tries to put the pin back in \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FLAME )
2001-07-17 05:58:10 +00:00
deathstring = " torches himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_HOVER ) //WK
2001-07-17 05:58:10 +00:00
deathstring = " dies from uncomfortable boots \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LIGHTNING )
2001-07-17 05:58:10 +00:00
deathstring = " electrocutes himself \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LIGHTNING & & targ . waterlevel > 1 )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " discharges into the water. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , deathstring ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else if ( teamplay & & Teammate ( targ . team_no , attacker . team_no ) )
{
// killed a team member
if ( Teammate ( targ . team_no , attacker . team_no ) )
Give_Frags_Out ( attacker , attacker , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team member
else
Give_Frags_Out ( attacker , attacker , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_MEDIKIT )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " didn't survive the operation. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_EXPBODY ) //- OfN
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " has been killed as a side effect of " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " 's body explosion \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( rnum < 0.25 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " mows down teammate " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.50 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " checks his glasses after killing " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
2001-07-17 05:58:10 +00:00
}
else if ( rnum < 0.75 )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " gets a frag for the other team with " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " 's death " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " doesn't wuv " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " any more! Wah! " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 1 , 1 , 1 , 1 ) ;
//CH
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( attacker . tfstate & TFSTATE_INSPIRED ) {
2001-07-17 05:58:10 +00:00
attacker . inspirator . real_frags =
attacker . inspirator . real_frags + 0.5 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . inspirator . frags =
attacker . inspirator . real_frags ;
}
if ( attacker . aura & & attacker . crusader_inspirator ! = world )
{
attacker . crusader_inspirator . real_frags = attacker . crusader_inspirator . real_frags + 0.5 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . crusader_inspirator . frags = attacker . crusader_inspirator . real_frags ;
}
//WK
2001-07-23 20:52:47 +00:00
/* if (teamplay & TEAMPLAY_VAMPIRE) //Frag vamp
2001-07-17 05:58:10 +00:00
targ . real_frags = targ . real_frags - 1 ;
# ifdef QUAKE_WORLD
logfrag ( attacker , targ ) ;
# endif
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) ) {
2001-07-17 05:58:10 +00:00
attacker . frags = attacker . real_frags ;
targ . frags = targ . real_frags ; //In case of vampire
}
*/
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_CLUSTER_ROCKET )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
{
deathstring = " is put away by " ;
deathstring2 = " 's cluster rockets \n " ;
}
else
{
deathstring = " is destroyed by " ;
deathstring2 = " 's cluster rockets \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_EXPBODY )
2001-07-17 05:58:10 +00:00
{
deathstring = " is killed by " ;
deathstring2 = " 's body explosion \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_HAND )
2001-07-17 05:58:10 +00:00
{
deathstring = " surfs on a grenade from " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_NAIL )
2001-07-17 05:58:10 +00:00
{
deathstring = " gets flayed by " ;
deathstring2 = " 's nail grenade \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_FRAG ) //WK
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 ) {
deathstring = " is slashed apart by " ;
deathstring2 = " 's frag grenade \n " ;
}
else if ( rnum < 0.75 ) {
deathstring = " 's jugular artery is severed by " ;
deathstring2 = " 's frag grenade. \n " ;
}
else {
deathstring = " 's carotoid artery is severed by " ;
deathstring2 = " 's frag grenade. \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_MIRV )
2001-07-17 05:58:10 +00:00
{
deathstring = " gets spammed by " ;
deathstring2 = " 's Mirv grenade \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_CALTROP )
2001-07-17 05:58:10 +00:00
{
deathstring = " collects one too many of " ;
deathstring2 = " 's caltrops \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FLYCALTROP )
2001-07-17 05:58:10 +00:00
{
deathstring = " was spiked by " ;
deathstring2 = " 's caltrops \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_PIPE )
2001-07-17 05:58:10 +00:00
{
deathstring = " is caught by " ;
deathstring2 = " 's pipebomb trap \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_GAS )
2001-07-17 05:58:10 +00:00
{
deathstring = " gags on " ;
deathstring2 = " 's noxious gasses \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_EMP )
2001-07-17 05:58:10 +00:00
{
deathstring = " 's ammo detonates him as " ;
deathstring2 = " 's EMP fries it. \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_FLASH )
2001-07-17 05:58:10 +00:00
{
deathstring = " is charred by " ;
deathstring2 = " 's flash grenade. \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GREN_EMP_AMMO )
2001-07-17 05:58:10 +00:00
{
deathstring = " stands near some ammo as " ;
deathstring2 = " 's EMP nukes it \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DETPACK )
2001-07-17 05:58:10 +00:00
{
deathstring = " reaches orbit via " ;
deathstring2 = " 's detpack \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DETPACK_DIS )
2001-07-17 05:58:10 +00:00
{
deathstring = " cut the red wire of " ;
deathstring2 = " 's detpack \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BIOWEAPON )
2001-07-17 05:58:10 +00:00
{
deathstring = " dies from " ;
deathstring2 = " 's mysterious tropical disease \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_MAUSER )
2001-07-17 05:58:10 +00:00
{
/* deathstring = " is assassinated by ";
deathstring2 = " 's Mauser WK-77 \n " ; */
2001-07-23 20:52:47 +00:00
sprint ( attacker , PRINT_HIGH , " You mercilessly slaughter " ) ;
sprint ( attacker , PRINT_HIGH , targ . netname ) ;
sprint ( attacker , PRINT_HIGH , " ! \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DAEDALUS )
2001-07-17 05:58:10 +00:00
{
deathstring = " is melted by " ;
deathstring2 = " 's Daedalus impulse rifle \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BIOWEAPON_ATT )
2001-07-17 05:58:10 +00:00
{
deathstring = " escapes infection from " ;
deathstring2 = " by dying first \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_GRENADEL )
2001-07-17 05:58:10 +00:00
{
deathstring = " eats " ;
deathstring2 = " 's pineapple \n " ;
if ( targ . health < - 40 )
{
deathstring = " was gibbed by " ;
deathstring2 = " 's grenade \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_STUCK_FORCEFIELD )
2001-07-17 05:58:10 +00:00
{
deathstring = " is fried in " ;
deathstring2 = " 's force field \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FORCEFIELD )
2001-07-17 05:58:10 +00:00
{
deathstring = " had a shocking experience on " ;
deathstring2 = " 's force field \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FGTRAP )
2001-07-17 05:58:10 +00:00
{
deathstring = " explodes with " ;
deathstring2 = " 's trapped field generator \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_ROCKETL )
2001-07-17 05:58:10 +00:00
{
deathstring = " rides " ;
deathstring2 = " 's rocket \n " ;
if ( targ . health < - 40 )
{
deathstring = " was gibbed by " ;
deathstring2 = " 's rocket \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_HOVER ) //WK
2001-07-17 05:58:10 +00:00
{
deathstring = " choked on " ;
deathstring2 = " 's hover exhaust \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LAND_MINE ) //WK
2001-07-17 05:58:10 +00:00
{
deathstring2 = " 's land mine \n " ;
if ( rnum < 0.8 )
deathstring = " walked over " ;
else
deathstring = " was launched 40 ft into the air by " ;
if ( targ . health < - 40 )
{
if ( rnum < 0.8 )
deathstring = " was turned into a shower of gibs by " ;
else
deathstring = " was launched 80 ft into the air by " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_FLAME )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.2 )
{
deathstring = " is burnt up by " ;
deathstring2 = " 's flame \n " ;
}
else if ( rnum < 0.4 )
{
deathstring = " is fried by " ;
deathstring2 = " 's fire \n " ;
}
else if ( rnum < 0.6 )
{
deathstring = " feels " ;
deathstring2 = " 's fire of wrath \n " ;
}
else if ( rnum < 0.8 )
{
deathstring = " is reduced to ashes by " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " is grilled by " ;
deathstring2 = " 's flame \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AXE )
2001-07-17 05:58:10 +00:00
{
deathstring2 = " \n " ;
2001-07-23 20:52:47 +00:00
if ( attacker . cutf_items & CUTF_KNIFE )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
if ( attacker . job & JOB_WARLOCK )
2001-07-17 05:58:10 +00:00
{
deathstring = " is forced to donate his blood by " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " was knife-murdered by " ;
}
}
else
deathstring = " was axe-murdered by " ;
//if (attacker.demon_blood < 0) //WK Sanity Check
// attacker.demon_blood = 0;
// if the above ever happens you've got a serious bug that needs fixing
// don't get around it by cheap hacks - SB
2001-07-23 20:52:47 +00:00
if ( attacker . demon_blood < MAX_KNIFE_BLOOD ) //SB - OfN defined max now
2001-07-17 05:58:10 +00:00
attacker . demon_blood = attacker . demon_blood + 1 ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SPANNER )
2001-07-17 05:58:10 +00:00
{
deathstring = " was spanner-murdered by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SHOTGUN )
2001-07-17 05:58:10 +00:00
{
deathstring = " chewed on " ;
deathstring2 = " 's boomstick \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SSHOTGUN )
2001-07-17 05:58:10 +00:00
{
deathstring = " ate 2 loads of " ;
deathstring2 = " 's buckshot \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_NAILGUN )
2001-07-17 05:58:10 +00:00
{
deathstring = " was nailed by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SNG )
2001-07-17 05:58:10 +00:00
{
deathstring = " was spiked by " ;
deathstring2 = " 's super nailgun \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LIGHT_ASSAULT )
2001-07-17 05:58:10 +00:00
{
if ( rnum < = 0.1 ) {
deathstring = " wishes " ;
deathstring2 = " 's gun was still an SNG \n " ;
}
else if ( rnum < = 0.5 ) {
deathstring = " gets felled by " ;
deathstring2 = " 's light assault cannon \n " ;
}
else {
deathstring = " gets sawn almost in half by " ;
deathstring2 = " \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LIGHTNING )
2001-07-17 05:58:10 +00:00
{
if ( rnum < = 0.1 ) {
deathstring = " has never seen a lightning gun in TF before. ( " ;
deathstring2 = " has.) \n " ;
}
else if ( rnum < = 0.2 ) {
deathstring = " is thunderstruck by " ;
deathstring2 = " 's gun \n " ;
}
else if ( rnum < = 0.4 ) {
deathstring = " is electrocuted by " ;
deathstring2 = " 's thunderbolt \n " ;
}
else if ( rnum < = 0.7 ) {
deathstring = " is shocked to death by " ;
deathstring2 = " 's lightning gun \n " ;
}
else {
deathstring = " accepts " ;
if ( attacker . waterlevel > 1 )
deathstring2 = " 's discharge \n " ;
else
deathstring2 = " 's shaft \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_HOOK )
2001-07-17 05:58:10 +00:00
{
deathstring = " grappled with " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_JUDOKA )
2001-07-17 05:58:10 +00:00
{
deathstring = " had his arms broken by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AIRG )
2001-07-17 05:58:10 +00:00
{
deathstring = " is ventilated by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LASERCANNON )
2001-07-17 05:58:10 +00:00
{
deathstring = " was blasted by " ;
deathstring2 = " 's laser cannon \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_DISPEL )
2001-07-17 05:58:10 +00:00
{
deathstring = " is banished to the netherworld by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AIRG_WATER )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
{
deathstring = " learns to swim backwards with " ;
deathstring2 = " 's help \n " ;
}
else
{
deathstring = " is underwater-airfisted by " ;
deathstring2 = " \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SNIPERRIFLE )
2001-07-17 05:58:10 +00:00
{
if ( rnum < = 0.5 )
{
deathstring = " takes a bullet in the chest from " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " succumbs to sniperfire from " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
if ( attacker . cutf_items & CUTF_OTR ) //- OfN
2001-07-17 05:58:10 +00:00
{
/*local float rnum2;
rnum2 = random ( ) ;
if ( rnum2 < = 0.3 )
{
deathstring = " will never be the same after " ;
deathstring2 = " 's shot \n " ;
}
else if ( rnum2 < = 0.4 )
{ */
//deathstring = " gets a huge OTR implant from "; //organic torsion relay
deathstring = " learns from " ;
deathstring2 = " what an OTR bullet is \n " ;
//}
/*else if (rnum2 <= 0.6)
{
deathstring = " gets a huge OTR implant from " ;
deathstring = " \n " ;
} */
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SNIPERHEADSHOT )
2001-07-17 05:58:10 +00:00
{
if ( rnum < = 0.5 )
{
deathstring = " gets a third eye from " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " gets his head blown off by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
if ( attacker . cutf_items & CUTF_OTR ) //- OfN
2001-07-17 05:58:10 +00:00
{
if ( random ( ) < = 0.6 )
{
deathstring = " 's head flies away due to " ;
deathstring2 = " and his OTR bullets \n " ;
}
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SNIPERLEGSHOT )
2001-07-17 05:58:10 +00:00
{
if ( rnum < = 0.5 )
{
deathstring = " is made legless by " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " gets his legs blown off by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
if ( attacker . cutf_items & CUTF_OTR ) //- OfN
2001-07-17 05:58:10 +00:00
{
if ( random ( ) < = 0.25 )
{
deathstring = " owns a metallic replacement for his legs from " ;
deathstring2 = " \n " ;
}
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_AUTORIFLE )
2001-07-17 05:58:10 +00:00
{
deathstring = " collects " ;
deathstring2 = " 's bullet spray. \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_ASSAULTCANNON )
2001-07-17 05:58:10 +00:00
{
deathstring = " gets sawn in half by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BACKSTAB )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 )
{
deathstring = " gets assassinated by " ;
deathstring2 = " \n " ;
}
else
{
deathstring = " is knifed from behind by " ;
deathstring2 = " \n " ;
}
//if (attacker.demon_blood < 0) //WK Sanity Check
// attacker.demon_blood = 0;
// See previous comment - SB
2001-07-23 20:52:47 +00:00
if ( attacker . demon_blood < MAX_KNIFE_BLOOD ) //SB
2001-07-17 05:58:10 +00:00
attacker . demon_blood = attacker . demon_blood + 1 ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_TRANQ )
2001-07-17 05:58:10 +00:00
{
deathstring = " is put to sleep by " ;
deathstring2 = " \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_LASERBOLT )
2001-07-17 05:58:10 +00:00
{
deathstring = " gets a hole in his heart from " ;
deathstring2 = " 's railgun \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_INCENDIARY )
2001-07-17 05:58:10 +00:00
{
deathstring = " gets well done by " ;
deathstring2 = " 's incendiary rocket \n " ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , deathstring ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , deathstring2 ) ;
2001-07-17 05:58:10 +00:00
}
return ;
}
else if ( attacker . classname = = " building_dispenser " )
{
2001-07-23 20:52:47 +00:00
if ( ! ( attacker . is_malfunctioning & SCREWUP_TWO ) & & ! ( attacker . is_malfunctioning & SCREWUP_FOUR ) )
2001-07-17 05:58:10 +00:00
{
if ( targ = = attacker . real_owner )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " dispenses with himself \n " ) ;
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " didn't insert the correct change into " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's dispenser \n " ) ;
2001-07-17 05:58:10 +00:00
if ( Teammate ( targ . team_no , attacker . team_no ) )
Give_Frags_Out ( attacker , attacker , - 1 , 0 , 1 , 1 , 0 ) ;
else
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
}
}
else
{
if ( targ = = attacker . real_owner )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is blown apart by his trapped dispenser \n " ) ;
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( attacker . real_owner , attacker , - 1 , 0 , 1 , 1 , 0 ) ;
}
else if ( targ = = attacker . martyr_enemy )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " should've stayed away from " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's dispenser \n " ) ;
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( attacker . martyr_enemy , attacker , - 1 , 0 , 1 , 1 , 0 ) ;
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . martyr_enemy . netname ) ;
bprint ( PRINT_MEDIUM , " laughs as " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " is blown to pieces by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's trapped dispenser \n " ) ;
2001-07-17 05:58:10 +00:00
Give_Frags_Out ( attacker . martyr_enemy , targ , 1 , 0 , 1 , 1 , 0 ) ;
}
}
return ;
}
else if ( attacker . classname = = " building_sentrygun " | | attacker . classname = = " building_tesla " )
{
if ( targ = = attacker . real_owner )
{
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_SENTRYGUN_ROCKET )
2001-07-17 05:58:10 +00:00
deathstring = " intercepts his sentry gun's rocket \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SENTRYGUN_BULLET )
2001-07-17 05:58:10 +00:00
deathstring = " crossed his sentry gun's line of fire \n " ;
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BUG_ZAPPER )
2001-07-17 05:58:10 +00:00
deathstring = " was electrocuted by his own sentry \n " ;
else
deathstring = " let his sentry turn against him \n " ; //CH
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , deathstring ) ;
2001-07-17 05:58:10 +00:00
}
else
{
if ( Teammate ( targ . team_no , attacker . team_no ) ) { //remove frags if team member
//CH its not the sentry/tesla's fault so only take from owner
// Give_Frags_Out(attacker, targ, -1, 0, 2, 0, 0); //gun
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 1 , 1 , 1 , 0 ) ;
} else {
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //gun
Give_Frags_Out ( attacker . real_owner , targ , 1 , 1 , 1 , 1 , 0 ) ;
}
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_SENTRYGUN_ROCKET )
2001-07-17 05:58:10 +00:00
{
deathstring = " hates " ;
deathstring2 = " 's sentry gun \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_SENTRYGUN_BULLET )
2001-07-17 05:58:10 +00:00
{
deathstring = " is mown down by " ;
deathstring2 = " 's sentry gun \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_TESLA )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.5 ) {
deathstring = " was electrocuted by " ;
deathstring2 = " 's tesla coil \n " ;
}
else if ( rnum < 0.75 ) {
deathstring = " was shocked to pieces by " ;
deathstring2 = " 's tesla sentry \n " ;
}
else {
deathstring = " was annihilated by " ;
deathstring2 = " 's tesla gun \n " ;
}
}
2001-07-23 20:52:47 +00:00
else if ( deathmsg = = DMSG_BUG_ZAPPER )
2001-07-17 05:58:10 +00:00
{
if ( rnum < 0.25 ) {
deathstring = " made a frying sound after running into " ;
deathstring2 = " 's Sentry Point Defense System \n " ;
}
else if ( rnum < 0.5 ) {
deathstring = " is cooked at 400 degrees by " ;
deathstring2 = " 's sentry gun \n " ;
}
else if ( rnum < 0.75 ) {
deathstring = " is disentegrated by " ;
deathstring2 = " 's Sentry Point Defense System \n " ;
}
else {
deathstring = " is obliterated by " ;
deathstring2 = " 's sentry gun \n " ;
}
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , deathstring ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , deathstring2 ) ;
2001-07-17 05:58:10 +00:00
}
}
else if ( attacker . classname = = " building_teleporter " )
{
2001-07-23 20:52:47 +00:00
sprint ( attacker . martyr_enemy , PRINT_HIGH , targ . netname ) ;
sprint ( attacker . martyr_enemy , PRINT_HIGH , " disappears into the void. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( targ , targ , - 1 , 1 , 1 , 1 , 0 ) ;
/*
# ifdef QUAKE_WORLD
logfrag ( targ , targ ) ;
# endif
targ . real_frags = targ . real_frags - 1 ; // killed self
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
targ . frags = targ . real_frags ;
*/
rnum = targ . watertype ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , targ . netname ) ;
2001-07-17 05:58:10 +00:00
if ( rnum = = - 3 )
{
if ( random ( ) < 0.5 )
deathstring = " sleeps with the fishes \n " ;
else
deathstring = " ate before swimming \n " ; //CH
}
else if ( rnum = = - 4 )
{
if ( random ( ) < 0.5 )
deathstring = " gulped a load of slime \n " ;
else
deathstring = " can't exist on slime alone \n " ;
}
else if ( rnum = = - 5 )
{
if ( targ . health < - 15 )
{
deathstring = " burst into flames \n " ;
}
else if ( random ( ) < 0.5 )
deathstring = " turned into hot slag \n " ;
else
deathstring = " visits the Volcano God \n " ;
}
# ifndef QUAKE_WORLD
//#ifdef COOP_MODE
2001-07-23 20:52:47 +00:00
else if ( attacker . flags & FL_MONSTER )
2001-07-17 05:58:10 +00:00
{
if ( attacker . classname = = " monster_army " )
deathstring = " was shot by a Grunt \n " ;
else if ( attacker . classname = = " monster_demon1 " )
deathstring = " was eviscerated by a Fiend \n " ;
else if ( attacker . classname = = " monster_dog " )
deathstring = " was mauled by a Rottweiler \n " ;
else if ( attacker . classname = = " monster_dragon " )
deathstring = " was fried by a Dragon \n " ;
else if ( attacker . classname = = " monster_enforcer " )
deathstring = " was blasted by an Enforcer \n " ;
else if ( attacker . classname = = " monster_fish " )
deathstring = " was fed to the Rotfish \n " ;
else if ( attacker . classname = = " monster_hell_knight " )
deathstring = " was slain by a Death Knight \n " ;
else if ( attacker . classname = = " monster_knight " )
deathstring = " was slashed by a Knight \n " ;
else if ( attacker . classname = = " monster_ogre " )
deathstring = " was destroyed by an Ogre \n " ;
else if ( attacker . classname = = " monster_oldone " )
deathstring = " became one with Shub-Niggurath \n " ;
else if ( attacker . classname = = " monster_shalrath " )
deathstring = " was exploded by a Vore \n " ;
else if ( attacker . classname = = " monster_shambler " )
deathstring = " was smashed by a Shambler \n " ;
else if ( attacker . classname = = " monster_tarbaby " )
deathstring = " was slimed by a Spawn \n " ;
else if ( attacker . classname = = " monster_vomit " )
deathstring = " was vomited on by a Vomitus \n " ;
else if ( attacker . classname = = " monster_wizard " )
deathstring = " was scragged by a Scrag \n " ;
else if ( attacker . classname = = " monster_zombie " )
deathstring = " joins the Zombies \n " ;
}
//#endif
# endif
else if ( attacker . classname = = " explo_box " )
{
deathstring = " blew up \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( attacker . solid = = SOLID_BSP & & attacker ! = world )
2001-07-17 05:58:10 +00:00
{
deathstring = " was squished \n " ;
}
else if ( attacker . classname = = " trap_shooter " | | attacker . classname = = " trap_spikeshooter " | | attacker . classname = = " trap_tf_spikeshooter " | | attacker . classname = = " trap_tf_shooter " )
{
if ( attacker . deathtype ! = string_null )
deathstring = attacker . deathtype ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_LASER )
2001-07-17 05:58:10 +00:00
deathstring = " had surgery from a laser \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFROCKET )
2001-07-17 05:58:10 +00:00
{
//if (rnum < 0.9)
deathstring = " took a ride on a rocket \n " ;
//else
// deathstring = " proves for once and for all that he IS the rocket man\n";
}
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFGRENADE )
2001-07-17 05:58:10 +00:00
deathstring = " tried to eat a wild pineapple \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFFLAME )
2001-07-17 05:58:10 +00:00
deathstring = " was burned alive \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_SUPERSPIKE )
2001-07-17 05:58:10 +00:00
deathstring = " was nailed to the ground \n " ;
else
deathstring = " was spiked \n " ;
}
else if ( attacker . classname = = " fireball " )
{
deathstring = " ate a lavaball \n " ;
}
else if ( attacker . classname = = " trigger_changelevel " )
{
deathstring = " tried to leave \n " ;
}
else if ( targ . deathtype = = " falling " & & attacker = = world )
{
targ . deathtype = " " ;
deathstring = " fell to his death \n " ;
}
else //- OfN - unknown death by himself
{
rnum = random ( ) ;
if ( rnum < 0.25 )
deathstring = " died happily \n " ;
else if ( rnum < 0.5 )
deathstring = " knows how to die with style \n " ;
else if ( rnum < 0.75 )
deathstring = " simply dies \n " ;
else deathstring = " had an original death \n " ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , deathstring ) ;
2001-07-17 05:58:10 +00:00
return ; //- ofn
}
}
else if ( IsMonster ( targ ) & & attacker . classname = = " building_sentrygun " )
{
custom_demon_name ( targ ) ; //CH
if ( ( teamplay ) & & ( attacker . real_owner . team_no > 0 ) & & ( targ . real_owner . team_no > 0 ) )
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM, targ.real_owner.netname);
//bprint (PRINT_MEDIUM, "'s demon, ");
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) was killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's sentry gun \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 0 , 1 , 1 , 0 ) ;
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM, targ.real_owner.netname);
//bprint (PRINT_MEDIUM, " friendly demon, ");
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) was killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's friendly sentry gun \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
}
else if ( targ . classname = = " monster_wizard " ) // OfN
{
custom_demon_name ( targ ) ;
if ( attacker . classname = = " building_tesla " )
{
if ( ( teamplay ) & & ( attacker . real_owner . team_no > 0 ) & & ( targ . real_owner . team_no > 0 ) )
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.frags = attacker.frags + 1; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags + 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . frags = attacker . frags - 1 ; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags - 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's friendly scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
}
else if ( attacker . classname = = " player " )
{
if ( ( teamplay ) & & ( attacker . team_no > 0 ) & & ( self . real_owner . team_no > 0 ) )
{
if ( Teammate ( targ . real_owner . team_no , attacker . team_no ) )
{
if ( attacker = = self . real_owner )
{
Give_Frags_Out ( attacker , targ , - 2 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 2; //Owner -2
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_LASERCANNON )
bprint ( PRINT_MEDIUM , " cuts his own scrag in half! \n " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " kills his own scrag! \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_LASERCANNON )
bprint ( PRINT_MEDIUM , " blasts the friendly scrag " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " mows down the friendly scrag " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
if ( deathmsg = = DMSG_LASERCANNON )
2001-07-17 05:58:10 +00:00
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " cuts " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag in several parts \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
MonsterKill ( attacker ) ; // adds knife kill to warlock if needed
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( attacker . classname = = " monster_army " )
{
custom_demon_name ( attacker ) ;
GetRank ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) mows down the friendly scrag " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_demon1 " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) eviscerates the friendly scrag " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is returned to hell by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_shambler " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " The shambler " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) annihilates the friendly scrag " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , learns a lesson from the shambler " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_wizard " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) annihilates the colleague " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's scrag, " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " , shows to " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) who is the best \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
} //- End scrag death stuff
else if ( targ . classname = = " monster_demon1 " ) //CH
{
custom_demon_name ( targ ) ; //CH
if ( attacker . classname = = " building_tesla " )
{
if ( ( teamplay ) & & ( attacker . real_owner . team_no > 0 ) & & ( targ . real_owner . team_no > 0 ) )
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.frags = attacker.frags + 1; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags + 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . frags = attacker . frags - 1 ; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags - 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's friendly demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
}
else if ( attacker . classname = = " player " )
{
if ( ( teamplay ) & & ( attacker . team_no > 0 ) & & ( self . real_owner . team_no > 0 ) )
{
if ( Teammate ( targ . real_owner . team_no , attacker . team_no ) )
{
if ( attacker = = self . real_owner )
{
Give_Frags_Out ( attacker , targ , - 2 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 2; //Owner -2
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " kills his own fiend! \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " mows down the friendly demon " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
MonsterKill ( attacker ) ; // adds knife kills to warlock
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( attacker . classname = = " monster_army " )
{
custom_demon_name ( attacker ) ;
GetRank ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) mows down the friendly demon " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , didn't have a prayer against " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_demon1 " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) eviscerates the friendly demon " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , realises too late that " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) wasn't just trying to be friendly \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_shambler " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) annihilates the friendly demon " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is given a firm farewell to the netherworld by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_wizard " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) kills the friendly demon " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's demon, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is killed by the scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( targ . classname = = " monster_army " ) //CH
{
custom_demon_name ( targ ) ; //CH
GetRank ( targ ) ;
if ( attacker . classname = = " building_tesla " )
{
if ( ( teamplay ) & & ( attacker . real_owner . team_no > 0 ) & & ( targ . real_owner . team_no > 0 ) )
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.frags = attacker.frags + 1; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags + 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's mercenary soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . frags = attacker . frags - 1 ; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags - 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's friendly soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was shocked to death by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
}
if ( attacker . classname = = " player " )
{
if ( ( teamplay ) & & ( attacker . team_no > 0 ) & & ( self . real_owner . team_no > 0 ) )
{
if ( Teammate ( targ . real_owner . team_no , attacker . team_no ) )
{
if ( attacker = = self . real_owner )
{
Give_Frags_Out ( attacker , targ , - 2 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 2; //Owner -2
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " kills his own soldier! \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " mows down the friendly soldier " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's mercenary soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was killed by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( attacker . classname = = " monster_shambler " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) slaps the friendly soldier " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) into oblivion \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is smacked down by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_demon1 " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) disembowels the friendly soldier " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is now listed as KIA thanks to " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_army " )
{
custom_demon_name ( attacker ) ;
GetRank ( attacker ) ;
if ( targ = = attacker ) //- OfN - It *may* happen
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's soldier, " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " , explodes with his own rockets! \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) mows down comrade-in-arms " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , takes a bullet in the chest from " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_wizard " )
{
custom_demon_name ( attacker ) ;
//GetRank(attacker);
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint ( PRINT_MEDIUM , " The scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) kills the friendly soldier " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's soldier, " ) ;
bprint ( PRINT_MEDIUM , targ . undercover_name ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is killed by the scrag " ) ;
//bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( targ . classname = = " monster_shambler " ) //CH
{
custom_demon_name ( targ ) ; //CH
if ( attacker . classname = = " building_tesla " )
{
if ( ( teamplay ) & & ( attacker . real_owner . team_no > 0 ) & & ( targ . real_owner . team_no > 0 ) )
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
/* attacker.frags = attacker.frags + 1; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags + 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was given a shocking surprise by " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , - 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . frags = attacker . frags - 1 ; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags - 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's friendly shambler, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , shouldn't play so close to " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
}
}
if ( attacker . classname = = " player " )
{
if ( ( teamplay ) & & ( attacker . team_no > 0 ) & & ( self . real_owner . team_no > 0 ) )
{
if ( Teammate ( targ . real_owner . team_no , attacker . team_no ) )
{
if ( attacker = = self . real_owner )
{
Give_Frags_Out ( attacker , targ , - 2 , 0 , 1 , 1 , 0 ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " kills his own shambler! \n " ) ;
2001-07-17 05:58:10 +00:00
// attacker.real_frags = attacker.real_frags - 2; //Owner -2
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " mows down the friendly shambler " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , was felled by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
MonsterKill ( attacker ) ; // adds knife kills to warlock
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( attacker . classname = = " monster_demon1 " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) checks its aura after killing " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , is torn apart by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_shambler " )
{
custom_demon_name ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) electrifies the friendly shambler " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's shambler, " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " , finds losing against shambler " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) to be a fatal experience \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_army " )
{
custom_demon_name ( attacker ) ;
GetRank ( attacker ) ;
if ( Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) is caught in the crossfire from " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) proves to " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) that size doesn't matter \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
else if ( attacker . classname = = " monster_wizard " )
{
custom_demon_name ( attacker ) ;
//GetRank(attacker);
// condition reversed forconvenience
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags - 1; // killed a team demon
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) had his army career truncated by the scrag " ) ;
//bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
else
{
Give_Frags_Out ( attacker , targ , - 1 , 0 , 1 , 1 , 0 ) ;
// attacker.real_frags = attacker.real_frags + 1;
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint ( PRINT_MEDIUM , " The scrag " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) kills the friendly soldier " ) ;
bprint ( PRINT_MEDIUM , targ . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
}
2001-07-23 20:52:47 +00:00
// if (!(toggleflags & TFLAG_TEAMFRAGS))
2001-07-17 05:58:10 +00:00
// attacker.frags = attacker.real_frags;
return ;
}
}
else if ( IsBuilding ( targ ) & & targ . classname ! = " building_sentrygun_base " & & attacker . classname = = " building_tesla " ) //Evil Tesla!
{
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
if ( targ . classname = = " building_sentrygun " | |
targ . classname = = " building_tesla " )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 2 , 0 , 0 ) ; //Tesla
Give_Frags_Out ( attacker . real_owner , targ , 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . frags = attacker . frags + 1 ; //Tesla
attacker . real_owner . real_frags = attacker . real_owner . real_frags + 1 ; //Player
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . real_owner . frags = attacker . real_owner . real_frags ;
*/
}
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser was zapped by " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun was no match for " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera was vaporized by " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor was obliterated by " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad was short circuted by " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " & & attacker = = targ )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla coil destroys itself. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry lost the battle against " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor was fucked up by " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator was destroyed by " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
bprint ( PRINT_MEDIUM , " " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's tesla sentry \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
else if ( IsBuilding ( targ ) & & targ . classname ! = " building_sentrygun_base " )
{
//- OfN - Weird but may happen.. like when a sentry is blown up by its own rocket
if ( attacker = = targ )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " destroys itself. \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( attacker . classname = = " teledeath " )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM,GetBuildingName(targ));
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " was telefragged by " ) ;
bprint ( PRINT_MEDIUM , attacker . owner . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
if ( attacker . classname = = " player " )
{
if ( attacker = = targ . real_owner )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " destroys his " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM,GetBuildingName(targ));
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
return ;
}
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
//bprint (PRINT_MEDIUM,GetBuildingName(targ)); //- OfN - FIXED?
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " was destroyed by " ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " \n " ) ;
2001-07-17 05:58:10 +00:00
if ( ! Teammate ( targ . real_owner . team_no , attacker . team_no ) )
{
if ( targ . classname = = " building_sentrygun " | |
targ . classname = = " building_tesla " )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . real_frags = attacker . real_frags + 1 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . frags = attacker . real_frags ;
*/
}
}
return ;
}
else if ( attacker . classname = = " monster_army " ) // SB grunty kills building
{
custom_demon_name ( attacker ) ;
GetRank ( attacker ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , targ . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " 's " ) ;
2001-07-17 05:58:10 +00:00
2001-07-23 20:52:47 +00:00
//bprint(PRINT_MEDIUM,GetBuildingName(targ));
2001-07-17 05:58:10 +00:00
if ( targ . classname = = " building_dispenser " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " dispenser " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sentrygun " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " sentrygun " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_camera " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " security camera " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_teleporter " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " teleporter pad " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_tesla " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " tesla sentry " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_sensor " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " motion sensor " ) ;
2001-07-17 05:58:10 +00:00
else if ( targ . classname = = " building_fieldgen " )
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " field generator " ) ;
2001-07-17 05:58:10 +00:00
else
2001-07-23 20:52:47 +00:00
bprint ( PRINT_MEDIUM , " ??Building?? " ) ;
bprint ( PRINT_MEDIUM , " was destroyed by " ) ;
bprint ( PRINT_MEDIUM , attacker . undercover_name ) ;
bprint ( PRINT_MEDIUM , attacker . netname ) ;
bprint ( PRINT_MEDIUM , " ( " ) ;
bprint ( PRINT_MEDIUM , attacker . real_owner . netname ) ;
bprint ( PRINT_MEDIUM , " ) \n " ) ;
2001-07-17 05:58:10 +00:00
if ( ! Teammate ( targ . real_owner . team_no , attacker . real_owner . team_no ) )
{
if ( targ . classname = = " building_sentrygun " | |
targ . classname = = " building_tesla " )
{
Give_Frags_Out ( attacker , targ , 1 , 0 , 1 , 1 , 0 ) ;
/*
attacker . real_frags = attacker . real_frags + 1 ;
2001-07-23 20:52:47 +00:00
if ( ! ( toggleflags & TFLAG_TEAMFRAGS ) )
2001-07-17 05:58:10 +00:00
attacker . frags = attacker . real_frags ;
*/
}
}
return ;
}
}
//- Miscellaneous monster/army deaths
if ( IsMonster ( targ ) )
{
if ( attacker . classname = = " explo_box " )
{
deathstring = " blew up \n " ;
}
2001-07-23 20:52:47 +00:00
else if ( attacker . solid = = SOLID_BSP & & attacker ! = world )
2001-07-17 05:58:10 +00:00
{
deathstring = " was squished \n " ;
}
else if ( attacker . classname = = " trap_shooter " | | attacker . classname = = " trap_spikeshooter " | | attacker . classname = = " trap_tf_spikeshooter " | | attacker . classname = = " trap_tf_shooter " )
{
if ( attacker . deathtype ! = string_null )
deathstring = attacker . deathtype ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_LASER )
2001-07-17 05:58:10 +00:00
deathstring = " had surgery from a laser \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFROCKET )
2001-07-17 05:58:10 +00:00
deathstring = " took a ride on a rocket \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFGRENADE )
2001-07-17 05:58:10 +00:00
deathstring = " tried to eat a wild pineapple \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_TFFLAME )
2001-07-17 05:58:10 +00:00
deathstring = " was burned alive \n " ;
2001-07-23 20:52:47 +00:00
else if ( attacker . spawnflags = = SPAWNFLAG_SUPERSPIKE )
2001-07-17 05:58:10 +00:00
deathstring = " was nailed to the ground \n " ;
else
deathstring = " was spiked \n " ;
}
else if ( attacker . classname = = " fireball " )
{
deathstring = " ate a lavaball \n " ;
}
else if ( attacker . classname = = " teledeath " )
{
deathstring = " was telefragged by " ;
}
else
{
deathstring = " dies \n " ;
}
deathstring2 = GetMonsterName ( targ ) ;
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , " The " ) ;
bprint ( PRINT_HIGH , deathstring2 ) ;
bprint ( PRINT_HIGH , " " ) ;
bprint ( PRINT_HIGH , targ . netname ) ;
bprint ( PRINT_HIGH , " ( " ) ;
bprint ( PRINT_HIGH , targ . real_owner . netname ) ;
bprint ( PRINT_HIGH , " ) " ) ;
bprint ( PRINT_HIGH , deathstring ) ;
2001-07-17 05:58:10 +00:00
if ( attacker . classname = = " teledeath " )
{
2001-07-23 20:52:47 +00:00
bprint ( PRINT_HIGH , attacker . owner . netname ) ;
bprint ( PRINT_HIGH , " \n " ) ;
2001-07-17 05:58:10 +00:00
}
return ;
}
} ;