2002-02-15 17:57:14 +00:00
|
|
|
float modelindex_eyes, modelindex_player;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// LEVEL CHANGING / INTERMISSION ==============================================
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
string nextmap;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
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'
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
info_intermission =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
self.angles = self.mangle; // so C can get at it
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
SetChangeParms =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.health <= 0) {
|
2002-02-15 17:57:14 +00:00
|
|
|
SetNewParms ();
|
|
|
|
return;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
// remove items
|
|
|
|
self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY |
|
|
|
|
IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
|
|
|
|
|
|
|
|
// cap super health
|
2002-02-15 17:57:14 +00:00
|
|
|
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.weapon;
|
|
|
|
parm9 = self.armortype * 100;
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
SetNewParms =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
parm1 = IT_SHOTGUN | IT_AXE;
|
|
|
|
parm2 = 100;
|
|
|
|
parm3 = 0;
|
|
|
|
parm4 = 25;
|
|
|
|
parm5 = 0;
|
|
|
|
parm6 = 0;
|
|
|
|
parm7 = 0;
|
|
|
|
parm8 = 1;
|
|
|
|
parm9 = 0;
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
DecodeLevelParms =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
if (serverflags) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (world.model == "maps/start.bsp")
|
2003-03-02 04:06:47 +00:00
|
|
|
SetNewParms (); // take away all stuff on starting new episode
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
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.weapon = parm8;
|
|
|
|
self.armortype = parm9 * 0.01;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
FindIntermission
|
|
|
|
|
|
|
|
Returns the entity to view from
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
entity ()
|
|
|
|
FindIntermission =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local entity spot;
|
|
|
|
local float cyc;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// look for info_intermission first
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (world, classname, "info_intermission");
|
2003-03-02 04:06:47 +00:00
|
|
|
if (spot) { // pick a random one
|
|
|
|
cyc = 4 * random ();
|
|
|
|
while (cyc > 1) {
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (spot, classname, "info_intermission");
|
|
|
|
if (!spot)
|
|
|
|
spot = find (spot, classname, "info_intermission");
|
|
|
|
cyc = cyc - 1;
|
|
|
|
}
|
|
|
|
return spot;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// then look for the start position
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (world, classname, "info_player_start");
|
|
|
|
if (spot)
|
|
|
|
return spot;
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
objerror ("FindIntermission: no spot");
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
GotoNextMap =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local string newmap;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
// ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level
|
2003-03-02 04:06:47 +00:00
|
|
|
if (cvar ("samelevel") == 1) // if samelevel is set, stay on same level
|
2002-02-15 17:57:14 +00:00
|
|
|
changelevel (mapname);
|
|
|
|
else {
|
|
|
|
// configurable map lists, see if the current map exists as a
|
|
|
|
// serverinfo/localinfo var
|
2003-03-02 04:06:47 +00:00
|
|
|
newmap = infokey (world, mapname);
|
2002-02-15 17:57:14 +00:00
|
|
|
if (newmap != "")
|
|
|
|
changelevel (newmap);
|
|
|
|
else
|
|
|
|
changelevel (nextmap);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
IntermissionThink
|
|
|
|
|
|
|
|
When the player presses attack or jump, change to the next level
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
IntermissionThink =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (time < intermission_exittime)
|
|
|
|
return;
|
|
|
|
if (!self.button0 && !self.button1 && !self.button2)
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
GotoNextMap ();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
execute_changelevel
|
|
|
|
|
|
|
|
The global "nextmap" has been set previously.
|
|
|
|
Take the players to the intermission spot
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
execute_changelevel =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local entity pos;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
intermission_running = 1;
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
// enforce a wait time before allowing changelevel
|
2002-02-15 17:57:14 +00:00
|
|
|
intermission_exittime = time + 5;
|
|
|
|
|
|
|
|
pos = FindIntermission ();
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// play intermission music
|
|
|
|
WriteBytes (MSG_ALL, SVC_CDTRACK, 3.0, SVC_INTERMISSION);
|
|
|
|
WriteCoordV (MSG_ALL, pos.origin);
|
|
|
|
WriteAngleV (MSG_ALL, pos.mangle);
|
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
other = find (world, classname, "player");
|
2003-03-02 04:06:47 +00:00
|
|
|
while (other != world) {
|
2002-02-15 17:57:14 +00:00
|
|
|
other.takedamage = DAMAGE_NO;
|
|
|
|
other.solid = SOLID_NOT;
|
|
|
|
other.movetype = MOVETYPE_NONE;
|
|
|
|
other.modelindex = 0;
|
|
|
|
other = find (other, classname, "player");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
changelevel_touch =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (other.classname != "player")
|
|
|
|
return;
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
// ZOID, 12-13-96, noexit isn't supported in QW. Overload samelevel
|
2003-03-02 04:06:47 +00:00
|
|
|
if ((cvar ("samelevel") == 2) || ((cvar ("samelevel") == 3)
|
|
|
|
&& (mapname != "start"))) {
|
2002-02-15 17:57:14 +00:00
|
|
|
T_Damage (other, self, self, 50000);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bprint (PRINT_HIGH, other.netname);
|
|
|
|
bprint (PRINT_HIGH," exited the level\n");
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
nextmap = self.map;
|
|
|
|
|
|
|
|
SUB_UseTargets ();
|
|
|
|
|
|
|
|
self.touch = SUB_Null;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// 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
|
2002-02-15 17:57:14 +00:00
|
|
|
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.
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
trigger_changelevel =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (!self.map)
|
|
|
|
objerror ("chagnelevel trigger doesn't have map");
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
InitTrigger ();
|
|
|
|
self.touch = changelevel_touch;
|
|
|
|
};
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// PLAYER GAME EDGE FUNCTIONS =================================================
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void () set_suicide_frame;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
// called by ClientKill and DeadThink
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
respawn =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
// make a copy of the dead body for appearances sake
|
2003-03-02 04:06:47 +00:00
|
|
|
CopyToBodyQueue (self);
|
2002-02-15 17:57:14 +00:00
|
|
|
// set default spawn parms
|
|
|
|
SetNewParms ();
|
|
|
|
// respawn
|
|
|
|
PutClientInServer ();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
ClientKill
|
|
|
|
|
|
|
|
Player entered the suicide command
|
|
|
|
============
|
|
|
|
*/
|
|
|
|
void() ClientKill =
|
|
|
|
{
|
|
|
|
bprint (PRINT_MEDIUM, self.netname);
|
|
|
|
bprint (PRINT_MEDIUM, " suicides\n");
|
|
|
|
set_suicide_frame ();
|
|
|
|
self.modelindex = modelindex_player;
|
|
|
|
logfrag (self, self);
|
2003-03-02 04:06:47 +00:00
|
|
|
self.frags -= 2; // extra penalty
|
2002-02-15 17:57:14 +00:00
|
|
|
respawn ();
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
float (vector v)
|
|
|
|
CheckSpawnPoint =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
SelectSpawnPoint
|
|
|
|
|
|
|
|
Returns the entity to spawn at
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
entity ()
|
|
|
|
SelectSpawnPoint =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local entity spot, spots, thing;
|
|
|
|
local float pcount, numspots, totalspots;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
numspots = 0;
|
|
|
|
totalspots = 0;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// testinfo_player_start is only found in regioned levels
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (world, classname, "testplayerstart");
|
|
|
|
if (spot)
|
|
|
|
return spot;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// choose a info_player_deathmatch point
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// ok, find all spots that don't have players nearby
|
2002-02-15 17:57:14 +00:00
|
|
|
spots = world;
|
2003-03-02 04:06:47 +00:00
|
|
|
spot = find (world, classname, "info_player_deathmatch");
|
|
|
|
while (spot) {
|
|
|
|
totalspots++;
|
|
|
|
|
|
|
|
thing = findradius (spot.origin, 84);
|
|
|
|
pcount = 0;
|
|
|
|
while (thing) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (thing.classname == "player")
|
2003-03-02 04:06:47 +00:00
|
|
|
pcount++;
|
|
|
|
thing = thing.chain;
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
if (pcount == 0) {
|
|
|
|
spot.goalentity = spots;
|
|
|
|
spots = spot;
|
2003-03-02 04:06:47 +00:00
|
|
|
numspots++;
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get the next spot in the chain
|
|
|
|
spot = find (spot, classname, "info_player_deathmatch");
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
totalspots--;
|
2002-02-15 17:57:14 +00:00
|
|
|
if (!numspots) {
|
|
|
|
// ack, they are all full, just pick one at random
|
|
|
|
// bprint (PRINT_HIGH, "Ackk! All spots are full. Selecting random spawn spot\n");
|
2003-03-02 04:06:47 +00:00
|
|
|
totalspots = rint ((random () * totalspots));
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (world, classname, "info_player_deathmatch");
|
|
|
|
while (totalspots > 0) {
|
2003-03-02 04:06:47 +00:00
|
|
|
totalspots--;
|
2002-02-15 17:57:14 +00:00
|
|
|
spot = find (spot, classname, "info_player_deathmatch");
|
|
|
|
}
|
|
|
|
return spot;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// We now have the number of spots available on the map in numspots
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// Generate a random number between 1 and numspots
|
|
|
|
numspots--;
|
|
|
|
numspots = rint ((random () * numspots));
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
spot = spots;
|
|
|
|
while (numspots > 0) {
|
|
|
|
spot = spot.goalentity;
|
2003-03-02 04:06:47 +00:00
|
|
|
numspots--;
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
return spot;
|
|
|
|
};
|
2003-03-02 04:06:47 +00:00
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
float (entity e)
|
|
|
|
ValidateUser =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
/*
|
2003-03-02 04:06:47 +00:00
|
|
|
local string userclan, s;
|
|
|
|
local float rank, rankmin, rankmax;
|
|
|
|
|
|
|
|
// if the server has set "clan1" and "clan2", then it
|
|
|
|
// is a clan match that will allow only those two clans in
|
|
|
|
s = serverinfo ("clan1");
|
|
|
|
if (s) {
|
|
|
|
userclan = masterinfo (e, "clan");
|
2002-02-15 17:57:14 +00:00
|
|
|
if (s == userclan)
|
|
|
|
return true;
|
2003-03-02 04:06:47 +00:00
|
|
|
s = serverinfo ("clan2");
|
2002-02-15 17:57:14 +00:00
|
|
|
if (s == userclan)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// if the server has set "rankmin" and/or "rankmax" then
|
|
|
|
// the users rank must be between those two values
|
2002-02-15 17:57:14 +00:00
|
|
|
s = masterinfo (e, "rank");
|
|
|
|
rank = stof (s);
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
s = serverinfo ("rankmin");
|
|
|
|
if (s) {
|
2002-02-15 17:57:14 +00:00
|
|
|
rankmin = stof (s);
|
|
|
|
if (rank < rankmin)
|
|
|
|
return false;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
s = serverinfo ("rankmax");
|
|
|
|
if (s) {
|
2002-02-15 17:57:14 +00:00
|
|
|
rankmax = stof (s);
|
|
|
|
if (rankmax < rank)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void () DecodeLevelParms;
|
|
|
|
void () PlayerDie;
|
|
|
|
void () W_SetCurrentAmmo;
|
|
|
|
void () player_stand1;
|
|
|
|
void (entity attacker, float damage) player_pain;
|
|
|
|
void (vector org, entity death_owner) spawn_tdeath;
|
|
|
|
void (vector org) spawn_tfog;
|
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
/*
|
|
|
|
===========
|
|
|
|
PutClientInServer
|
|
|
|
|
|
|
|
called each time a player enters a new level
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
PutClientInServer =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local entity spot;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
self.classname = "player";
|
|
|
|
self.health = 100;
|
|
|
|
self.takedamage = DAMAGE_AIM;
|
|
|
|
self.solid = SOLID_SLIDEBOX;
|
|
|
|
self.movetype = MOVETYPE_WALK;
|
|
|
|
self.show_hostile = 0;
|
|
|
|
self.max_health = 100;
|
|
|
|
self.flags = FL_CLIENT;
|
|
|
|
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;
|
|
|
|
|
|
|
|
DecodeLevelParms ();
|
|
|
|
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
|
|
|
self.attack_finished = time;
|
|
|
|
self.th_pain = player_pain;
|
|
|
|
self.th_die = PlayerDie;
|
|
|
|
|
|
|
|
self.deadflag = DEAD_NO;
|
2003-03-02 04:06:47 +00:00
|
|
|
// pausetime is set by teleporters to keep the player from moving a while
|
2002-02-15 17:57:14 +00:00
|
|
|
self.pausetime = 0;
|
|
|
|
|
|
|
|
spot = SelectSpawnPoint ();
|
|
|
|
|
|
|
|
self.origin = spot.origin + '0 0 1';
|
|
|
|
self.angles = spot.angles;
|
|
|
|
self.fixangle = TRUE; // turn this way immediately
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// oh, this is a hack!
|
2002-02-15 17:57:14 +00:00
|
|
|
setmodel (self, "progs/eyes.mdl");
|
|
|
|
modelindex_eyes = self.modelindex;
|
|
|
|
|
|
|
|
setmodel (self, "progs/player.mdl");
|
|
|
|
modelindex_player = self.modelindex;
|
|
|
|
|
|
|
|
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
|
|
|
|
|
|
|
|
self.view_ofs = '0 0 22';
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// Mod - Xian (May.20.97)
|
|
|
|
// Bug where player would have velocity from their last kill
|
2002-02-15 17:57:14 +00:00
|
|
|
self.velocity = '0 0 0';
|
|
|
|
|
|
|
|
player_stand1 ();
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
makevectors (self.angles);
|
2002-02-15 17:57:14 +00:00
|
|
|
spawn_tfog (self.origin + v_forward*20);
|
|
|
|
|
|
|
|
spawn_tdeath (self.origin, self);
|
|
|
|
|
|
|
|
// Set Rocket Jump Modifiers
|
2003-03-02 04:06:47 +00:00
|
|
|
if (stof (infokey (world, "rj")) != 0)
|
|
|
|
rj = stof (infokey (world, "rj"));
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (deathmatch == 4) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.ammo_shells = 0;
|
2003-03-02 04:06:47 +00:00
|
|
|
if (stof (infokey (world, "axe")) == 0) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.ammo_nails = 255;
|
|
|
|
self.ammo_shells = 255;
|
|
|
|
self.ammo_rockets = 255;
|
|
|
|
self.ammo_cells = 255;
|
2003-03-02 04:06:47 +00:00
|
|
|
self.items |= (IT_NAILGUN | IT_SUPER_NAILGUN | IT_SUPER_SHOTGUN |
|
|
|
|
IT_ROCKET_LAUNCHER | IT_LIGHTNING);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
|
2003-03-04 23:15:54 +00:00
|
|
|
self.items |= (IT_ARMOR3 | IT_INVULNERABILITY);
|
2002-02-15 17:57:14 +00:00
|
|
|
self.armorvalue = 200;
|
|
|
|
self.armortype = 0.8;
|
|
|
|
self.health = 250;
|
|
|
|
self.invincible_time = 1;
|
|
|
|
self.invincible_finished = time + 3;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (deathmatch == 5) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.ammo_nails = 80;
|
|
|
|
self.ammo_shells = 30;
|
|
|
|
self.ammo_rockets = 10;
|
|
|
|
self.ammo_cells = 30;
|
2003-03-02 04:06:47 +00:00
|
|
|
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
|
|
|
|
self.items |= (IT_NAILGUN | IT_SUPER_NAILGUN | IT_SUPER_SHOTGUN |
|
|
|
|
IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER |
|
|
|
|
IT_LIGHTNING | IT_ARMOR3 | IT_INVULNERABILITY);
|
2002-02-15 17:57:14 +00:00
|
|
|
self.armorvalue = 200;
|
|
|
|
self.armortype = 0.8;
|
|
|
|
self.health = 200;
|
|
|
|
self.invincible_time = 1;
|
|
|
|
self.invincible_finished = time + 3;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// QUAKED FUNCTIONS ===========================================================
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
|
|
|
|
The normal starting point for a level.
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
info_player_start =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
/*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.
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
info_player_start2 =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
|
|
|
|
potential spawning position for deathmatch games
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
info_player_deathmatch =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
|
|
|
|
potential spawning position for coop games
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
info_player_coop =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// RULES ======================================================================
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
// go to the next level for deathmatch
|
|
|
|
void ()
|
|
|
|
NextLevel =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local entity o;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
|
|
|
if (nextmap != "")
|
|
|
|
return; // already done
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (mapname == "start") {
|
|
|
|
if (!cvar ("registered")) {
|
2002-02-15 17:57:14 +00:00
|
|
|
mapname = "e1m1";
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (!(serverflags & 1)) {
|
2002-02-15 17:57:14 +00:00
|
|
|
mapname = "e1m1";
|
2004-02-08 04:52:32 +00:00
|
|
|
serverflags |= 1;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (!(serverflags & 2)) {
|
2002-02-15 17:57:14 +00:00
|
|
|
mapname = "e2m1";
|
2004-02-08 04:52:32 +00:00
|
|
|
serverflags |= 2;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (!(serverflags & 4)) {
|
2002-02-15 17:57:14 +00:00
|
|
|
mapname = "e3m1";
|
2004-02-08 04:52:32 +00:00
|
|
|
serverflags |= 4;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (!(serverflags & 8)) {
|
2002-02-15 17:57:14 +00:00
|
|
|
mapname = "e4m1";
|
2004-02-08 04:52:32 +00:00
|
|
|
serverflags -= 7; //FIXME &= ~7?
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
o = spawn ();
|
2002-02-15 17:57:14 +00:00
|
|
|
o.map = mapname;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else {
|
2002-02-15 17:57:14 +00:00
|
|
|
// find a trigger changelevel
|
|
|
|
o = find(world, classname, "trigger_changelevel");
|
2003-03-02 04:06:47 +00:00
|
|
|
if (!o || mapname == "start") {
|
|
|
|
// go back to same map if no trigger_changelevel
|
|
|
|
o = spawn ();
|
2002-02-15 17:57:14 +00:00
|
|
|
o.map = mapname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nextmap = o.map;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (o.nextthink < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
o.think = execute_changelevel;
|
|
|
|
o.nextthink = time + 0.1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
CheckRules
|
|
|
|
|
|
|
|
Exit deathmatch games upon conditions
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
CheckRules =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (timelimit && time >= timelimit)
|
|
|
|
NextLevel ();
|
|
|
|
if (fraglimit && self.frags >= fraglimit)
|
|
|
|
NextLevel ();
|
|
|
|
};
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
PlayerDeathThink =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local float forward;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if ((self.flags & FL_ONGROUND)) {
|
|
|
|
forward = vlen (self.velocity) - 20;
|
2002-02-15 17:57:14 +00:00
|
|
|
if (forward <= 0)
|
|
|
|
self.velocity = '0 0 0';
|
|
|
|
else
|
2003-03-02 04:06:47 +00:00
|
|
|
self.velocity = forward * normalize (self.velocity);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// wait for all buttons released
|
|
|
|
if (self.deadflag == DEAD_DEAD) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.button2 || self.button1 || self.button0)
|
|
|
|
return;
|
|
|
|
self.deadflag = DEAD_RESPAWNABLE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// wait for any button down
|
2002-02-15 17:57:14 +00:00
|
|
|
if (!self.button2 && !self.button1 && !self.button0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
self.button0 = 0;
|
|
|
|
self.button1 = 0;
|
|
|
|
self.button2 = 0;
|
2003-03-02 04:06:47 +00:00
|
|
|
respawn ();
|
2002-02-15 17:57:14 +00:00
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
PlayerJump =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (self.flags & FL_WATERJUMP)
|
|
|
|
return;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.waterlevel >= 2) {
|
|
|
|
// play swiming sound
|
|
|
|
if (self.swim_flag < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.swim_flag = time + 1;
|
2003-03-02 04:06:47 +00:00
|
|
|
if (random () < 0.5)
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM);
|
|
|
|
else
|
|
|
|
sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(self.flags & FL_ONGROUND))
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
if (!(self.flags & FL_JUMPRELEASED))
|
2002-02-15 17:57:14 +00:00
|
|
|
return; // don't pogo stick
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
self.flags &= ~FL_JUMPRELEASED;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.button2 = 0;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// player jumping sound
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
|
|
|
|
};
|
|
|
|
|
|
|
|
.float dmgtime;
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
WaterMove =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
// dprint (ftos (self.waterlevel));
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.movetype == MOVETYPE_NOCLIP)
|
|
|
|
return;
|
|
|
|
if (self.health < 0)
|
|
|
|
return;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.waterlevel != 3) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.air_finished < time)
|
|
|
|
sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM);
|
|
|
|
else if (self.air_finished < time + 9)
|
|
|
|
sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM);
|
|
|
|
self.air_finished = time + 12;
|
|
|
|
self.dmg = 2;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (self.air_finished < time) {
|
|
|
|
// drown!
|
|
|
|
if (self.pain_finished < time) {
|
|
|
|
self.dmg += 2;
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.dmg > 15)
|
|
|
|
self.dmg = 10;
|
|
|
|
T_Damage (self, world, world, self.dmg);
|
|
|
|
self.pain_finished = time + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (!self.waterlevel) {
|
|
|
|
if (self.flags & FL_INWATER) {
|
2002-02-15 17:57:14 +00:00
|
|
|
// play leave water sound
|
|
|
|
sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM);
|
|
|
|
self.flags = self.flags - FL_INWATER;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.watertype == CONTENT_LAVA) {
|
|
|
|
// do damage
|
|
|
|
if (self.dmgtime < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.radsuit_finished > time)
|
|
|
|
self.dmgtime = time + 1;
|
|
|
|
else
|
|
|
|
self.dmgtime = time + 0.2;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
T_Damage (self, world, world, 10 * self.waterlevel);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (self.watertype == CONTENT_SLIME) {
|
|
|
|
// do damage
|
|
|
|
if (self.dmgtime < time && self.radsuit_finished < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.dmgtime = time + 1;
|
2003-03-02 04:06:47 +00:00
|
|
|
T_Damage (self, world, world, 4 * self.waterlevel);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (!(self.flags & FL_INWATER)) {
|
|
|
|
// player enter water sound
|
|
|
|
switch (self.watertype) {
|
|
|
|
case CONTENT_LAVA:
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
|
2003-03-02 04:06:47 +00:00
|
|
|
break;
|
|
|
|
case CONTENT_WATER:
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM);
|
2003-03-02 04:06:47 +00:00
|
|
|
break;
|
|
|
|
case CONTENT_SLIME:
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
|
2003-03-02 04:06:47 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
self.flags |= FL_INWATER;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.dmgtime = 0;
|
2003-03-02 04:06:47 +00:00
|
|
|
}
|
2002-02-15 17:57:14 +00:00
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
CheckWaterJump =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local vector start, end;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// check for a jump-out-of-water
|
2002-02-15 17:57:14 +00:00
|
|
|
makevectors (self.angles);
|
|
|
|
start = self.origin;
|
|
|
|
start_z = start_z + 8;
|
|
|
|
v_forward_z = 0;
|
2003-03-02 04:06:47 +00:00
|
|
|
normalize (v_forward);
|
|
|
|
end = start + v_forward * 24;
|
2002-02-15 17:57:14 +00:00
|
|
|
traceline (start, end, TRUE, self);
|
2003-03-02 04:06:47 +00:00
|
|
|
if (trace_fraction < 1) { // solid at waist
|
2002-02-15 17:57:14 +00:00
|
|
|
start_z = start_z + self.maxs_z - 8;
|
2003-03-02 04:06:47 +00:00
|
|
|
end = start + v_forward * 24;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.movedir = trace_plane_normal * -50;
|
|
|
|
traceline (start, end, TRUE, self);
|
2003-03-02 04:06:47 +00:00
|
|
|
if (trace_fraction == 1) { // open at eye level
|
|
|
|
self.flags |= FL_WATERJUMP;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.velocity_z = 225;
|
2003-03-02 04:06:47 +00:00
|
|
|
self.flags &= ~FL_JUMPRELEASED;
|
|
|
|
self.teleport_time = time + 2; // safety net
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
PlayerPreThink
|
|
|
|
|
|
|
|
Called every frame before physics are run
|
|
|
|
================
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
PlayerPreThink =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
if (intermission_running) {
|
2002-02-15 17:57:14 +00:00
|
|
|
IntermissionThink (); // otherwise a button could be missed between
|
|
|
|
return; // the think tics
|
|
|
|
}
|
|
|
|
|
|
|
|
if (self.view_ofs == '0 0 0')
|
|
|
|
return; // intermission or finale
|
|
|
|
|
|
|
|
makevectors (self.v_angle); // is this still used
|
|
|
|
|
|
|
|
self.deathtype = "";
|
|
|
|
|
|
|
|
CheckRules ();
|
|
|
|
WaterMove ();
|
|
|
|
/*
|
|
|
|
if (self.waterlevel == 2)
|
|
|
|
CheckWaterJump ();
|
|
|
|
*/
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.deadflag >= DEAD_DEAD) {
|
2002-02-15 17:57:14 +00:00
|
|
|
PlayerDeathThink ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (self.deadflag == DEAD_DYING)
|
|
|
|
return; // dying, so do nothing
|
|
|
|
|
|
|
|
if (self.button2)
|
|
|
|
PlayerJump ();
|
|
|
|
else
|
2004-02-08 04:52:32 +00:00
|
|
|
self.flags |= FL_JUMPRELEASED;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// teleporters can force a non-moving pause time
|
2002-02-15 17:57:14 +00:00
|
|
|
if (time < self.pausetime)
|
|
|
|
self.velocity = '0 0 0';
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (time > self.attack_finished && self.currentammo == 0 && self.weapon
|
|
|
|
!= IT_AXE) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.weapon = W_BestWeapon ();
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
CheckPowerups
|
|
|
|
|
|
|
|
Check for turning off powerups
|
|
|
|
================
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
CheckPowerups =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
if (self.health <= 0)
|
|
|
|
return;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// invisibility
|
|
|
|
if (self.invisible_finished) {
|
|
|
|
// sound and screen flash when items starts to run out
|
|
|
|
if (self.invisible_sound < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE);
|
2003-03-02 04:06:47 +00:00
|
|
|
self.invisible_sound = time + ((3 * random ()) + 1);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.invisible_finished < time + 3) {
|
|
|
|
if (self.invisible_time == 1) {
|
2002-02-15 17:57:14 +00:00
|
|
|
sprint (self, PRINT_HIGH, "Ring of Shadows magic is fading\n");
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
sound (self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM);
|
|
|
|
self.invisible_time = time + 1;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
if (self.invisible_time < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.invisible_time = time + 1;
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.invisible_finished < time) { // just stopped
|
|
|
|
self.items -= IT_INVISIBILITY;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.invisible_finished = 0;
|
|
|
|
self.invisible_time = 0;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
// use the eyes
|
2002-02-15 17:57:14 +00:00
|
|
|
self.frame = 0;
|
|
|
|
self.modelindex = modelindex_eyes;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else
|
2002-02-15 17:57:14 +00:00
|
|
|
self.modelindex = modelindex_player; // don't use eyes
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// invincibility
|
|
|
|
if (self.invincible_finished) {
|
|
|
|
// sound and screen flash when items starts to run out
|
|
|
|
if (self.invincible_finished < time + 3) {
|
|
|
|
if (self.invincible_time == 1) {
|
2002-02-15 17:57:14 +00:00
|
|
|
sprint (self, PRINT_HIGH, "Protection is almost burned out\n");
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
sound (self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM);
|
|
|
|
self.invincible_time = time + 1;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
if (self.invincible_time < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.invincible_time = time + 1;
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.invincible_finished < time) { // just stopped
|
|
|
|
self.items &= ~IT_INVULNERABILITY;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.invincible_time = 0;
|
|
|
|
self.invincible_finished = 0;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
if (self.invincible_finished > time) {
|
|
|
|
self.effects |= (EF_DIMLIGHT | EF_RED);
|
|
|
|
} else {
|
|
|
|
self.effects &= ~(EF_DIMLIGHT | EF_RED);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// super damage
|
|
|
|
if (self.super_damage_finished) {
|
|
|
|
// sound and screen flash when items starts to run out
|
|
|
|
if (self.super_damage_finished < time + 3) {
|
|
|
|
if (self.super_time == 1) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (deathmatch == 4)
|
|
|
|
sprint (self, PRINT_HIGH, "OctaPower is wearing off\n");
|
|
|
|
else
|
|
|
|
sprint (self, PRINT_HIGH, "Quad Damage is wearing off\n");
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM);
|
|
|
|
self.super_time = time + 1;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.super_time < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.super_time = time + 1;
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.super_damage_finished < time) { // just stopped
|
|
|
|
self.items &= ~IT_QUAD;
|
|
|
|
if (deathmatch == 4) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.ammo_cells = 255;
|
|
|
|
self.armorvalue = 1;
|
|
|
|
self.armortype = 0.8;
|
|
|
|
self.health = 100;
|
|
|
|
}
|
|
|
|
self.super_damage_finished = 0;
|
|
|
|
self.super_time = 0;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.super_damage_finished > time) {
|
|
|
|
self.effects |= (EF_DIMLIGHT | EF_BLUE);
|
|
|
|
} else {
|
|
|
|
self.effects &= ~(EF_DIMLIGHT | EF_BLUE);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// suit
|
|
|
|
if (self.radsuit_finished) {
|
|
|
|
self.air_finished = time + 12; // don't drown
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// sound and screen flash when items starts to run out
|
|
|
|
if (self.radsuit_finished < time + 3) {
|
|
|
|
if (self.rad_time == 1) {
|
2002-02-15 17:57:14 +00:00
|
|
|
sprint (self, PRINT_HIGH, "Air supply in Biosuit expiring\n");
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
sound (self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM);
|
|
|
|
self.rad_time = time + 1;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.rad_time < time) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.rad_time = time + 1;
|
|
|
|
stuffcmd (self, "bf\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (self.radsuit_finished < time) { // just stopped
|
|
|
|
self.items &= ~IT_SUIT;
|
2002-02-15 17:57:14 +00:00
|
|
|
self.rad_time = 0;
|
|
|
|
self.radsuit_finished = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
void () W_WeaponFrame;
|
|
|
|
|
2002-02-15 17:57:14 +00:00
|
|
|
/*
|
|
|
|
================
|
|
|
|
PlayerPostThink
|
|
|
|
|
|
|
|
Called every frame after physics are run
|
|
|
|
================
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
PlayerPostThink =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
// dprint ("post think\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.view_ofs == '0 0 0')
|
|
|
|
return; // intermission or finale
|
|
|
|
if (self.deadflag)
|
|
|
|
return;
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
// check to see if player landed and play landing sound
|
|
|
|
if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND)) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (self.watertype == CONTENT_WATER)
|
|
|
|
sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
|
2003-03-02 04:06:47 +00:00
|
|
|
else if (self.jump_flag < -650) {
|
2002-02-15 17:57:14 +00:00
|
|
|
self.deathtype = "falling";
|
|
|
|
T_Damage (self, world, world, 5);
|
|
|
|
sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
|
2003-03-02 04:06:47 +00:00
|
|
|
} else
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
|
|
|
|
}
|
|
|
|
|
|
|
|
self.jump_flag = self.velocity_z;
|
|
|
|
|
|
|
|
CheckPowerups ();
|
|
|
|
|
|
|
|
W_WeaponFrame ();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
ClientConnect
|
|
|
|
|
|
|
|
called when a player connects to a server
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
ClientConnect =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
bprint (PRINT_HIGH, self.netname);
|
|
|
|
bprint (PRINT_HIGH, " entered the game\n");
|
2003-03-02 04:06:47 +00:00
|
|
|
|
|
|
|
// a client connecting during an intermission can cause problems
|
2002-02-15 17:57:14 +00:00
|
|
|
if (intermission_running)
|
|
|
|
GotoNextMap ();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
ClientDisconnect
|
|
|
|
|
|
|
|
called when a player disconnects from a server
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void ()
|
|
|
|
ClientDisconnect =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
|
|
|
// let everyone else know
|
|
|
|
bprint (PRINT_HIGH, self.netname);
|
2003-03-02 04:06:47 +00:00
|
|
|
bprint (PRINT_HIGH, " left the game with ");
|
|
|
|
bprint (PRINT_HIGH, ftos (self.frags));
|
|
|
|
bprint (PRINT_HIGH, " frags\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
|
|
|
|
set_suicide_frame ();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
ClientObituary
|
|
|
|
|
|
|
|
called when a player dies
|
|
|
|
============
|
|
|
|
*/
|
2003-03-04 23:15:54 +00:00
|
|
|
void (entity targ, entity attacker)
|
|
|
|
ClientObituary =
|
2002-02-15 17:57:14 +00:00
|
|
|
{
|
2003-03-02 04:06:47 +00:00
|
|
|
local float rnum;
|
|
|
|
local string deathstring, deathstring2, attackerteam, targteam;
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
rnum = random ();
|
2002-02-15 17:57:14 +00:00
|
|
|
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
|
2003-03-02 04:06:47 +00:00
|
|
|
attackerteam = infokey (attacker, "team");
|
|
|
|
targteam = infokey (targ, "team");
|
2002-02-15 17:57:14 +00:00
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (targ.classname == "player") {
|
|
|
|
if (deathmatch > 3) {
|
|
|
|
if (targ.deathtype == "selfwater") {
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM, targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM," electrocutes himself.\n ");
|
|
|
|
targ.frags = targ.frags - 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
switch (attacker.classname) {
|
|
|
|
case "teledeath":
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM," was telefragged by ");
|
|
|
|
bprint (PRINT_MEDIUM,attacker.owner.netname);
|
|
|
|
bprint (PRINT_MEDIUM,"\n");
|
|
|
|
logfrag (attacker.owner, targ);
|
|
|
|
|
|
|
|
attacker.owner.frags = attacker.owner.frags + 1;
|
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "teledeath2":
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM,"Satan's power deflects ");
|
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM,"'s telefrag\n");
|
|
|
|
|
|
|
|
targ.frags = targ.frags - 1;
|
|
|
|
logfrag (targ, targ);
|
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "teledeath3":
|
|
|
|
// double 666 telefrag (can happen often in deathmatch 4)
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM," was telefragged by ");
|
|
|
|
bprint (PRINT_MEDIUM,attacker.owner.netname);
|
|
|
|
bprint (PRINT_MEDIUM, "'s Satan's power\n");
|
|
|
|
targ.frags = targ.frags - 1;
|
|
|
|
logfrag (targ, targ);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (targ.deathtype == "squish") {
|
2003-03-04 23:15:54 +00:00
|
|
|
if (teamplay && targteam == attackerteam && attackerteam != ""
|
|
|
|
&& targ != attacker) {
|
2002-02-15 17:57:14 +00:00
|
|
|
logfrag (attacker, attacker);
|
|
|
|
attacker.frags = attacker.frags - 1;
|
|
|
|
bprint (PRINT_MEDIUM,attacker.netname);
|
|
|
|
bprint (PRINT_MEDIUM," squished a teammate\n");
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if (attacker.classname == "player" && attacker != targ) {
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM, attacker.netname);
|
|
|
|
bprint (PRINT_MEDIUM," squishes ");
|
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM,"\n");
|
|
|
|
logfrag (attacker, targ);
|
|
|
|
attacker.frags = attacker.frags + 1;
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else {
|
2003-03-04 23:15:54 +00:00
|
|
|
targ.frags--; // killed self
|
2002-02-15 17:57:14 +00:00
|
|
|
logfrag (targ, targ);
|
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM," was squished\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (attacker.classname == "player") {
|
|
|
|
if (targ == attacker) {
|
2003-03-04 23:15:54 +00:00
|
|
|
attacker.frags--; // killed self
|
2002-02-15 17:57:14 +00:00
|
|
|
logfrag (attacker, attacker);
|
|
|
|
bprint (PRINT_MEDIUM,targ.netname);
|
|
|
|
if (targ.deathtype == "grenade")
|
|
|
|
bprint (PRINT_MEDIUM," tries to put the pin back in\n");
|
|
|
|
else if (targ.deathtype == "rocket")
|
|
|
|
bprint (PRINT_MEDIUM," becomes bored with life\n");
|
2003-03-02 04:06:47 +00:00
|
|
|
else if (targ.weapon == 64 && targ.waterlevel > 1) {
|
2003-03-04 23:15:54 +00:00
|
|
|
switch (targ.watertype) {
|
|
|
|
case CONTENT_SLIME:
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM," discharges into the slime\n");
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
case CONTENT_LAVA:
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM," discharges into the lava\n");
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM," discharges into the water.\n");
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
} else
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM," becomes bored with life\n");
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else if ((teamplay == 2) && (targteam == attackerteam) &&
|
|
|
|
(attackerteam != "")) {
|
2002-02-15 17:57:14 +00:00
|
|
|
if (rnum < 0.25)
|
|
|
|
deathstring = " mows down a teammate\n";
|
|
|
|
else if (rnum < 0.50)
|
|
|
|
deathstring = " checks his glasses\n";
|
|
|
|
else if (rnum < 0.75)
|
|
|
|
deathstring = " gets a frag for the other team\n";
|
|
|
|
else
|
|
|
|
deathstring = " loses another friend\n";
|
|
|
|
bprint (PRINT_MEDIUM, attacker.netname);
|
|
|
|
bprint (PRINT_MEDIUM, deathstring);
|
2003-03-04 23:15:54 +00:00
|
|
|
attacker.frags--;
|
2002-02-15 17:57:14 +00:00
|
|
|
//ZOID 12-13-96: killing a teammate logs as suicide
|
|
|
|
logfrag (attacker, attacker);
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else {
|
2003-03-04 23:15:54 +00:00
|
|
|
attacker.frags++;
|
2002-02-15 17:57:14 +00:00
|
|
|
logfrag (attacker, targ);
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
deathstring = deathstring2 = "'s quad rocket\n";
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
switch (targ.deathtype) {
|
|
|
|
case "nail":
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " was nailed by ";
|
|
|
|
deathstring2 = "\n";
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
case "supernail":
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " was punctured by ";
|
|
|
|
deathstring2 = "\n";
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
case "grenade":
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " eats ";
|
|
|
|
deathstring2 = "'s pineapple\n";
|
2003-03-02 04:06:47 +00:00
|
|
|
if (targ.health < -40) {
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " was gibbed by ";
|
|
|
|
deathstring2 = "'s grenade\n";
|
|
|
|
}
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
case "rocket":
|
2003-03-02 04:06:47 +00:00
|
|
|
if (attacker.super_damage_finished > 0 && targ.health
|
|
|
|
< -40) {
|
|
|
|
rnum = random ();
|
2002-02-15 17:57:14 +00:00
|
|
|
if (rnum < 0.3)
|
|
|
|
deathstring = " was brutalized by ";
|
|
|
|
else if (rnum < 0.6)
|
|
|
|
deathstring = " was smeared by ";
|
2003-03-02 04:06:47 +00:00
|
|
|
else {
|
2002-02-15 17:57:14 +00:00
|
|
|
bprint (PRINT_MEDIUM, attacker.netname);
|
|
|
|
bprint (PRINT_MEDIUM, " rips ");
|
|
|
|
bprint (PRINT_MEDIUM, targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM, " a new one\n");
|
|
|
|
return;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
} else {
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " rides ";
|
|
|
|
deathstring2 = "'s rocket\n";
|
2003-03-02 04:06:47 +00:00
|
|
|
if (targ.health < -40) {
|
2002-02-15 17:57:14 +00:00
|
|
|
deathstring = " was gibbed by ";
|
|
|
|
deathstring2 = "'s rocket\n" ;
|
|
|
|
}
|
|
|
|
}
|
2003-03-04 23:15:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
switch (attacker.weapon) {
|
|
|
|
case IT_AXE:
|
|
|
|
deathstring = " was ax-murdered by ";
|
|
|
|
deathstring2 = "\n";
|
|
|
|
break;
|
|
|
|
case IT_SHOTGUN:
|
|
|
|
deathstring = " chewed on ";
|
|
|
|
deathstring2 = "'s boomstick\n";
|
|
|
|
break;
|
|
|
|
case IT_SUPER_SHOTGUN:
|
|
|
|
deathstring = " ate 2 loads of ";
|
|
|
|
deathstring2 = "'s buckshot\n";
|
|
|
|
break;
|
|
|
|
case IT_LIGHTNING:
|
|
|
|
deathstring = " accepts ";
|
|
|
|
if (attacker.waterlevel > 1)
|
|
|
|
deathstring2 = "'s discharge\n";
|
|
|
|
else
|
|
|
|
deathstring2 = "'s shaft\n";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
deathstring = " dies mysteriously ";
|
|
|
|
deathstring2 = " progs bug\n";
|
|
|
|
break;
|
|
|
|
}
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
bprint (PRINT_MEDIUM, targ.netname);
|
|
|
|
bprint (PRINT_MEDIUM, deathstring);
|
|
|
|
bprint (PRINT_MEDIUM, attacker.netname);
|
|
|
|
bprint (PRINT_MEDIUM, deathstring2);
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
return;
|
2003-03-02 04:06:47 +00:00
|
|
|
} else {
|
2002-02-15 17:57:14 +00:00
|
|
|
logfrag (targ, targ);
|
|
|
|
targ.frags = targ.frags - 1; // killed self
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
bprint (PRINT_MEDIUM, targ.netname);
|
2003-03-04 23:15:54 +00:00
|
|
|
switch (targ.watertype) {
|
|
|
|
case -3:
|
2003-03-02 04:06:47 +00:00
|
|
|
if (random () < 0.5)
|
|
|
|
bprint (PRINT_MEDIUM, " sleeps with the fishes\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
else
|
2003-03-02 04:06:47 +00:00
|
|
|
bprint (PRINT_MEDIUM, " sucks it down\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case -4:
|
2003-03-02 04:06:47 +00:00
|
|
|
if (random () < 0.5)
|
|
|
|
bprint (PRINT_MEDIUM, " gulped a load of slime\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
else
|
2003-03-02 04:06:47 +00:00
|
|
|
bprint (PRINT_MEDIUM, " can't exist on slime alone\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case -5:
|
2003-03-02 04:06:47 +00:00
|
|
|
if (targ.health < -15) {
|
2003-03-04 23:15:54 +00:00
|
|
|
bprint (PRINT_MEDIUM, " burst into flames\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-03-02 04:06:47 +00:00
|
|
|
if (random () < 0.5)
|
2003-03-04 23:15:54 +00:00
|
|
|
bprint (PRINT_MEDIUM, " turned into hot slag\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
else
|
2003-03-04 23:15:54 +00:00
|
|
|
bprint (PRINT_MEDIUM, " visits the Volcano God\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
default:
|
|
|
|
break;
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
2003-03-02 04:06:47 +00:00
|
|
|
if (attacker.classname == "explo_box") {
|
2003-03-04 23:15:54 +00:00
|
|
|
bprint (PRINT_MEDIUM, " blew up\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-03-04 23:15:54 +00:00
|
|
|
|
|
|
|
switch (targ.deathtype) {
|
|
|
|
case "falling":
|
|
|
|
bprint (PRINT_MEDIUM, " fell to his death\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "nail":
|
|
|
|
case "supernail":
|
|
|
|
bprint (PRINT_MEDIUM, " was spiked\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "laser":
|
|
|
|
bprint (PRINT_MEDIUM, " was zapped\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "fireball":
|
|
|
|
bprint (PRINT_MEDIUM, " ate a lavaball\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
case "trigger_changelevel":
|
|
|
|
bprint (PRINT_MEDIUM, " tried to leave\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
return;
|
2003-03-04 23:15:54 +00:00
|
|
|
default:
|
|
|
|
break;
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
2003-03-04 23:15:54 +00:00
|
|
|
bprint (PRINT_MEDIUM, " died\n");
|
2002-02-15 17:57:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|