bring in Deek's bug fixes and whitespace cleanups

This commit is contained in:
Bill Currie 2002-02-22 20:01:05 +00:00
parent e158247afb
commit d8d86b931e
23 changed files with 261 additions and 1821 deletions

View file

@ -28,8 +28,8 @@ void() button_return =
}; };
void() button_blocked = void() button_blocked = // do nothing, just don't come all the way back out
{ // do nothing, just don't ome all the way back out {
}; };
@ -85,23 +85,19 @@ When a button is touched, it moves some distance in the direction of it's angle,
*/ */
void() func_button = void() func_button =
{ {
if (self.sounds == 0) if (self.sounds == 0) {
{
precache_sound ("buttons/airbut1.wav"); precache_sound ("buttons/airbut1.wav");
self.noise = "buttons/airbut1.wav"; self.noise = "buttons/airbut1.wav";
} }
if (self.sounds == 1) if (self.sounds == 1) {
{
precache_sound ("buttons/switch21.wav"); precache_sound ("buttons/switch21.wav");
self.noise = "buttons/switch21.wav"; self.noise = "buttons/switch21.wav";
} }
if (self.sounds == 2) if (self.sounds == 2) {
{
precache_sound ("buttons/switch02.wav"); precache_sound ("buttons/switch02.wav");
self.noise = "buttons/switch02.wav"; self.noise = "buttons/switch02.wav";
} }
if (self.sounds == 3) if (self.sounds == 3) {
{
precache_sound ("buttons/switch04.wav"); precache_sound ("buttons/switch04.wav");
self.noise = "buttons/switch04.wav"; self.noise = "buttons/switch04.wav";
} }
@ -115,17 +111,13 @@ void() func_button =
self.blocked = button_blocked; self.blocked = button_blocked;
self.use = button_use; self.use = button_use;
if (self.health) if (self.health) {
{
self.max_health = self.health; self.max_health = self.health;
self.th_die = button_killed; self.th_die = button_killed;
self.takedamage = DAMAGE_YES; self.takedamage = DAMAGE_YES;
// + POX self.nobleed = TRUE; // + POX
self.nobleed = TRUE; } else
// - POX
}
else
self.touch = button_touch; self.touch = button_touch;
if (!self.speed) if (!self.speed)

View file

@ -14,18 +14,16 @@ float modelindex_eyes, modelindex_player;
/* /*
============================================================================= =============================================================================
LEVEL CHANGING / INTERMISSION LEVEL CHANGING / INTERMISSION
============================================================================= =============================================================================
*/ */
string nextmap; string nextmap;
// POX - moved to poxdefs.qc //float intermission_running; // POX - moved to poxdefs.qc
//float intermission_running;
float intermission_exittime; float intermission_exittime;
/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
This is the camera point for the intermission. 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' Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitch roll yaw'
@ -52,7 +50,6 @@ void() SetNewParms =
// Quake Complains if this function isn't defined // Quake Complains if this function isn't defined
}; };
void() DecodeLevelParms = void() DecodeLevelParms =
{ {
//POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session //POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session
@ -62,19 +59,15 @@ void() DecodeLevelParms =
self.configed = parm2; self.configed = parm2;
//POX v1.2 - run autoexec.cfg ONCE when first joining server only! //POX v1.2 - run autoexec.cfg ONCE when first joining server only!
if (!self.configed) if (!self.configed) {
{
self.configed = TRUE; self.configed = TRUE;
stuffcmd(self, "exec autoexec.cfg\n"); stuffcmd(self, "exec autoexec.cfg\n");
} }
}; };
/* /*
============ ============
FindIntermission FindIntermission
Returns the entity to view from Returns the entity to view from
============ ============
*/ */
@ -82,14 +75,12 @@ entity() FindIntermission =
{ {
local entity spot; local entity spot;
local float cyc; local float cyc;
// look for info_intermission first // look for info_intermission first
spot = find (world, classname, "info_intermission"); spot = find (world, classname, "info_intermission");
if (spot) if (spot)
{ // pick a random one { // pick a random one
cyc = random() * 4; cyc = random() * 4;
while (cyc > 1) while (cyc > 1) {
{
spot = find (spot, classname, "info_intermission"); spot = find (spot, classname, "info_intermission");
if (!spot) if (!spot)
spot = find (spot, classname, "info_intermission"); spot = find (spot, classname, "info_intermission");
@ -97,7 +88,6 @@ entity() FindIntermission =
} }
return spot; return spot;
} }
// then look for the start position // then look for the start position
spot = find (world, classname, "info_player_start"); spot = find (world, classname, "info_player_start");
if (spot) if (spot)
@ -106,14 +96,12 @@ entity() FindIntermission =
objerror ("FindIntermission: no spot"); objerror ("FindIntermission: no spot");
}; };
void() GotoNextMap = void() GotoNextMap =
{ {
local string newmap; local string newmap;
//ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level //ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level
if (cvar ("samelevel") == 1) // if samelevel is set, stay on same level
if (cvar("samelevel") == 1) // if samelevel is set, stay on same level
changelevel (mapname); changelevel (mapname);
else { else {
// configurable map lists, see if the current map exists as a // configurable map lists, see if the current map exists as a
@ -126,12 +114,9 @@ void() GotoNextMap =
} }
}; };
/* /*
============ ============
IntermissionThink IntermissionThink
When the player presses attack or jump, change to the next level When the player presses attack or jump, change to the next level
============ ============
*/ */
@ -157,18 +142,14 @@ Take the players to the intermission spot
void() execute_changelevel = void() execute_changelevel =
{ {
local entity pos; local entity pos;
intermission_running = 1; intermission_running = 1;
// enforce a wait time before allowing changelevel // enforce a wait time before allowing changelevel
intermission_exittime = time + 5; intermission_exittime = time + 5;
pos = FindIntermission (); pos = FindIntermission ();
// play intermission music // play intermission music
WriteByte (MSG_ALL, SVC_CDTRACK); WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 3); WriteByte (MSG_ALL, 3);
WriteByte (MSG_ALL, SVC_INTERMISSION); WriteByte (MSG_ALL, SVC_INTERMISSION);
WriteCoord (MSG_ALL, pos.origin_x); WriteCoord (MSG_ALL, pos.origin_x);
WriteCoord (MSG_ALL, pos.origin_y); WriteCoord (MSG_ALL, pos.origin_y);
@ -186,15 +167,11 @@ void() execute_changelevel =
other.modelindex = 0; other.modelindex = 0;
other = find (other, classname, "player"); other = find (other, classname, "player");
} }
}; };
void() changelevel_touch = void() changelevel_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
return; return;
// if "noexit" is set, blow up the player trying to leave // if "noexit" is set, blow up the player trying to leave
//ZOID, 12-13-96, noexit isn't supported in QW. Overload samelevel //ZOID, 12-13-96, noexit isn't supported in QW. Overload samelevel
// if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) // if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start")))
@ -203,22 +180,17 @@ void() changelevel_touch =
T_Damage (other, self, self, 50000); T_Damage (other, self, self, 50000);
return; return;
} }
bprint (PRINT_HIGH, other.netname); bprint (PRINT_HIGH, other.netname);
bprint (PRINT_HIGH," exited the level\n"); bprint (PRINT_HIGH," exited the level\n");
nextmap = self.map; nextmap = self.map;
SUB_UseTargets (); SUB_UseTargets ();
self.touch = SUB_Null; self.touch = SUB_Null;
// we can't move people right now, because touch functions are called // 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 // in the middle of C movement code, so set a think time to do it
self.think = execute_changelevel; self.think = execute_changelevel;
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION /*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. 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.
*/ */
@ -230,18 +202,12 @@ void() trigger_changelevel =
InitTrigger (); InitTrigger ();
self.touch = changelevel_touch; self.touch = changelevel_touch;
}; };
/* /*
============================================================================= =============================================================================
PLAYER GAME EDGE FUNCTIONS PLAYER GAME EDGE FUNCTIONS
============================================================================= =============================================================================
*/ */
void() set_suicide_frame; void() set_suicide_frame;
// called by ClientKill and DeadThink // called by ClientKill and DeadThink
void() respawn = void() respawn =
{ {
@ -252,18 +218,13 @@ void() respawn =
// respawn // respawn
PutClientInServer (); PutClientInServer ();
}; };
/* /*
============ ============
ClientKill ClientKill
Player entered the suicide command Player entered the suicide command
============ ============
*/ */
void() NextLevel; //POX v1.12 void() NextLevel; //POX v1.12
void() ClientKill = void() ClientKill =
{ {
//POX v1.12 - don't let LMS observers suicide! //POX v1.12 - don't let LMS observers suicide!
@ -303,16 +264,13 @@ void() ClientKill =
respawn (); respawn ();
}; };
float(vector v) CheckSpawnPoint = float(vector v) CheckSpawnPoint =
{ {
return FALSE; return FALSE;
}; };
/* /*
============ ============
SelectSpawnPoint SelectSpawnPoint
Returns the entity to spawn at Returns the entity to spawn at
============ ============
*/ */
@ -322,25 +280,20 @@ entity() SelectSpawnPoint =
local float numspots, totalspots; local float numspots, totalspots;
local float pcount; local float pcount;
local entity spots; local entity spots;
numspots = 0; numspots = 0;
totalspots = 0; totalspots = 0;
// testinfo_player_start is only found in regioned levels // testinfo_player_start is only found in regioned levels
spot = find (world, classname, "testplayerstart"); spot = find (world, classname, "testplayerstart");
if (spot) if (spot)
return spot; return spot;
// choose a info_player_deathmatch point // choose a info_player_deathmatch point
// ok, find all spots that don't have players nearby // ok, find all spots that don't have players nearby
spots = world; spots = world;
spot = find (world, classname, "info_player_deathmatch"); spot = find (world, classname, "info_player_deathmatch");
while (spot) while (spot)
{ {
totalspots = totalspots + 1; totalspots = totalspots + 1;
thing=findradius(spot.origin, 84); thing=findradius(spot.origin, 84);
pcount=0; pcount=0;
while (thing) while (thing)
@ -354,7 +307,6 @@ entity() SelectSpawnPoint =
spots = spot; spots = spot;
numspots = numspots + 1; numspots = numspots + 1;
} }
// Get the next spot in the chain // Get the next spot in the chain
spot = find (spot, classname, "info_player_deathmatch"); spot = find (spot, classname, "info_player_deathmatch");
} }
@ -372,29 +324,22 @@ entity() SelectSpawnPoint =
} }
// We now have the number of spots available on the map in numspots // We now have the number of spots available on the map in numspots
// Generate a random number between 1 and numspots // Generate a random number between 1 and numspots
numspots = numspots - 1; numspots = numspots - 1;
numspots = rint((random() * numspots ) ); numspots = rint((random() * numspots ) );
spot = spots; spot = spots;
while (numspots > 0) { while (numspots > 0) {
spot = spot.goalentity; spot = spot.goalentity;
numspots = numspots - 1; numspots = numspots - 1;
} }
return spot; return spot;
}; };
//void() DecodeLevelParms; //void() DecodeLevelParms;
void() PlayerDie; void() PlayerDie;
/* /*
=========== ===========
ValidateUser ValidateUser
============ ============
*/ */
float(entity e) ValidateUser = float(entity e) ValidateUser =
@ -403,7 +348,6 @@ float(entity e) ValidateUser =
local string s; local string s;
local string userclan; local string userclan;
local float rank, rankmin, rankmax; local float rank, rankmin, rankmax;
// //
// if the server has set "clan1" and "clan2", then it // if the server has set "clan1" and "clan2", then it
// is a clan match that will allow only those two clans in // is a clan match that will allow only those two clans in
@ -419,14 +363,12 @@ float(entity e) ValidateUser =
return true; return true;
return false; return false;
} }
// //
// if the server has set "rankmin" and/or "rankmax" then // if the server has set "rankmin" and/or "rankmax" then
// the users rank must be between those two values // the users rank must be between those two values
// //
s = masterinfo (e, "rank"); s = masterinfo (e, "rank");
rank = stof (s); rank = stof (s);
s = serverinfo("rankmin"); s = serverinfo("rankmin");
if (s) if (s)
{ {
@ -441,16 +383,12 @@ float(entity e) ValidateUser =
if (rankmax < rank) if (rankmax < rank)
return false; return false;
} }
return true; return true;
*/ */
}; };
/* /*
=========== ===========
PutClientInServer PutClientInServer
called each time a player enters a new level called each time a player enters a new level
============ ============
*/ */
@ -498,11 +436,9 @@ void() PutClientInServer =
self.armorvalue = 50; self.armorvalue = 50;
self.armortype = 0.9; self.armortype = 0.9;
// - POX // - POX
DecodeLevelParms (); //POX v1.2 - exec autoconfig if needed, restore Target ID value DecodeLevelParms (); //POX v1.2 - exec autoconfig if needed, restore Target ID value
W_SetCurrentAmmo (); W_SetCurrentAmmo ();
self.attack_finished = time; self.attack_finished = time;
self.th_pain = player_pain; self.th_pain = player_pain;
self.th_die = PlayerDie; self.th_die = PlayerDie;
@ -513,48 +449,36 @@ void() PutClientInServer =
// + POX resest reload_rocket after death // + POX resest reload_rocket after death
self.reload_rocket = 0; self.reload_rocket = 0;
//resest triple shot after death //resest triple shot after death
self.prime_tshot = FALSE; self.prime_tshot = FALSE;
// - POX // - POX
spot = SelectSpawnPoint (); spot = SelectSpawnPoint ();
self.origin = spot.origin + '0 0 1'; self.origin = spot.origin + '0 0 1';
self.angles = spot.angles; self.angles = spot.angles;
self.fixangle = TRUE; // turn this way immediately self.fixangle = TRUE; // turn this way immediately
// oh, this is a hack! // oh, this is a hack!
setmodel (self, "progs/eyes.mdl"); setmodel (self, "progs/eyes.mdl");
modelindex_eyes = self.modelindex; modelindex_eyes = self.modelindex;
setmodel (self, "progs/player.mdl"); setmodel (self, "progs/player.mdl");
modelindex_player = self.modelindex; modelindex_player = self.modelindex;
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
self.view_ofs = '0 0 22'; self.view_ofs = '0 0 22';
// Mod - Xian (May.20.97) // Mod - Xian (May.20.97)
// Bug where player would have velocity from their last kill // Bug where player would have velocity from their last kill
self.velocity = '0 0 0'; self.velocity = '0 0 0';
player_stand1 (); player_stand1 ();
makevectors(self.angles); makevectors(self.angles);
spawn_tfog (self.origin + v_forward*20); spawn_tfog (self.origin + v_forward*20);
spawn_tdeath (self.origin, self); spawn_tdeath (self.origin, self);
// Set Rocket Jump Modifiers // Set Rocket Jump Modifiers
if (stof(infokey(world, "rj")) != 0) if (stof(infokey(world, "rj")) != 0)
{ {
rj = stof(infokey(world, "rj")); rj = stof(infokey(world, "rj"));
} }
// + POX - New DM mode stuff ----------------------------------------------------- // + POX - New DM mode stuff -----------------------------------------------------
//Last Man Standing Rules //Last Man Standing Rules
if ((deathmatch & DM_LMS) && !self.LMS_registered) if ((deathmatch & DM_LMS) && !self.LMS_registered)
{ {
@ -566,7 +490,6 @@ void() PutClientInServer =
self.LMS_registered = TRUE; self.LMS_registered = TRUE;
lms_plrcount = lms_plrcount + 1; lms_plrcount = lms_plrcount + 1;
} }
// + POX - Dark Mode more stuff is done in Player_PostThink - doesn't work here (?) // + POX - Dark Mode more stuff is done in Player_PostThink - doesn't work here (?)
if (deathmatch & DM_DARK) if (deathmatch & DM_DARK)
flash_on(self); flash_on(self);
@ -617,9 +540,7 @@ void() PutClientInServer =
self.invisible_time = 1; self.invisible_time = 1;
self.invisible_finished = time + 9999999999; self.invisible_finished = time + 9999999999;
} }
// - POX - New DM mode stuff ----------------------------------------------------- // - POX - New DM mode stuff -----------------------------------------------------
/* if (deathmatch == 4) /* if (deathmatch == 4)
{ {
self.ammo_shells = 0; self.ammo_shells = 0;
@ -644,7 +565,6 @@ void() PutClientInServer =
self.invincible_time = 1; self.invincible_time = 1;
self.invincible_finished = time + 3; self.invincible_finished = time + 3;
} }
if (deathmatch == 5) if (deathmatch == 5)
{ {
self.ammo_nails = 80; self.ammo_nails = 80;
@ -666,56 +586,41 @@ void() PutClientInServer =
self.invincible_finished = time + 3; self.invincible_finished = time + 3;
} }
*/ */
}; };
/* /*
============================================================================= =============================================================================
QUAKED FUNCTIONS QUAKED FUNCTIONS
============================================================================= =============================================================================
*/ */
/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24) /*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level. The normal starting point for a level.
*/ */
void() info_player_start = void() info_player_start =
{ {
}; };
/*QUAKED info_player_start2 (1 0 0) (-16 -16 -24) (16 16 24) /*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. Only used on start map for the return point from an episode.
*/ */
void() info_player_start2 = void() info_player_start2 =
{ {
}; };
/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24) /*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for deathmatch games potential spawning position for deathmatch games
*/ */
void() info_player_deathmatch = void() info_player_deathmatch =
{ {
}; };
/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24) /*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for coop games potential spawning position for coop games
*/ */
void() info_player_coop = void() info_player_coop =
{ {
}; };
/* /*
=============================================================================== ===============================================================================
RULES RULES
=============================================================================== ===============================================================================
*/ */
/* /*
go to the next level for deathmatch go to the next level for deathmatch
*/ */
@ -730,7 +635,6 @@ void() NextLevel =
if (nextmap != "") if (nextmap != "")
return; // already done return; // already done
if (mapname == "start") if (mapname == "start")
{ {
if (!cvar("registered")) if (!cvar("registered"))
@ -771,20 +675,16 @@ void() NextLevel =
o.map = mapname; o.map = mapname;
} }
} }
nextmap = o.map; nextmap = o.map;
if (o.nextthink < time) if (o.nextthink < time)
{ {
o.think = execute_changelevel; o.think = execute_changelevel;
o.nextthink = time + 0.1; o.nextthink = time + 0.1;
} }
}; };
/* /*
============ ============
CheckRules CheckRules
Exit deathmatch games upon conditions Exit deathmatch games upon conditions
============ ============
*/ */
@ -811,13 +711,10 @@ void() CheckRules =
// - POX // - POX
}; };
//============================================================================ //============================================================================
void() PlayerDeathThink = void() PlayerDeathThink =
{ {
local float forward; local float forward;
if ((self.flags & FL_ONGROUND)) if ((self.flags & FL_ONGROUND))
{ {
forward = vlen (self.velocity); forward = vlen (self.velocity);
@ -827,7 +724,6 @@ void() PlayerDeathThink =
else else
self.velocity = forward * normalize(self.velocity); self.velocity = forward * normalize(self.velocity);
} }
// wait for all buttons released // wait for all buttons released
if (self.deadflag == DEAD_DEAD) if (self.deadflag == DEAD_DEAD)
{ {
@ -836,11 +732,9 @@ void() PlayerDeathThink =
self.deadflag = DEAD_RESPAWNABLE; self.deadflag = DEAD_RESPAWNABLE;
return; return;
} }
// + POX - don't let players lay around as dead guys during a Last Man Standing game // + POX - don't let players lay around as dead guys during a Last Man Standing game
if (!self.button2 && !self.button1 && !self.button0 && !(deathmatch & DM_LMS)) if (!self.button2 && !self.button1 && !self.button0 && !(deathmatch & DM_LMS))
return; return;
if (deathmatch & DM_LMS) if (deathmatch & DM_LMS)
stuffcmd (self, "wait;wait;wait;wait;wait;wait\n"); stuffcmd (self, "wait;wait;wait;wait;wait;wait\n");
@ -848,14 +742,11 @@ void() PlayerDeathThink =
// if (!self.button2 && !self.button1 && !self.button0) // if (!self.button2 && !self.button1 && !self.button0)
// return; // return;
// - POX // - POX
self.button0 = 0; self.button0 = 0;
self.button1 = 0; self.button1 = 0;
self.button2 = 0; self.button2 = 0;
respawn(); respawn();
}; };
void() PlayerJump = void() PlayerJump =
{ {
if (self.flags & FL_WATERJUMP) if (self.flags & FL_WATERJUMP)
@ -873,7 +764,6 @@ void() PlayerJump =
else else
sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
} }
return; return;
} }
*/ */
@ -886,33 +776,24 @@ void() PlayerJump =
self.velocity_z = 80; self.velocity_z = 80;
else else
self.velocity_z = 50; self.velocity_z = 50;
return; return;
} }
// - POX // - POX
if (!(self.flags & FL_ONGROUND)) if (!(self.flags & FL_ONGROUND))
return; return;
if ( !(self.flags & FL_JUMPRELEASED) ) if ( !(self.flags & FL_JUMPRELEASED) )
return; // don't pogo stick return; // don't pogo stick
self.flags = self.flags - (self.flags & FL_JUMPRELEASED); self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
self.button2 = 0; self.button2 = 0;
// player jumping sound // player jumping sound
sound (self, CHAN_VOICE, "player/plyrjmp8.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/plyrjmp8.wav", 1, ATTN_NORM);
}; };
/* /*
=========== ===========
WaterMove WaterMove
============ ============
*/ */
.float dmgtime; .float dmgtime;
void() WaterMove = void() WaterMove =
{ {
//dprint (ftos(self.waterlevel)); //dprint (ftos(self.waterlevel));
@ -920,7 +801,6 @@ void() WaterMove =
return; return;
if (self.health < 0) if (self.health < 0)
return; return;
if (self.waterlevel != 3) if (self.waterlevel != 3)
{ {
if (self.air_finished < time) if (self.air_finished < time)
@ -961,7 +841,6 @@ void() WaterMove =
} }
return; return;
} }
if (self.watertype == CONTENT_LAVA) if (self.watertype == CONTENT_LAVA)
{ // do damage { // do damage
if (self.dmgtime < time) if (self.dmgtime < time)
@ -970,7 +849,6 @@ void() WaterMove =
self.dmgtime = time + 1; self.dmgtime = time + 1;
else else
self.dmgtime = time + 0.2; self.dmgtime = time + 0.2;
T_Damage (self, world, world, 10*self.waterlevel); T_Damage (self, world, world, 10*self.waterlevel);
} }
} }
@ -985,20 +863,16 @@ void() WaterMove =
if ( !(self.flags & FL_INWATER) ) if ( !(self.flags & FL_INWATER) )
{ {
// player enter water sound // player enter water sound
if (self.watertype == CONTENT_LAVA) if (self.watertype == CONTENT_LAVA)
sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
if (self.watertype == CONTENT_WATER) if (self.watertype == CONTENT_WATER)
sound (self, CHAN_VOICE, "player/inh2o.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/inh2o.wav", 1, ATTN_NORM);
if (self.watertype == CONTENT_SLIME) if (self.watertype == CONTENT_SLIME)
sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
self.flags = self.flags + FL_INWATER; self.flags = self.flags + FL_INWATER;
self.dmgtime = 0; self.dmgtime = 0;
} }
// + POX - New water movement sounds // + POX - New water movement sounds
if (self.waterlevel >= 3) if (self.waterlevel >= 3)
{ {
@ -1046,13 +920,10 @@ if (self.waterlevel >= 3)
*/ */
} }
// - POX // - POX
}; };
void() CheckWaterJump = void() CheckWaterJump =
{ {
local vector start, end; local vector start, end;
// check for a jump-out-of-water // check for a jump-out-of-water
makevectors (self.angles); makevectors (self.angles);
start = self.origin; start = self.origin;
@ -1077,11 +948,9 @@ void() CheckWaterJump =
} }
} }
}; };
/* /*
================ ================
PlayerPreThink PlayerPreThink
Called every frame before physics are run Called every frame before physics are run
================ ================
*/ */
@ -1092,12 +961,9 @@ void() PlayerPreThink =
IntermissionThink (); // otherwise a button could be missed between IntermissionThink (); // otherwise a button could be missed between
return; // the think tics return; // the think tics
} }
if (self.view_ofs == '0 0 0') if (self.view_ofs == '0 0 0')
return; // intermission or finale return; // intermission or finale
makevectors (self.v_angle); // is this still used makevectors (self.v_angle); // is this still used
self.deathtype = ""; self.deathtype = "";
CheckRules (); CheckRules ();
@ -1113,13 +979,11 @@ void() PlayerPreThink =
return; return;
} }
// - POX // - POX
WaterMove (); WaterMove ();
/* /*
if (self.waterlevel == 2) if (self.waterlevel == 2)
CheckWaterJump (); CheckWaterJump ();
*/ */
if (self.deadflag >= DEAD_DEAD) if (self.deadflag >= DEAD_DEAD)
{ {
PlayerDeathThink (); PlayerDeathThink ();
@ -1135,7 +999,6 @@ void() PlayerPreThink =
} }
else else
self.flags = self.flags | FL_JUMPRELEASED; self.flags = self.flags | FL_JUMPRELEASED;
// teleporters can force a non-moving pause time // teleporters can force a non-moving pause time
if (time < self.pausetime) if (time < self.pausetime)
self.velocity = '0 0 0'; self.velocity = '0 0 0';
@ -1155,7 +1018,6 @@ void() PlayerPreThink =
/* /*
================ ================
CheckPowerups CheckPowerups
Check for turning off powerups Check for turning off powerups
================ ================
*/ */
@ -1163,7 +1025,6 @@ void() CheckPowerups =
{ {
if (self.health <= 0) if (self.health <= 0)
return; return;
// + POX - Rot armour down to 150 (max 250) // + POX - Rot armour down to 150 (max 250)
if (self.armorvalue > 150 && self.armor_rot < time) if (self.armorvalue > 150 && self.armor_rot < time)
{ {
@ -1175,7 +1036,6 @@ void() CheckPowerups =
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2; self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
} }
// - POX // - POX
// invisibility // invisibility
if (self.invisible_finished) if (self.invisible_finished)
{ {
@ -1185,8 +1045,6 @@ void() CheckPowerups =
sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE); sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE);
self.invisible_sound = time + ((random() * 3) + 1); self.invisible_sound = time + ((random() * 3) + 1);
} }
if (self.invisible_finished < time + 3) if (self.invisible_finished < time + 3)
{ {
if (self.invisible_time == 1) if (self.invisible_time == 1)
@ -1203,7 +1061,6 @@ void() CheckPowerups =
stuffcmd (self, "bf\n"); stuffcmd (self, "bf\n");
} }
} }
if (self.invisible_finished < time) if (self.invisible_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_INVISIBILITY; self.items = self.items - IT_INVISIBILITY;
@ -1217,7 +1074,6 @@ void() CheckPowerups =
} }
else else
self.modelindex = modelindex_player; // don't use eyes self.modelindex = modelindex_player; // don't use eyes
// invincibility // invincibility
if (self.invincible_finished) if (self.invincible_finished)
{ {
@ -1257,13 +1113,10 @@ void() CheckPowerups =
self.effects = self.effects - (self.effects & EF_RED); self.effects = self.effects - (self.effects & EF_RED);
} }
} }
// super damage // super damage
if (self.super_damage_finished) if (self.super_damage_finished)
{ {
// sound and screen flash when items starts to run out // sound and screen flash when items starts to run out
if (self.super_damage_finished < time + 3) if (self.super_damage_finished < time + 3)
{ {
if (self.super_time == 1) if (self.super_time == 1)
@ -1283,7 +1136,6 @@ void() CheckPowerups =
stuffcmd (self, "bf\n"); stuffcmd (self, "bf\n");
} }
} }
if (self.super_damage_finished < time) if (self.super_damage_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_QUAD; self.items = self.items - IT_QUAD;
@ -1309,12 +1161,10 @@ void() CheckPowerups =
self.effects = self.effects - (self.effects & EF_BLUE); self.effects = self.effects - (self.effects & EF_BLUE);
} }
} }
// suit // suit
if (self.radsuit_finished) if (self.radsuit_finished)
{ {
self.air_finished = time + 12; // don't drown self.air_finished = time + 12; // don't drown
// sound and screen flash when items starts to run out // sound and screen flash when items starts to run out
if (self.radsuit_finished < time + 3) if (self.radsuit_finished < time + 3)
{ {
@ -1332,7 +1182,6 @@ void() CheckPowerups =
stuffcmd (self, "bf\n"); stuffcmd (self, "bf\n");
} }
} }
if (self.radsuit_finished < time) if (self.radsuit_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_SUIT; self.items = self.items - IT_SUIT;
@ -1340,13 +1189,10 @@ void() CheckPowerups =
self.radsuit_finished = 0; self.radsuit_finished = 0;
} }
} }
}; };
//POX v1.2 - PlayerRegen - for better handling of regen staion touch //POX v1.2 - PlayerRegen - for better handling of regen staion touch
.float armregen; .float armregen;
.float regen_finished; .float regen_finished;
void() PlayerRegen = void() PlayerRegen =
{ {
local float type, bit; local float type, bit;
@ -1357,13 +1203,11 @@ local string snd;
self.regen_finished = time; self.regen_finished = time;
return; // already have max armour that station can give return; // already have max armour that station can give
} }
self.armorvalue = self.armorvalue + 3; self.armorvalue = self.armorvalue + 3;
//Cap armour //Cap armour
if (self.armorvalue > self.armregen) if (self.armorvalue > self.armregen)
self.armorvalue = self.armregen; self.armorvalue = self.armregen;
if (self.armorvalue > 150) //Equivlent to Red (level 3) Armour if (self.armorvalue > 150) //Equivlent to Red (level 3) Armour
{ {
type = 0.8; type = 0.8;
@ -1396,13 +1240,10 @@ local string snd;
//POX - 1.01b - Don't allow armour to rot while recharging //POX - 1.01b - Don't allow armour to rot while recharging
self.armor_rot = time + 5; self.armor_rot = time + 5;
}; };
/* /*
================ ================
PlayerPostThink PlayerPostThink
Called every frame after physics are run Called every frame after physics are run
================ ================
*/ */
@ -1421,7 +1262,6 @@ void() PlayerPostThink =
self.cshift_off = TRUE; self.cshift_off = TRUE;
} }
} }
if (self.view_ofs == '0 0 0') if (self.view_ofs == '0 0 0')
return; // intermission or finale return; // intermission or finale
@ -1459,7 +1299,6 @@ void() PlayerPostThink =
else else
sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
} }
self.jump_flag = self.velocity_z; self.jump_flag = self.velocity_z;
//POX v1.2 - better regen touch handling //POX v1.2 - better regen touch handling
@ -1467,22 +1306,16 @@ void() PlayerPostThink =
PlayerRegen (); PlayerRegen ();
CheckPowerups (); CheckPowerups ();
W_WeaponFrame (); W_WeaponFrame ();
}; };
/* /*
=========== ===========
ClientConnect ClientConnect
called when a player connects to a server called when a player connects to a server
============ ============
*/ */
void() ClientConnect = void() ClientConnect =
{ {
// + POX - I hard coded some environmental changes to prevent tampering.... // + POX - I hard coded some environmental changes to prevent tampering....
// NOTE: autoexec.cfg is called at DecodeLevelParms (QW ignores it when called from quake.rc - which is also ignored) // NOTE: autoexec.cfg is called at DecodeLevelParms (QW ignores it when called from quake.rc - which is also ignored)
// POX v1.12 added 'fov 90' (mostly for lms_observer additions) // POX v1.12 added 'fov 90' (mostly for lms_observer additions)
@ -1491,7 +1324,6 @@ void() ClientConnect =
//POX v1.12 - why bother... //POX v1.12 - why bother...
//sprint (self, PRINT_HIGH, "\n\n---------------\nPOXworld v1.11b\n---------------\n\n"); //sprint (self, PRINT_HIGH, "\n\n---------------\nPOXworld v1.11b\n---------------\n\n");
// + POX LMS late joiners get booted to spectate // + POX LMS late joiners get booted to spectate
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
{ {
@ -1532,17 +1364,13 @@ void() ClientConnect =
} }
// a client connecting during an intermission can cause problems // a client connecting during an intermission can cause problems
if (intermission_running) if (intermission_running)
GotoNextMap (); GotoNextMap ();
}; };
/* /*
=========== ===========
ClientDisconnect ClientDisconnect
called when a player disconnects from a server called when a player disconnects from a server
============ ============
*/ */
@ -1554,7 +1382,6 @@ void() ClientDisconnect =
bprint (PRINT_HIGH, ftos(self.frags)); bprint (PRINT_HIGH, ftos(self.frags));
bprint (PRINT_HIGH, " frags\n"); bprint (PRINT_HIGH, " frags\n");
sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
// + POX // + POX
if ((deathmatch & DM_LMS) && (self.LMS_registered)) if ((deathmatch & DM_LMS) && (self.LMS_registered))
{ {
@ -1567,21 +1394,17 @@ void() ClientDisconnect =
set_suicide_frame (); set_suicide_frame ();
}; };
/* /*
=========== ===========
ClientObituary ClientObituary
called when a player dies called when a player dies
============ ============
*/ */
void(entity targ, entity attacker) ClientObituary = void(entity targ, entity attacker) ClientObituary =
{ {
local float rnum; local float rnum;
local string deathstring, deathstring2; local string deathstring, deathstring2;
local string attackerteam, targteam; local string attackerteam, targteam;
rnum = random(); rnum = random();
//ZOID 12-13-96: self.team doesn't work in QW. Use keys //ZOID 12-13-96: self.team doesn't work in QW. Use keys
attackerteam = infokey(attacker, "team"); attackerteam = infokey(attacker, "team");
@ -1605,7 +1428,6 @@ void(entity targ, entity attacker) ClientObituary =
if (lms_plrcount <= 1) //1 or no players left so end the game if (lms_plrcount <= 1) //1 or no players left so end the game
lms_gameover = TRUE;//POX v1.2 - Check this in CheckRules (so frag logging is still done) lms_gameover = TRUE;//POX v1.2 - Check this in CheckRules (so frag logging is still done)
//Put'em into LMS observer mode at next spawn //Put'em into LMS observer mode at next spawn
//POX v1.12 - fixed a stupid overlook on my part - said 'self.' (!?) //POX v1.12 - fixed a stupid overlook on my part - said 'self.' (!?)
targ.frags = 0; targ.frags = 0;
@ -1618,7 +1440,6 @@ void(entity targ, entity attacker) ClientObituary =
if (targ.classname == "player") if (targ.classname == "player")
{ {
/*if (deathmatch > 3) /*if (deathmatch > 3)
{ {
if (targ.deathtype == "selfwater") if (targ.deathtype == "selfwater")
@ -1629,7 +1450,6 @@ void(entity targ, entity attacker) ClientObituary =
return; return;
} }
}*/ }*/
if (attacker.classname == "teledeath") if (attacker.classname == "teledeath")
{ {
bprint (PRINT_MEDIUM,targ.netname); bprint (PRINT_MEDIUM,targ.netname);
@ -1644,7 +1464,6 @@ void(entity targ, entity attacker) ClientObituary =
return; return;
} }
if (attacker.classname == "teledeath2") if (attacker.classname == "teledeath2")
{ {
bprint (PRINT_MEDIUM,"MegaSheild's power deflects "); bprint (PRINT_MEDIUM,"MegaSheild's power deflects ");
@ -1655,10 +1474,8 @@ void(entity targ, entity attacker) ClientObituary =
if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode
targ.frags = targ.frags - 1; targ.frags = targ.frags - 1;
return; return;
} }
// double 666 telefrag (can happen often in deathmatch 4) // double 666 telefrag (can happen often in deathmatch 4)
if (attacker.classname == "teledeath3") if (attacker.classname == "teledeath3")
{ {
@ -1671,11 +1488,9 @@ void(entity targ, entity attacker) ClientObituary =
if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode
targ.frags = targ.frags - 1; targ.frags = targ.frags - 1;
return; return;
} }
if (targ.deathtype == "squish") if (targ.deathtype == "squish")
{ {
if (teamplay && targteam == attackerteam && attackerteam != "" && targ != attacker) if (teamplay && targteam == attackerteam && attackerteam != "" && targ != attacker)
@ -1715,7 +1530,6 @@ void(entity targ, entity attacker) ClientObituary =
return; return;
} }
} }
if (attacker.classname == "player") if (attacker.classname == "player")
{ {
if (targ == attacker) if (targ == attacker)
@ -1762,7 +1576,6 @@ void(entity targ, entity attacker) ClientObituary =
if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode
attacker.frags = attacker.frags - 1; attacker.frags = attacker.frags - 1;
return; return;
} }
else else
@ -1898,9 +1711,7 @@ void(entity targ, entity attacker) ClientObituary =
if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode
targ.frags = targ.frags - 1; // killed self targ.frags = targ.frags - 1; // killed self
rnum = targ.watertype; rnum = targ.watertype;
bprint (PRINT_MEDIUM,targ.netname); bprint (PRINT_MEDIUM,targ.netname);
if (rnum == -3) if (rnum == -3)
{ {
@ -1962,7 +1773,6 @@ void(entity targ, entity attacker) ClientObituary =
bprint (PRINT_MEDIUM," tried to leave\n"); bprint (PRINT_MEDIUM," tried to leave\n");
return; return;
} }
bprint (PRINT_MEDIUM," died\n"); bprint (PRINT_MEDIUM," died\n");
} }
} }

View file

@ -3,17 +3,13 @@ void() T_MissileTouch;
void() info_player_start; void() info_player_start;
void(entity targ, entity attacker) ClientObituary; void(entity targ, entity attacker) ClientObituary;
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage; void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage;
/*SERVER /*SERVER
void() monster_death_use; void() monster_death_use;
*/ */
//============================================================================ //============================================================================
/* /*
============ ============
CanDamage CanDamage
Returns true if the inflictor can directly damage the target. Used for Returns true if the inflictor can directly damage the target. Used for
explosions and melee attacks. explosions and melee attacks.
============ ============
@ -46,11 +42,8 @@ float(entity targ, entity inflictor) CanDamage =
traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self); traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self);
if (trace_fraction == 1) if (trace_fraction == 1)
return TRUE; return TRUE;
return FALSE; return FALSE;
}; };
/* /*
============ ============
Killed Killed
@ -59,35 +52,29 @@ Killed
void(entity targ, entity attacker) Killed = void(entity targ, entity attacker) Killed =
{ {
local entity oself; local entity oself;
oself = self; oself = self;
self = targ; self = targ;
if (self.health < -99) if (self.health < -99)
self.health = -99; // don't let sbar look bad if a player self.health = -99; // don't let sbar look bad if a player
if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE) if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE)
{ // doors, triggers, etc { // doors, triggers, etc
self.th_die (); self.th_die ();
self = oself; self = oself;
return; return;
} }
self.enemy = attacker; self.enemy = attacker;
// bump the monster counter // bump the monster counter
if (self.flags & FL_MONSTER) if (self.flags & FL_MONSTER)
{ {
killed_monsters = killed_monsters + 1; killed_monsters = killed_monsters + 1;
WriteByte (MSG_ALL, SVC_KILLEDMONSTER); WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
} }
ClientObituary(self, attacker); ClientObituary(self, attacker);
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
self.touch = SUB_Null; self.touch = SUB_Null;
self.effects = 0; self.effects = 0;
/*SERVER /*SERVER
monster_death_use(); monster_death_use();
*/ */
@ -95,12 +82,9 @@ void(entity targ, entity attacker) Killed =
self = oself; self = oself;
}; };
/* /*
============ ============
T_Damage T_Damage
The damage is coming from inflictor, but get mad at attacker The damage is coming from inflictor, but get mad at attacker
This should be the only function that ever reduces health. This should be the only function that ever reduces health.
============ ============
@ -112,22 +96,16 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
local float save; local float save;
local float take; local float take;
local string attackerteam, targteam; local string attackerteam, targteam;
if (!targ.takedamage) if (!targ.takedamage)
return; return;
// used by buttons and triggers to set activator for target firing // used by buttons and triggers to set activator for target firing
damage_attacker = attacker; damage_attacker = attacker;
// check for quad damage powerup on the attacker // check for quad damage powerup on the attacker
if (attacker.super_damage_finished > time && inflictor.classname != "door") if (attacker.super_damage_finished > time && inflictor.classname != "door")
if (deathmatch == 4) if (deathmatch == 4)
damage = damage * 8; damage = damage * 8;
else else
damage = damage * 4; damage = damage * 4;
//POX - this was moved from below the armour save routines to above so armour isn't lost //POX - this was moved from below the armour save routines to above so armour isn't lost
// check for godmode or invincibility // check for godmode or invincibility
if (targ.flags & FL_GODMODE) if (targ.flags & FL_GODMODE)
@ -141,9 +119,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
} }
return; return;
} }
// save damage based on the target's armor level // save damage based on the target's armor level
save = ceil(targ.armortype*damage); save = ceil(targ.armortype*damage);
if (save >= targ.armorvalue) if (save >= targ.armorvalue)
{ {
@ -153,7 +129,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
} }
targ.armorvalue = targ.armorvalue - save; targ.armorvalue = targ.armorvalue - save;
// POX - Armour Stuff to dynamically change the type along with the value // POX - Armour Stuff to dynamically change the type along with the value
if (targ.armorvalue > 150) if (targ.armorvalue > 150)
{ {
@ -174,7 +149,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
} }
take = ceil(damage-save); take = ceil(damage-save);
// add to the damage total for clients, which will be sent as a single // add to the damage total for clients, which will be sent as a single
// message at the end of the frame // message at the end of the frame
// FIXME: remove after combining shotgun blasts? // FIXME: remove after combining shotgun blasts?
@ -184,10 +158,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
targ.dmg_save = targ.dmg_save + save; targ.dmg_save = targ.dmg_save + save;
targ.dmg_inflictor = inflictor; targ.dmg_inflictor = inflictor;
} }
damage_inflictor = inflictor; damage_inflictor = inflictor;
// figure momentum add // figure momentum add
if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) )
{ {
@ -205,20 +176,15 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
// Rocket Jump modifiers // Rocket Jump modifiers
if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname)) if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname))
targ.velocity = targ.velocity + dir * damage * rj; targ.velocity = targ.velocity + dir * damage * rj;
} }
// team play damage avoidance // team play damage avoidance
//ZOID 12-13-96: self.team doesn't work in QW. Use keys //ZOID 12-13-96: self.team doesn't work in QW. Use keys
attackerteam = infokey(attacker, "team"); attackerteam = infokey(attacker, "team");
targteam = infokey(targ, "team"); targteam = infokey(targ, "team");
if ((teamplay == 1) && (targteam == attackerteam) && if ((teamplay == 1) && (targteam == attackerteam) &&
(attacker.classname == "player") && (attackerteam != "") && (attacker.classname == "player") && (attackerteam != "") &&
inflictor.classname !="door") inflictor.classname !="door")
return; return;
if ((teamplay == 3) && (targteam == attackerteam) && if ((teamplay == 3) && (targteam == attackerteam) &&
(attacker.classname == "player") && (attackerteam != "") && (attacker.classname == "player") && (attackerteam != "") &&
(targ != attacker)&& inflictor.classname !="door") (targ != attacker)&& inflictor.classname !="door")
@ -226,17 +192,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
// do the damage // do the damage
targ.health = targ.health - take; targ.health = targ.health - take;
if (targ.health <= 0) if (targ.health <= 0)
{ {
Killed (targ, attacker); Killed (targ, attacker);
return; return;
} }
// react to the damage // react to the damage
oldself = self; oldself = self;
self = targ; self = targ;
/*SERVER /*SERVER
if ( (self.flags & FL_MONSTER) && attacker != world) if ( (self.flags & FL_MONSTER) && attacker != world)
{ {
@ -258,10 +221,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
{ {
self.th_pain (attacker, take); self.th_pain (attacker, take);
} }
self = oldself; self = oldself;
}; };
/* /*
============ ============
T_RadiusDamage T_RadiusDamage
@ -272,7 +233,6 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp
local float points; local float points;
local entity head; local entity head;
local vector org; local vector org;
head = findradius(inflictor.origin, damage+40); head = findradius(inflictor.origin, damage+40);
while (head) while (head)
@ -307,7 +267,6 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp
head = head.chain; head = head.chain;
} }
}; };
/* /*
============ ============
T_BeamDamage T_BeamDamage
@ -339,4 +298,3 @@ void(entity attacker, float damage) T_BeamDamage =
head = head.chain; head = head.chain;
} }
}; };

View file

@ -4,36 +4,26 @@ float DOOR_DONT_LINK = 4;
float DOOR_GOLD_KEY = 8; float DOOR_GOLD_KEY = 8;
float DOOR_SILVER_KEY = 16; float DOOR_SILVER_KEY = 16;
float DOOR_TOGGLE = 32; float DOOR_TOGGLE = 32;
/* /*
Doors are similar to buttons, but can spawn a fat trigger field around them Doors are similar to buttons, but can spawn a fat trigger field around them
to open without a touch, and they link together to form simultanious to open without a touch, and they link together to form simultanious
double/quad doors. double/quad doors.
Door.owner is the master door. If there is only one door, it points to itself. Door.owner is the master door. If there is only one door, it points to itself.
If multiple doors, all will point to a single one. If multiple doors, all will point to a single one.
Door.enemy chains from the master door through all doors linked in the chain. Door.enemy chains from the master door through all doors linked in the chain.
*/ */
/* /*
============================================================================= =============================================================================
THINK FUNCTIONS THINK FUNCTIONS
============================================================================= =============================================================================
*/ */
void() door_go_down; void() door_go_down;
void() door_go_up; void() door_go_up;
void() door_blocked = void() door_blocked =
{ {
other.deathtype = "squish"; other.deathtype = "squish";
T_Damage (other, self, self.goalentity, self.dmg); T_Damage (other, self, self.goalentity, self.dmg);
// if a door has a negative wait, it would never come back if blocked, // if a door has a negative wait, it would never come back if blocked,
// so let it just squash the object to death real fast // so let it just squash the object to death real fast
if (self.wait >= 0) if (self.wait >= 0)
@ -44,8 +34,6 @@ void() door_blocked =
door_go_down (); door_go_down ();
} }
}; };
void() door_hit_top = void() door_hit_top =
{ {
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
@ -55,13 +43,11 @@ void() door_hit_top =
self.think = door_go_down; self.think = door_go_down;
self.nextthink = self.ltime + self.wait; self.nextthink = self.ltime + self.wait;
}; };
void() door_hit_bottom = void() door_hit_bottom =
{ {
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_BOTTOM; self.state = STATE_BOTTOM;
}; };
void() door_go_down = void() door_go_down =
{ {
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
@ -74,12 +60,10 @@ void() door_go_down =
self.state = STATE_DOWN; self.state = STATE_DOWN;
SUB_CalcMove (self.pos1, self.speed, door_hit_bottom); SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
}; };
void() door_go_up = void() door_go_up =
{ {
if (self.state == STATE_UP) if (self.state == STATE_UP)
return; // allready going up return; // allready going up
if (self.state == STATE_TOP) if (self.state == STATE_TOP)
{ // reset top wait time { // reset top wait time
self.nextthink = self.ltime + self.wait; self.nextthink = self.ltime + self.wait;
@ -89,35 +73,24 @@ void() door_go_up =
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
self.state = STATE_UP; self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, door_hit_top); SUB_CalcMove (self.pos2, self.speed, door_hit_top);
SUB_UseTargets(); SUB_UseTargets();
}; };
/* /*
============================================================================= =============================================================================
ACTIVATION FUNCTIONS ACTIVATION FUNCTIONS
============================================================================= =============================================================================
*/ */
void() door_fire = void() door_fire =
{ {
local entity oself; local entity oself;
local entity starte; local entity starte;
if (self.owner != self) if (self.owner != self)
objerror ("door_fire: self.owner != self"); objerror ("door_fire: self.owner != self");
// play use key sound // play use key sound
if (self.items) if (self.items)
sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM);
self.message = string_null; // no more message self.message = string_null; // no more message
oself = self; oself = self;
if (self.spawnflags & DOOR_TOGGLE) if (self.spawnflags & DOOR_TOGGLE)
{ {
if (self.state == STATE_UP || self.state == STATE_TOP) if (self.state == STATE_UP || self.state == STATE_TOP)
@ -144,39 +117,28 @@ void() door_fire =
} while ( (self != starte) && (self != world) ); } while ( (self != starte) && (self != world) );
self = oself; self = oself;
}; };
void() door_use = void() door_use =
{ {
local entity oself; local entity oself;
self.message = ""; // door message are for touch only self.message = ""; // door message are for touch only
self.owner.message = ""; self.owner.message = "";
self.enemy.message = ""; self.enemy.message = "";
oself = self; oself = self;
self = self.owner; self = self.owner;
door_fire (); door_fire ();
self = oself; self = oself;
}; };
void() door_trigger_touch = void() door_trigger_touch =
{ {
if (other.health <= 0) if (other.health <= 0)
return; return;
if (time < self.attack_finished) if (time < self.attack_finished)
return; return;
self.attack_finished = time + 1; self.attack_finished = time + 1;
activator = other; activator = other;
self = self.owner; self = self.owner;
door_use (); door_use ();
}; };
void() door_killed = void() door_killed =
{ {
local entity oself; local entity oself;
@ -188,12 +150,9 @@ void() door_killed =
door_use (); door_use ();
self = oself; self = oself;
}; };
/* /*
================ ================
door_touch door_touch
Prints messages and opens key doors Prints messages and opens key doors
================ ================
*/ */
@ -203,9 +162,7 @@ void() door_touch =
return; return;
if (self.owner.attack_finished > time) if (self.owner.attack_finished > time)
return; return;
self.owner.attack_finished = time + 2; self.owner.attack_finished = time + 2;
if (self.owner.message != "") if (self.owner.message != "")
{ {
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
@ -216,7 +173,6 @@ void() door_touch =
// key door stuff // key door stuff
if (!self.items) if (!self.items)
return; return;
// FIXME: blink key on player's status bar // FIXME: blink key on player's status bar
if ( (self.items & other.items) != self.items ) if ( (self.items & other.items) != self.items )
{ {
@ -260,41 +216,31 @@ void() door_touch =
} }
return; return;
} }
other.items = other.items - self.items; other.items = other.items - self.items;
self.touch = SUB_Null; self.touch = SUB_Null;
if (self.enemy) if (self.enemy)
self.enemy.touch = SUB_Null; // get paired door self.enemy.touch = SUB_Null; // get paired door
door_use (); door_use ();
}; };
/* /*
============================================================================= =============================================================================
SPAWNING FUNCTIONS SPAWNING FUNCTIONS
============================================================================= =============================================================================
*/ */
entity(vector fmins, vector fmaxs) spawn_field = entity(vector fmins, vector fmaxs) spawn_field =
{ {
local entity trigger; local entity trigger;
local vector t1, t2; local vector t1, t2;
trigger = spawn(); trigger = spawn();
trigger.movetype = MOVETYPE_NONE; trigger.movetype = MOVETYPE_NONE;
trigger.solid = SOLID_TRIGGER; trigger.solid = SOLID_TRIGGER;
trigger.owner = self; trigger.owner = self;
trigger.touch = door_trigger_touch; trigger.touch = door_trigger_touch;
t1 = fmins; t1 = fmins;
t2 = fmaxs; t2 = fmaxs;
setsize (trigger, t1 - '60 60 8', t2 + '60 60 8'); setsize (trigger, t1 - '60 60 8', t2 + '60 60 8');
return (trigger); return (trigger);
}; };
float (entity e1, entity e2) EntitiesTouching = float (entity e1, entity e2) EntitiesTouching =
{ {
if (e1.mins_x > e2.maxs_x) if (e1.mins_x > e2.maxs_x)
@ -311,20 +257,15 @@ float (entity e1, entity e2) EntitiesTouching =
return FALSE; return FALSE;
return TRUE; return TRUE;
}; };
/* /*
============= =============
LinkDoors LinkDoors
============= =============
*/ */
void() LinkDoors = void() LinkDoors =
{ {
local entity t, starte; local entity t, starte;
local vector cmins, cmaxs; local vector cmins, cmaxs;
if (self.enemy) if (self.enemy)
return; // already linked by another door return; // already linked by another door
if (self.spawnflags & 4) if (self.spawnflags & 4)
@ -332,7 +273,6 @@ void() LinkDoors =
self.owner = self.enemy = self; self.owner = self.enemy = self;
return; // don't want to link this door return; // don't want to link this door
} }
cmins = self.mins; cmins = self.mins;
cmaxs = self.maxs; cmaxs = self.maxs;
@ -342,36 +282,29 @@ void() LinkDoors =
do do
{ {
self.owner = starte; // master door self.owner = starte; // master door
if (self.health) if (self.health)
starte.health = self.health; starte.health = self.health;
if (self.targetname) if (self.targetname)
starte.targetname = self.targetname; starte.targetname = self.targetname;
if (self.message != "") if (self.message != "")
starte.message = self.message; starte.message = self.message;
t = find (t, classname, self.classname); t = find (t, classname, self.classname);
if (!t) if (!t)
{ {
self.enemy = starte; // make the chain a loop self.enemy = starte; // make the chain a loop
// shootable, fired, or key doors just needed the owner/enemy links, // shootable, fired, or key doors just needed the owner/enemy links,
// they don't spawn a field // they don't spawn a field
self = self.owner; self = self.owner;
if (self.health) if (self.health)
return; return;
if (self.targetname) if (self.targetname)
return; return;
if (self.items) if (self.items)
return; return;
self.owner.trigger_field = spawn_field(cmins, cmaxs); self.owner.trigger_field = spawn_field(cmins, cmaxs);
return; return;
} }
if (EntitiesTouching(self,t)) if (EntitiesTouching(self,t))
{ {
if (t.enemy) if (t.enemy)
@ -379,7 +312,6 @@ void() LinkDoors =
self.enemy = t; self.enemy = t;
self = t; self = t;
if (t.mins_x < cmins_x) if (t.mins_x < cmins_x)
cmins_x = t.mins_x; cmins_x = t.mins_x;
if (t.mins_y < cmins_y) if (t.mins_y < cmins_y)
@ -394,19 +326,12 @@ void() LinkDoors =
cmaxs_z = t.maxs_z; cmaxs_z = t.maxs_z;
} }
} while (1 ); } while (1 );
}; };
/*QUAKED func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE /*QUAKED func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE
if two doors touch, they are assumed to be connected and operate as a unit. if two doors touch, they are assumed to be connected and operate as a unit.
TOGGLE causes the door to wait in both the start and end states for a trigger event. TOGGLE causes the door to wait in both the start and end states for a trigger event.
START_OPEN causes the door to move to its destination when spawned, and operate in reverse. It is used to temporarily or permanently close off an area when triggered (not usefull for touch or takedamage doors). START_OPEN causes the door to move to its destination when spawned, and operate in reverse. It is used to temporarily or permanently close off an area when triggered (not usefull for touch or takedamage doors).
Key doors are allways wait -1. Key doors are allways wait -1.
"message" is printed when the door is touched if it is a trigger door and it hasn't been fired yet "message" is printed when the door is touched if it is a trigger door and it hasn't been fired yet
"angle" determines the opening direction "angle" determines the opening direction
"targetname" if set, no touch field will be spawned and a remote button or trigger field activates the door. "targetname" if set, no touch field will be spawned and a remote button or trigger field activates the door.
@ -422,11 +347,8 @@ Key doors are allways wait -1.
3) stone chain 3) stone chain
4) screechy metal 4) screechy metal
*/ */
void() func_door = void() func_door =
{ {
if (world.worldtype == 0) if (world.worldtype == 0)
{ {
precache_sound ("doors/medtry.wav"); precache_sound ("doors/medtry.wav");
@ -487,17 +409,13 @@ void() func_door =
self.noise1 = "doors/ddoor2.wav"; self.noise1 = "doors/ddoor2.wav";
self.noise2 = "doors/ddoor1.wav"; self.noise2 = "doors/ddoor1.wav";
} }
SetMovedir (); SetMovedir ();
self.max_health = self.health; self.max_health = self.health;
self.solid = SOLID_BSP; self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH; self.movetype = MOVETYPE_PUSH;
setorigin (self, self.origin); setorigin (self, self.origin);
setmodel (self, self.model); setmodel (self, self.model);
self.classname = "door"; self.classname = "door";
self.blocked = door_blocked; self.blocked = door_blocked;
self.use = door_use; self.use = door_use;
@ -514,10 +432,8 @@ void() func_door =
self.lip = 8; self.lip = 8;
if (!self.dmg) if (!self.dmg)
self.dmg = 2; self.dmg = 2;
self.pos1 = self.origin; self.pos1 = self.origin;
self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
// DOOR_START_OPEN is to allow an entity to be lighted in the closed position // DOOR_START_OPEN is to allow an entity to be lighted in the closed position
// but spawn in the open position // but spawn in the open position
if (self.spawnflags & DOOR_START_OPEN) if (self.spawnflags & DOOR_START_OPEN)
@ -526,9 +442,7 @@ void() func_door =
self.pos2 = self.pos1; self.pos2 = self.pos1;
self.pos1 = self.origin; self.pos1 = self.origin;
} }
self.state = STATE_BOTTOM; self.state = STATE_BOTTOM;
if (self.health) if (self.health)
{ {
self.takedamage = DAMAGE_YES; self.takedamage = DAMAGE_YES;
@ -539,21 +453,16 @@ void() func_door =
self.wait = -1; self.wait = -1;
self.touch = door_touch; self.touch = door_touch;
// LinkDoors can't be done until all of the doors have been spawned, so // LinkDoors can't be done until all of the doors have been spawned, so
// the sizes can be detected properly. // the sizes can be detected properly.
self.think = LinkDoors; self.think = LinkDoors;
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
}; };
/* /*
============================================================================= =============================================================================
SECRET DOORS SECRET DOORS
============================================================================= =============================================================================
*/ */
void() fd_secret_move1; void() fd_secret_move1;
void() fd_secret_move2; void() fd_secret_move2;
void() fd_secret_move3; void() fd_secret_move3;
@ -561,26 +470,21 @@ void() fd_secret_move4;
void() fd_secret_move5; void() fd_secret_move5;
void() fd_secret_move6; void() fd_secret_move6;
void() fd_secret_done; void() fd_secret_done;
float SECRET_OPEN_ONCE = 1; // stays open float SECRET_OPEN_ONCE = 1; // stays open
float SECRET_1ST_LEFT = 2; // 1st move is left of arrow float SECRET_1ST_LEFT = 2; // 1st move is left of arrow
float SECRET_1ST_DOWN = 4; // 1st move is down from arrow float SECRET_1ST_DOWN = 4; // 1st move is down from arrow
float SECRET_NO_SHOOT = 8; // only opened by trigger float SECRET_NO_SHOOT = 8; // only opened by trigger
float SECRET_YES_SHOOT = 16; // shootable even if targeted float SECRET_YES_SHOOT = 16; // shootable even if targeted
void () fd_secret_use = void () fd_secret_use =
{ {
local float temp; local float temp;
self.health = 10000; self.health = 10000;
// exit if still moving around... // exit if still moving around...
if (self.origin != self.oldorigin) if (self.origin != self.oldorigin)
return; return;
self.message = string_null; // no more message self.message = string_null; // no more message
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
if (!(self.spawnflags & SECRET_NO_SHOOT)) if (!(self.spawnflags & SECRET_NO_SHOOT))
@ -589,12 +493,10 @@ void () fd_secret_use =
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
} }
self.velocity = '0 0 0'; self.velocity = '0 0 0';
// Make a sound, wait a little... // Make a sound, wait a little...
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
makevectors(self.mangle); makevectors(self.mangle);
@ -608,7 +510,6 @@ void () fd_secret_use =
if (!self.t_length) if (!self.t_length)
self. t_length = fabs(v_forward * self.size); self. t_length = fabs(v_forward * self.size);
if (self.spawnflags & SECRET_1ST_DOWN) if (self.spawnflags & SECRET_1ST_DOWN)
self.dest1 = self.origin - v_up * self.t_width; self.dest1 = self.origin - v_up * self.t_width;
else else
@ -618,12 +519,10 @@ void () fd_secret_use =
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
}; };
void (entity attacker, float damage) fd_secret_pain = void (entity attacker, float damage) fd_secret_pain =
{ {
fd_secret_use (); fd_secret_use ();
}; };
// Wait after first movement... // Wait after first movement...
void () fd_secret_move1 = void () fd_secret_move1 =
{ {
@ -631,14 +530,12 @@ void () fd_secret_move1 =
self.think = fd_secret_move2; self.think = fd_secret_move2;
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
}; };
// Start moving sideways w/sound... // Start moving sideways w/sound...
void () fd_secret_move2 = void () fd_secret_move2 =
{ {
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3); SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
}; };
// Wait here until time to go back... // Wait here until time to go back...
void () fd_secret_move3 = void () fd_secret_move3 =
{ {
@ -649,14 +546,12 @@ void () fd_secret_move3 =
self.think = fd_secret_move4; self.think = fd_secret_move4;
} }
}; };
// Move backward... // Move backward...
void () fd_secret_move4 = void () fd_secret_move4 =
{ {
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5); SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
}; };
// Wait 1 second... // Wait 1 second...
void () fd_secret_move5 = void () fd_secret_move5 =
{ {
@ -664,13 +559,11 @@ void () fd_secret_move5 =
self.think = fd_secret_move6; self.think = fd_secret_move6;
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
}; };
void () fd_secret_move6 = void () fd_secret_move6 =
{ {
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done); SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
}; };
void () fd_secret_done = void () fd_secret_done =
{ {
if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT) if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT)
@ -682,7 +575,6 @@ void () fd_secret_done =
} }
sound(self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise3, 1, ATTN_NORM); sound(self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise3, 1, ATTN_NORM);
}; };
void () secret_blocked = void () secret_blocked =
{ {
if (time < self.attack_finished) if (time < self.attack_finished)
@ -691,11 +583,9 @@ void () secret_blocked =
other.deathtype = "squish"; other.deathtype = "squish";
T_Damage (other, self, self, self.dmg); T_Damage (other, self, self, self.dmg);
}; };
/* /*
================ ================
secret_touch secret_touch
Prints messages Prints messages
================ ================
*/ */
@ -705,7 +595,6 @@ void() secret_touch =
return; return;
if (self.attack_finished > time) if (self.attack_finished > time)
return; return;
self.attack_finished = time + 2; self.attack_finished = time + 2;
if (self.message) if (self.message)
@ -716,8 +605,6 @@ void() secret_touch =
sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM);
} }
}; };
/*QUAKED func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot /*QUAKED func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
Basic secret door. Slides back, then to the side. Angle determines direction. Basic secret door. Slides back, then to the side. Angle determines direction.
wait = # of seconds before coming back wait = # of seconds before coming back
@ -727,14 +614,12 @@ always_shoot = even if targeted, keep shootable
t_width = override WIDTH to move back (or height if going down) t_width = override WIDTH to move back (or height if going down)
t_length = override LENGTH to move sideways t_length = override LENGTH to move sideways
"dmg" damage to inflict when blocked (2 default) "dmg" damage to inflict when blocked (2 default)
If a secret door has a targetname, it will only be opened by it's botton or trigger, not by damage. If a secret door has a targetname, it will only be opened by it's botton or trigger, not by damage.
"sounds" "sounds"
1) medieval 1) medieval
2) metal 2) metal
3) base 3) base
*/ */
void () func_door_secret = void () func_door_secret =
{ {
if (self.sounds == 0) if (self.sounds == 0)
@ -764,7 +649,6 @@ void () func_door_secret =
self.noise1 = "doors/basesec2.wav"; self.noise1 = "doors/basesec2.wav";
self.noise3 = "doors/basesec2.wav"; self.noise3 = "doors/basesec2.wav";
} }
if (!self.dmg) if (!self.dmg)
self.dmg = 2; self.dmg = 2;

View file

@ -1,7 +1,6 @@
/* /*
Frank Condello 09.28.98 - originally for the M.A.H.E.M. MacQuake Mod. Frank Condello 09.28.98 - originally for the M.A.H.E.M. MacQuake Mod.
Now used in paroxysm Now used in paroxysm
EMAIL: pox@planetquake.com EMAIL: pox@planetquake.com
WEB: http://www.planetquake.com/paroxysm/ WEB: http://www.planetquake.com/paroxysm/
========================================================================= =========================================================================
@ -19,7 +18,6 @@ Dynamic Light can also be triggered, They currenty only start turned off.
.float dynlight_style; .float dynlight_style;
void() dynlight_next; void() dynlight_next;
void() dynlight_find; void() dynlight_find;
void() start_dynlight = void() start_dynlight =
{ {
//POX v1.1 - changed this for QW support //POX v1.1 - changed this for QW support
@ -39,7 +37,6 @@ void() start_dynlight =
dynlight_next(); dynlight_next();
}; };
void() dynlight_wait = void() dynlight_wait =
{ {
if (self.wait) if (self.wait)
@ -49,11 +46,9 @@ void() dynlight_wait =
self.think = dynlight_next; self.think = dynlight_next;
}; };
void() dynlight_next = void() dynlight_next =
{ {
local entity targ; local entity targ;
targ = find (world, targetname, self.target); targ = find (world, targetname, self.target);
self.target = targ.target; self.target = targ.target;
if (!self.target) if (!self.target)
@ -64,12 +59,9 @@ void() dynlight_next =
self.wait = 0; self.wait = 0;
SUB_CalcMove (targ.origin - self.mins, self.speed, dynlight_wait); SUB_CalcMove (targ.origin - self.mins, self.speed, dynlight_wait);
}; };
void() dynlight_find = void() dynlight_find =
{ {
local entity targ; local entity targ;
targ = find (world, targetname, self.target); targ = find (world, targetname, self.target);
self.target = targ.target; self.target = targ.target;
setorigin (self, targ.origin - self.mins); setorigin (self, targ.origin - self.mins);
@ -79,20 +71,15 @@ void() dynlight_find =
self.think = start_dynlight; self.think = start_dynlight;
} }
}; };
void() dynlight_use = void() dynlight_use =
{ {
if (self.think != dynlight_find) if (self.think != dynlight_find)
return; // already activated return; // already activated
start_dynlight(); start_dynlight();
}; };
void() dyn_light = void() dyn_light =
{ {
precache_model ("progs/null.spr"); precache_model ("progs/null.spr");
if (!self.speed) if (!self.speed)
self.speed = 100; self.speed = 100;
@ -107,7 +94,6 @@ void() dyn_light =
setmodel (self, "progs/null.spr"); setmodel (self, "progs/null.spr");
setsize (self, '0 0 0', '0 0 0'); setsize (self, '0 0 0', '0 0 0');
setorigin (self, self.origin); setorigin (self, self.origin);
// start trains on the second frame, to make sure their targets have had // start trains on the second frame, to make sure their targets have had
// a chance to spawn // a chance to spawn
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;

View file

@ -1,39 +1,29 @@
/* /*
POX - Flashlight code from the Flashlight Tutorial at the Inside3D website <http://www.inside3d.com> POX - Flashlight code from the Flashlight Tutorial at the Inside3D website <http://www.inside3d.com>
Created by ShockMan eMail: shockman@brutality.com Created by ShockMan eMail: shockman@brutality.com
Added an entity attribute to the spawn function for bot support (since self is only the bot at respwan) Added an entity attribute to the spawn function for bot support (since self is only the bot at respwan)
*/ */
void() flash_update = void() flash_update =
{ {
// The Player is dead so turn the Flashlight off // The Player is dead so turn the Flashlight off
if (self.owner.deadflag != DEAD_NO) if (self.owner.deadflag != DEAD_NO)
self.effects = 0; self.effects = 0;
// The Player is alive so turn On the Flashlight // The Player is alive so turn On the Flashlight
else else
self.effects = EF_DIMLIGHT; self.effects = EF_DIMLIGHT;
// Find out which direction player facing // Find out which direction player facing
makevectors (self.owner.v_angle); makevectors (self.owner.v_angle);
// Check if there is any things infront of the flashlight // Check if there is any things infront of the flashlight
traceline (self.owner.origin , (self.owner.origin+(v_forward * 500)) , FALSE , self); traceline (self.owner.origin , (self.owner.origin+(v_forward * 500)) , FALSE , self);
// Set the Flashlight's position // Set the Flashlight's position
setorigin (self, trace_endpos+(v_forward * -5)); setorigin (self, trace_endpos+(v_forward * -5));
// Repeat it in 0.02 seconds... // Repeat it in 0.02 seconds...
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
}; };
void(entity me) flash_on = void(entity me) flash_on =
{ {
// Make a new entity to hold the Flashlight // Make a new entity to hold the Flashlight
local entity myflash; local entity myflash;
// spawn flash // spawn flash
myflash = spawn (); myflash = spawn ();
myflash.movetype = MOVETYPE_NONE; myflash.movetype = MOVETYPE_NONE;
@ -45,7 +35,6 @@ void(entity me) flash_on =
//POX - changed it to a null sprite //POX - changed it to a null sprite
setmodel (myflash, "progs/null.spr"); setmodel (myflash, "progs/null.spr");
setsize (myflash, '0 0 0', '0 0 0'); setsize (myflash, '0 0 0', '0 0 0');
// Wire Player And Flashlight Together // Wire Player And Flashlight Together
myflash.owner = me; myflash.owner = me;
me.flash = myflash; me.flash = myflash;
@ -58,14 +47,13 @@ void(entity me) flash_on =
makevectors (self.v_angle); makevectors (self.v_angle);
traceline (self.origin , (self.origin+(v_forward * 500)) , FALSE , self); traceline (self.origin , (self.origin+(v_forward * 500)) , FALSE , self);
setorigin (myflash, trace_endpos); setorigin (myflash, trace_endpos);
// Start Flashlight Update // Start Flashlight Update
myflash.think = flash_update; myflash.think = flash_update;
myflash.nextthink = time + 0.02; myflash.nextthink = time + 0.02;
}; };
//POX - the user toggle is not implemented (auto light for Darkmode only) //POX - the user toggle is not implemented (auto light for Darkmode only)
/* /*
void () flash_toggle = void () flash_toggle =
{ {
// If Off, Turn On // If Off, Turn On
@ -74,7 +62,6 @@ void () flash_toggle =
self.flash_flag = TRUE; self.flash_flag = TRUE;
flash_on(); flash_on();
} }
// If On, Turn Off // If On, Turn Off
else else
{ {
@ -84,5 +71,5 @@ void () flash_toggle =
self.flash.nextthink = time + 0.1; self.flash.nextthink = time + 0.1;
} }
}; };
*/
*/

View file

@ -4,10 +4,8 @@
All rights reserved. All rights reserved.
Do not distribute. Do not distribute.
*/ */
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// 12/29/98 Combined all functions neccessary for rotating objects from Hips QW source // 12/29/98 Combined all functions neccessary for rotating objects from Hips QW source
.vector neworigin; .vector neworigin;
.vector rotate; .vector rotate;
.float endtime; .float endtime;
@ -16,12 +14,10 @@
.string path; .string path;
.string group; .string group;
.string event; .string event;
void() RotateTargets; void() RotateTargets;
void() RotateTargetsFinal; void() RotateTargetsFinal;
void() SetTargetOrigin; void() SetTargetOrigin;
void() LinkRotateTargets; void() LinkRotateTargets;
void( entity ent, float amount ) hurt_setdamage = void( entity ent, float amount ) hurt_setdamage =
{ {
ent.dmg = amount; ent.dmg = amount;
@ -35,7 +31,6 @@ void( entity ent, float amount ) hurt_setdamage =
} }
ent.nextthink = -1; ent.nextthink = -1;
}; };
vector ( vector ang ) SUB_NormalizeAngles = vector ( vector ang ) SUB_NormalizeAngles =
{ {
while( ang_x > 360 ) while( ang_x > 360 )
@ -46,7 +41,6 @@ vector ( vector ang ) SUB_NormalizeAngles =
{ {
ang_x = ang_x + 360; ang_x = ang_x + 360;
} }
while( ang_y > 360 ) while( ang_y > 360 )
{ {
ang_y = ang_y - 360; ang_y = ang_y - 360;
@ -55,7 +49,6 @@ vector ( vector ang ) SUB_NormalizeAngles =
{ {
ang_y = ang_y + 360; ang_y = ang_y + 360;
} }
while( ang_z > 360 ) while( ang_z > 360 )
{ {
ang_z = ang_z - 360; ang_z = ang_z - 360;
@ -64,35 +57,28 @@ vector ( vector ang ) SUB_NormalizeAngles =
{ {
ang_z = ang_z + 360; ang_z = ang_z + 360;
} }
return ang; return ang;
}; };
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// Start Rotate code // Start Rotate code
float STATE_ACTIVE = 0; float STATE_ACTIVE = 0;
float STATE_INACTIVE = 1; float STATE_INACTIVE = 1;
float STATE_SPEEDINGUP = 2; float STATE_SPEEDINGUP = 2;
float STATE_SLOWINGDOWN = 3; float STATE_SLOWINGDOWN = 3;
float STATE_CLOSED = 4; float STATE_CLOSED = 4;
float STATE_OPEN = 5; float STATE_OPEN = 5;
float STATE_OPENING = 6; float STATE_OPENING = 6;
float STATE_CLOSING = 7; float STATE_CLOSING = 7;
float STATE_WAIT = 0; float STATE_WAIT = 0;
float STATE_MOVE = 1; float STATE_MOVE = 1;
float STATE_STOP = 2; float STATE_STOP = 2;
float STATE_FIND = 3; float STATE_FIND = 3;
float STATE_NEXT = 4; float STATE_NEXT = 4;
float OBJECT_ROTATE = 0; float OBJECT_ROTATE = 0;
float OBJECT_MOVEWALL = 1; float OBJECT_MOVEWALL = 1;
float OBJECT_SETORIGIN = 2; float OBJECT_SETORIGIN = 2;
float TOGGLE = 1; float TOGGLE = 1;
float START_ON = 2; float START_ON = 2;
float ROTATION = 1; float ROTATION = 1;
float ANGLES = 2; float ANGLES = 2;
float STOP = 4; float STOP = 4;
@ -100,13 +86,10 @@ float NO_ROTATE = 8;
float DAMAGE = 16; float DAMAGE = 16;
float MOVETIME = 32; float MOVETIME = 32;
float SET_DAMAGE = 64; float SET_DAMAGE = 64;
float VISIBLE = 1; float VISIBLE = 1;
float TOUCH = 2; float TOUCH = 2;
float NONBLOCKING = 4; float NONBLOCKING = 4;
float STAYOPEN = 1; float STAYOPEN = 1;
/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) /*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as the point of rotation for rotatable objects. Used as the point of rotation for rotatable objects.
*/ */
@ -117,7 +100,6 @@ void() info_rotate =
self.nextthink = time + 2; self.nextthink = time + 2;
self.think = SUB_Remove; self.think = SUB_Remove;
}; };
void() RotateTargets = void() RotateTargets =
{ {
local entity ent; local entity ent;
@ -125,9 +107,7 @@ void() RotateTargets =
local vector vy; local vector vy;
local vector vz; local vector vz;
local vector org; local vector org;
makevectors (self.angles); makevectors (self.angles);
ent = find( world, targetname, self.target); ent = find( world, targetname, self.target);
while( ent ) while( ent )
{ {
@ -166,11 +146,9 @@ void() RotateTargets =
ent = find( ent, targetname, self.target); ent = find( ent, targetname, self.target);
} }
}; };
void() RotateTargetsFinal = void() RotateTargetsFinal =
{ {
local entity ent; local entity ent;
ent = find( world, targetname, self.target); ent = find( world, targetname, self.target);
while( ent ) while( ent )
{ {
@ -182,11 +160,9 @@ void() RotateTargetsFinal =
ent = find( ent, targetname, self.target); ent = find( ent, targetname, self.target);
} }
}; };
void() SetTargetOrigin = void() SetTargetOrigin =
{ {
local entity ent; local entity ent;
ent = find( world, targetname, self.target); ent = find( world, targetname, self.target);
while( ent ) while( ent )
{ {
@ -202,12 +178,10 @@ void() SetTargetOrigin =
ent = find( ent, targetname, self.target); ent = find( ent, targetname, self.target);
} }
}; };
void() LinkRotateTargets = void() LinkRotateTargets =
{ {
local entity ent; local entity ent;
local vector tempvec; local vector tempvec;
self.oldorigin = self.origin; self.oldorigin = self.origin;
ent = find( world, targetname, self.target); ent = find( world, targetname, self.target);
while( ent ) while( ent )
@ -236,11 +210,9 @@ void() LinkRotateTargets =
ent = find (ent, targetname, self.target); ent = find (ent, targetname, self.target);
} }
}; };
void( float amount ) SetDamageOnTargets = void( float amount ) SetDamageOnTargets =
{ {
local entity ent; local entity ent;
ent = find( world, targetname, self.target); ent = find( world, targetname, self.target);
while( ent ) while( ent )
{ {
@ -255,21 +227,16 @@ void( float amount ) SetDamageOnTargets =
ent = find( ent, targetname, self.target); ent = find( ent, targetname, self.target);
} }
}; };
//************************************************ //************************************************
// //
// Simple continual rotatation // Simple continual rotatation
// //
//************************************************ //************************************************
void() rotate_entity_think = void() rotate_entity_think =
{ {
local float t; local float t;
t = time - self.ltime; t = time - self.ltime;
self.ltime = time; self.ltime = time;
if ( self.state == STATE_SPEEDINGUP ) if ( self.state == STATE_SPEEDINGUP )
{ {
self.count = self.count + self.cnt * t; self.count = self.count + self.cnt * t;
@ -277,7 +244,6 @@ void() rotate_entity_think =
{ {
self.count = 1; self.count = 1;
} }
// get rate of rotation // get rate of rotation
t = t * self.count; t = t * self.count;
} }
@ -291,22 +257,18 @@ void() rotate_entity_think =
self.think = SUB_Null; self.think = SUB_Null;
return; return;
} }
// get rate of rotation // get rate of rotation
t = t * self.count; t = t * self.count;
} }
self.angles = self.angles + ( self.rotate * t ); self.angles = self.angles + ( self.rotate * t );
self.angles = SUB_NormalizeAngles( self.angles ); self.angles = SUB_NormalizeAngles( self.angles );
RotateTargets(); RotateTargets();
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
}; };
void() rotate_entity_use = void() rotate_entity_use =
{ {
// change to alternate textures // change to alternate textures
self.frame = 1 - self.frame; self.frame = 1 - self.frame;
if ( self.state == STATE_ACTIVE ) if ( self.state == STATE_ACTIVE )
{ {
if ( self.spawnflags & TOGGLE ) if ( self.spawnflags & TOGGLE )
@ -350,7 +312,6 @@ void() rotate_entity_use =
self.state = STATE_SPEEDINGUP; self.state = STATE_SPEEDINGUP;
} }
}; };
void() rotate_entity_firstthink = void() rotate_entity_firstthink =
{ {
LinkRotateTargets(); LinkRotateTargets();
@ -368,63 +329,44 @@ void() rotate_entity_firstthink =
} }
self.use = rotate_entity_use; self.use = rotate_entity_use;
}; };
/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON /*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON
Creates an entity that continually rotates. Can be toggled on and Creates an entity that continually rotates. Can be toggled on and
off if targeted. off if targeted.
TOGGLE = allows the rotation to be toggled on/off TOGGLE = allows the rotation to be toggled on/off
START_ON = wether the entity is spinning when spawned. If TOGGLE is 0, entity can be turned on, but not off. START_ON = wether the entity is spinning when spawned. If TOGGLE is 0, entity can be turned on, but not off.
If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train.
"rotate" is the rate to rotate. "rotate" is the rate to rotate.
"target" is the center of rotation. "target" is the center of rotation.
"speed" is how long the entity takes to go from standing still to full speed and vice-versa. "speed" is how long the entity takes to go from standing still to full speed and vice-versa.
*/ */
void() func_rotate_entity = void() func_rotate_entity =
{ {
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
setmodel (self, self.model); setmodel (self, self.model);
setsize( self, self.mins, self.maxs ); setsize( self, self.mins, self.maxs );
if ( self.speed != 0 ) if ( self.speed != 0 )
{ {
self.cnt = 1 / self.speed; self.cnt = 1 / self.speed;
} }
self.think = rotate_entity_firstthink; self.think = rotate_entity_firstthink;
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
self.ltime = time; self.ltime = time;
}; };
//************************************************ //************************************************
// //
// Train with rotation functionality // Train with rotation functionality
// //
//************************************************ //************************************************
/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE /*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE
Path for rotate_train. Path for rotate_train.
ROTATION tells train to rotate at rate specified by "rotate". Use '0 0 0' to stop rotation. ROTATION tells train to rotate at rate specified by "rotate". Use '0 0 0' to stop rotation.
ANGLES tells train to rotate to the angles specified by "angles" while traveling to this path_rotate. Use values < 0 or > 360 to guarantee that it turns in a certain direction. Having this flag set automatically clears any rotation. ANGLES tells train to rotate to the angles specified by "angles" while traveling to this path_rotate. Use values < 0 or > 360 to guarantee that it turns in a certain direction. Having this flag set automatically clears any rotation.
STOP tells the train to stop and wait to be retriggered. STOP tells the train to stop and wait to be retriggered.
NO_ROTATE tells the train to stop rotating when waiting to be triggered. NO_ROTATE tells the train to stop rotating when waiting to be triggered.
DAMAGE tells the train to cause damage based on "dmg". DAMAGE tells the train to cause damage based on "dmg".
MOVETIME tells the train to interpret "speed" as the length of time to take moving from one corner to another. MOVETIME tells the train to interpret "speed" as the length of time to take moving from one corner to another.
SET_DAMAGE tells the train to set all targets damage to "dmg" SET_DAMAGE tells the train to set all targets damage to "dmg"
"noise" contains the name of the sound to play when train stops. "noise" contains the name of the sound to play when train stops.
"noise1" contains the name of the sound to play when train moves. "noise1" contains the name of the sound to play when train moves.
"event" is a target to trigger when train arrives at path_rotate. "event" is a target to trigger when train arrives at path_rotate.
@ -440,20 +382,15 @@ void() path_rotate =
precache_sound( self.noise1 ); precache_sound( self.noise1 );
} }
}; };
void() rotate_train; void() rotate_train;
void() rotate_train_next; void() rotate_train_next;
void() rotate_train_find; void() rotate_train_find;
void() rotate_train_think = void() rotate_train_think =
{ {
local float t; local float t;
local float timeelapsed; local float timeelapsed;
t = time - self.ltime; t = time - self.ltime;
self.ltime = time; self.ltime = time;
if ( ( self.endtime ) && ( time >= self.endtime ) ) if ( ( self.endtime ) && ( time >= self.endtime ) )
{ {
self.endtime = 0; self.endtime = 0;
@ -462,7 +399,6 @@ void() rotate_train_think =
setorigin(self, self.finaldest); setorigin(self, self.finaldest);
self.velocity = '0 0 0'; self.velocity = '0 0 0';
} }
if (self.think1) if (self.think1)
self.think1(); self.think1();
} }
@ -473,14 +409,11 @@ void() rotate_train_think =
timeelapsed = 1; timeelapsed = 1;
setorigin( self, self.dest1 + ( self.dest2 * timeelapsed ) ); setorigin( self, self.dest1 + ( self.dest2 * timeelapsed ) );
} }
self.angles = self.angles + ( self.rotate * t ); self.angles = self.angles + ( self.rotate * t );
self.angles = SUB_NormalizeAngles( self.angles ); self.angles = SUB_NormalizeAngles( self.angles );
RotateTargets(); RotateTargets();
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
}; };
void() rotate_train_use = void() rotate_train_use =
{ {
if (self.think1 != rotate_train_find) if (self.think1 != rotate_train_find)
@ -493,11 +426,9 @@ void() rotate_train_use =
} }
} }
}; };
void() rotate_train_wait = void() rotate_train_wait =
{ {
self.state = STATE_WAIT; self.state = STATE_WAIT;
if ( self.goalentity.noise ) if ( self.goalentity.noise )
{ {
sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM);
@ -518,11 +449,9 @@ void() rotate_train_wait =
self.endtime = self.ltime + self.goalentity.wait; self.endtime = self.ltime + self.goalentity.wait;
self.think1 = rotate_train_next; self.think1 = rotate_train_next;
}; };
void() rotate_train_stop = void() rotate_train_stop =
{ {
self.state = STATE_STOP; self.state = STATE_STOP;
if ( self.goalentity.noise ) if ( self.goalentity.noise )
{ {
sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM);
@ -540,11 +469,9 @@ void() rotate_train_stop =
{ {
self.rotate = '0 0 0'; self.rotate = '0 0 0';
} }
self.dmg = 0; self.dmg = 0;
self.think1 = rotate_train_next; self.think1 = rotate_train_next;
}; };
void() rotate_train_next = void() rotate_train_next =
{ {
local entity targ; local entity targ;
@ -552,25 +479,20 @@ void() rotate_train_next =
local vector vdestdelta; local vector vdestdelta;
local float len, traveltime, div; local float len, traveltime, div;
local string temp; local string temp;
self.state = STATE_NEXT; self.state = STATE_NEXT;
current = self.goalentity; current = self.goalentity;
targ = find (world, targetname, self.path ); targ = find (world, targetname, self.path );
if ( targ.classname != "path_rotate" ) if ( targ.classname != "path_rotate" )
objerror( "Next target is not path_rotate" ); objerror( "Next target is not path_rotate" );
if ( self.goalentity.noise1 ) if ( self.goalentity.noise1 )
{ {
self.noise1 = self.goalentity.noise1; self.noise1 = self.goalentity.noise1;
} }
sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.goalentity = targ; self.goalentity = targ;
self.path = targ.target; self.path = targ.target;
if (!self.path ) if (!self.path )
objerror ("rotate_train_next: no next target"); objerror ("rotate_train_next: no next target");
if ( targ.spawnflags & STOP ) if ( targ.spawnflags & STOP )
{ {
self.think1 = rotate_train_stop; self.think1 = rotate_train_stop;
@ -583,7 +505,6 @@ void() rotate_train_next =
{ {
self.think1 = rotate_train_next; self.think1 = rotate_train_next;
} }
if ( current.event ) if ( current.event )
{ {
// Trigger any events that should happen at the corner. // Trigger any events that should happen at the corner.
@ -594,40 +515,33 @@ void() rotate_train_next =
self.target = temp; self.target = temp;
self.message = string_null; self.message = string_null;
} }
if ( current.spawnflags & ANGLES ) if ( current.spawnflags & ANGLES )
{ {
self.rotate = '0 0 0'; self.rotate = '0 0 0';
self.angles = self.finalangle; self.angles = self.finalangle;
} }
if ( current.spawnflags & ROTATION ) if ( current.spawnflags & ROTATION )
{ {
self.rotate = current.rotate; self.rotate = current.rotate;
} }
if ( current.spawnflags & DAMAGE ) if ( current.spawnflags & DAMAGE )
{ {
self.dmg = current.dmg; self.dmg = current.dmg;
} }
if ( current.spawnflags & SET_DAMAGE ) if ( current.spawnflags & SET_DAMAGE )
{ {
SetDamageOnTargets( current.dmg ); SetDamageOnTargets( current.dmg );
} }
if ( current.speed == -1 ) if ( current.speed == -1 )
{ {
// Warp to the next path_corner // Warp to the next path_corner
setorigin( self, targ.origin ); setorigin( self, targ.origin );
self.endtime = self.ltime + 0.01; self.endtime = self.ltime + 0.01;
SetTargetOrigin(); SetTargetOrigin();
if ( targ.spawnflags & ANGLES ) if ( targ.spawnflags & ANGLES )
{ {
self.angles = targ.angles; self.angles = targ.angles;
} }
self.duration = 1; // 1 / duration self.duration = 1; // 1 / duration
self.cnt = time; // start time self.cnt = time; // start time
self.dest2 = '0 0 0'; // delta self.dest2 = '0 0 0'; // delta
@ -637,13 +551,11 @@ void() rotate_train_next =
else else
{ {
self.state = STATE_MOVE; self.state = STATE_MOVE;
self.finaldest = targ.origin; self.finaldest = targ.origin;
if (self.finaldest == self.origin) if (self.finaldest == self.origin)
{ {
self.velocity = '0 0 0'; self.velocity = '0 0 0';
self.endtime = self.ltime + 0.1; self.endtime = self.ltime + 0.1;
self.duration = 1; // 1 / duration self.duration = 1; // 1 / duration
self.cnt = time; // start time self.cnt = time; // start time
self.dest2 = '0 0 0'; // delta self.dest2 = '0 0 0'; // delta
@ -653,10 +565,8 @@ void() rotate_train_next =
} }
// set destdelta to the vector needed to move // set destdelta to the vector needed to move
vdestdelta = self.finaldest - self.origin; vdestdelta = self.finaldest - self.origin;
// calculate length of vector // calculate length of vector
len = vlen (vdestdelta); len = vlen (vdestdelta);
if ( current.spawnflags & MOVETIME ) if ( current.spawnflags & MOVETIME )
{ {
traveltime = current.speed; traveltime = current.speed;
@ -666,14 +576,11 @@ void() rotate_train_next =
// check if there's a speed change // check if there's a speed change
if (current.speed>0) if (current.speed>0)
self.speed = current.speed; self.speed = current.speed;
if (!self.speed) if (!self.speed)
objerror("No speed is defined!"); objerror("No speed is defined!");
// divide by speed to get time to reach dest // divide by speed to get time to reach dest
traveltime = len / self.speed; traveltime = len / self.speed;
} }
if (traveltime < 0.1) if (traveltime < 0.1)
{ {
self.velocity = '0 0 0'; self.velocity = '0 0 0';
@ -684,52 +591,40 @@ void() rotate_train_next =
} }
return; return;
} }
// qcc won't take vec/float // qcc won't take vec/float
div = 1 / traveltime; div = 1 / traveltime;
if ( targ.spawnflags & ANGLES ) if ( targ.spawnflags & ANGLES )
{ {
self.finalangle = SUB_NormalizeAngles( targ.angles ); self.finalangle = SUB_NormalizeAngles( targ.angles );
self.rotate = ( targ.angles - self.angles ) * div; self.rotate = ( targ.angles - self.angles ) * div;
} }
// set endtime to trigger a think when dest is reached // set endtime to trigger a think when dest is reached
self.endtime = self.ltime + traveltime; self.endtime = self.ltime + traveltime;
// scale the destdelta vector by the time spent traveling to get velocity // scale the destdelta vector by the time spent traveling to get velocity
self.velocity = vdestdelta * div; self.velocity = vdestdelta * div;
self.duration = div; // 1 / duration self.duration = div; // 1 / duration
self.cnt = time; // start time self.cnt = time; // start time
self.dest2 = vdestdelta; // delta self.dest2 = vdestdelta; // delta
self.dest1 = self.origin; // original position self.dest1 = self.origin; // original position
} }
}; };
void() rotate_train_find = void() rotate_train_find =
{ {
local entity targ; local entity targ;
self.state = STATE_FIND; self.state = STATE_FIND;
LinkRotateTargets(); LinkRotateTargets();
// the first target is the point of rotation. // the first target is the point of rotation.
// the second target is the path. // the second target is the path.
targ = find ( world, targetname, self.path); targ = find ( world, targetname, self.path);
if ( targ.classname != "path_rotate" ) if ( targ.classname != "path_rotate" )
objerror( "Next target is not path_rotate" ); objerror( "Next target is not path_rotate" );
// Save the current entity // Save the current entity
self.goalentity = targ; self.goalentity = targ;
if ( targ.spawnflags & ANGLES ) if ( targ.spawnflags & ANGLES )
{ {
self.angles = targ.angles; self.angles = targ.angles;
self.finalangle = SUB_NormalizeAngles( targ.angles ); self.finalangle = SUB_NormalizeAngles( targ.angles );
} }
self.path = targ.target; self.path = targ.target;
setorigin (self, targ.origin ); setorigin (self, targ.origin );
SetTargetOrigin(); SetTargetOrigin();
@ -744,60 +639,49 @@ void() rotate_train_find =
{ {
self.endtime = 0; self.endtime = 0;
} }
self.duration = 1; // 1 / duration self.duration = 1; // 1 / duration
self.cnt = time; // start time self.cnt = time; // start time
self.dest2 = '0 0 0'; // delta self.dest2 = '0 0 0'; // delta
self.dest1 = self.origin; // original position self.dest1 = self.origin; // original position
}; };
/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8)
In path_rotate, set speed to be the new speed of the train after it reaches In path_rotate, set speed to be the new speed of the train after it reaches
the path change. If speed is -1, the train will warp directly to the next the path change. If speed is -1, the train will warp directly to the next
path change after the specified wait time. If MOVETIME is set on the path change after the specified wait time. If MOVETIME is set on the
path_rotate, the train to interprets "speed" as the length of time to path_rotate, the train to interprets "speed" as the length of time to
take moving from one corner to another. take moving from one corner to another.
"noise" contains the name of the sound to play when train stops. "noise" contains the name of the sound to play when train stops.
"noise1" contains the name of the sound to play when train moves. "noise1" contains the name of the sound to play when train moves.
Both "noise" and "noise1" defaults depend upon "sounds" variable and Both "noise" and "noise1" defaults depend upon "sounds" variable and
can be overridden by the "noise" and "noise1" variable in path_rotate. can be overridden by the "noise" and "noise1" variable in path_rotate.
Also in path_rotate, if STOP is set, the train will wait until it is Also in path_rotate, if STOP is set, the train will wait until it is
retriggered before moving on to the next goal. retriggered before moving on to the next goal.
Trains are moving platforms that players can ride. Trains are moving platforms that players can ride.
"path" specifies the first path_rotate and is the starting position. "path" specifies the first path_rotate and is the starting position.
If the train is the target of a button or trigger, it will not begin moving until activated. If the train is the target of a button or trigger, it will not begin moving until activated.
The func_rotate_train entity is the center of rotation of all objects targeted by it. The func_rotate_train entity is the center of rotation of all objects targeted by it.
If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train.
speed default 100 speed default 100
dmg default 0 dmg default 0
sounds sounds
1) ratchet metal 1) ratchet metal
*/ */
void() rotate_train = void() rotate_train =
{ {
objerror ("rotate_train entities should be changed to rotate_object with\nfunc_rotate_train controllers\n"); objerror ("rotate_train entities should be changed to rotate_object with\nfunc_rotate_train controllers\n");
}; };
void() func_rotate_train = void() func_rotate_train =
{ {
if (!self.speed) if (!self.speed)
self.speed = 100; self.speed = 100;
if (!self.target) if (!self.target)
objerror ("rotate_train without a target"); objerror ("rotate_train without a target");
if ( !self.noise ) if ( !self.noise )
{ {
if (self.sounds == 0) if (self.sounds == 0)
{ {
self.noise = ("misc/null.wav"); self.noise = ("misc/null.wav");
} }
if (self.sounds == 1) if (self.sounds == 1)
{ {
self.noise = ("plats/train2.wav"); self.noise = ("plats/train2.wav");
@ -814,19 +698,15 @@ void() func_rotate_train =
self.noise1 = ("plats/train1.wav"); self.noise1 = ("plats/train1.wav");
} }
} }
precache_sound( self.noise ); precache_sound( self.noise );
precache_sound( self.noise1 ); precache_sound( self.noise1 );
self.cnt = 1; self.cnt = 1;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.movetype = MOVETYPE_STEP; self.movetype = MOVETYPE_STEP;
self.use = rotate_train_use; self.use = rotate_train_use;
setmodel (self, self.model); setmodel (self, self.model);
setsize (self, self.mins, self.maxs); setsize (self, self.mins, self.maxs);
setorigin (self, self.origin); setorigin (self, self.origin);
// start trains on the second frame, to make sure their targets have had // start trains on the second frame, to make sure their targets have had
// a chance to spawn // a chance to spawn
self.ltime = time; self.ltime = time;
@ -835,30 +715,23 @@ void() func_rotate_train =
self.think = rotate_train_think; self.think = rotate_train_think;
self.think1 = rotate_train_find; self.think1 = rotate_train_find;
self.state = STATE_FIND; self.state = STATE_FIND;
self.duration = 1; // 1 / duration self.duration = 1; // 1 / duration
self.cnt = 0.1; // start time self.cnt = 0.1; // start time
self.dest2 = '0 0 0'; // delta self.dest2 = '0 0 0'; // delta
self.dest1 = self.origin; // original position self.dest1 = self.origin; // original position
self.flags = self.flags | FL_ONGROUND; self.flags = self.flags | FL_ONGROUND;
}; };
//************************************************ //************************************************
// //
// Moving clip walls // Moving clip walls
// //
//************************************************ //************************************************
void() rotate_door_reversedirection; void() rotate_door_reversedirection;
void() rotate_door_group_reversedirection; void() rotate_door_group_reversedirection;
void() movewall_touch = void() movewall_touch =
{ {
if (time < self.owner.attack_finished) if (time < self.owner.attack_finished)
return; return;
if ( self.dmg ) if ( self.dmg )
{ {
T_Damage (other, self, self.owner, self.dmg); T_Damage (other, self, self.owner, self.dmg);
@ -870,16 +743,12 @@ void() movewall_touch =
self.owner.attack_finished = time + 0.5; self.owner.attack_finished = time + 0.5;
} }
}; };
void() movewall_blocked = void() movewall_blocked =
{ {
local entity temp; local entity temp;
if (time < self.owner.attack_finished) if (time < self.owner.attack_finished)
return; return;
self.owner.attack_finished = time + 0.5; self.owner.attack_finished = time + 0.5;
if ( self.owner.classname == "func_rotate_door" ) if ( self.owner.classname == "func_rotate_door" )
{ {
temp = self; temp = self;
@ -887,7 +756,6 @@ void() movewall_blocked =
rotate_door_group_reversedirection(); rotate_door_group_reversedirection();
self = temp; self = temp;
} }
if ( self.dmg ) if ( self.dmg )
{ {
T_Damage (other, self, self.owner, self.dmg); T_Damage (other, self, self.owner, self.dmg);
@ -899,22 +767,16 @@ void() movewall_blocked =
self.owner.attack_finished = time + 0.5; self.owner.attack_finished = time + 0.5;
} }
}; };
void() movewall_think = void() movewall_think =
{ {
self.ltime = time; self.ltime = time;
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
}; };
/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING /*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING
Used to emulate collision on rotating objects. Used to emulate collision on rotating objects.
VISIBLE causes brush to be displayed. VISIBLE causes brush to be displayed.
TOUCH specifies whether to cause damage when touched by player. TOUCH specifies whether to cause damage when touched by player.
NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set. NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set.
"dmg" specifies the damage to cause when touched or blocked. "dmg" specifies the damage to cause when touched or blocked.
*/ */
void() func_movewall = void() func_movewall =
@ -943,7 +805,6 @@ void() func_movewall =
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
self.ltime = time; self.ltime = time;
}; };
/*QUAKED rotate_object (0 .5 .8) ? /*QUAKED rotate_object (0 .5 .8) ?
This defines an object to be rotated. Used as the target of func_rotate_door. This defines an object to be rotated. Used as the target of func_rotate_door.
*/ */
@ -956,7 +817,6 @@ void() rotate_object =
setsize( self, self.mins, self.maxs ); setsize( self, self.mins, self.maxs );
self.think = SUB_Null; self.think = SUB_Null;
}; };
/* /*
for PAROXYSM - Added 12/30/98 for PAROXYSM - Added 12/30/98
rotate_placeholder rotate_placeholder
@ -964,13 +824,9 @@ Replaces rotate_object with a pre-lit BSP model.
This is a hack so you don't need to use Hipnotic's (Win9x only) bsp and Light utilities. This is a hack so you don't need to use Hipnotic's (Win9x only) bsp and Light utilities.
Essentially the same as rotate_object above except it calls a bsp model instead of Essentially the same as rotate_object above except it calls a bsp model instead of
using a brush defined in the map. using a brush defined in the map.
the_mdl = String that defines the path to the BSP model - "maps/mymodel.bsp" the_mdl = String that defines the path to the BSP model - "maps/mymodel.bsp"
*/ */
.string the_mdl; .string the_mdl;
void() rotate_placeholder = void() rotate_placeholder =
{ {
precache_model(self.the_mdl); precache_model(self.the_mdl);
@ -981,25 +837,19 @@ void() rotate_placeholder =
setsize( self, self.mins, self.maxs ); setsize( self, self.mins, self.maxs );
self.think = SUB_Null; self.think = SUB_Null;
}; };
//************************************************ //************************************************
// //
// Rotating doors // Rotating doors
// //
//************************************************ //************************************************
void() rotate_door_think2 = void() rotate_door_think2 =
{ {
local float t; local float t;
t = time - self.ltime; t = time - self.ltime;
self.ltime = time; self.ltime = time;
// change to alternate textures // change to alternate textures
self.frame = 1 - self.frame; self.frame = 1 - self.frame;
self.angles = self.dest; self.angles = self.dest;
if ( self.state == STATE_OPENING ) if ( self.state == STATE_OPENING )
{ {
self.state = STATE_OPEN; self.state = STATE_OPEN;
@ -1013,20 +863,15 @@ void() rotate_door_think2 =
} }
self.state = STATE_CLOSED; self.state = STATE_CLOSED;
} }
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
self.think = SUB_Null; self.think = SUB_Null;
RotateTargetsFinal(); RotateTargetsFinal();
}; };
void() rotate_door_think = void() rotate_door_think =
{ {
local float t; local float t;
t = time - self.ltime; t = time - self.ltime;
self.ltime = time; self.ltime = time;
if ( time < self.endtime ) if ( time < self.endtime )
{ {
self.angles = self.angles + ( self.rotate * t ); self.angles = self.angles + ( self.rotate * t );
@ -1038,17 +883,13 @@ void() rotate_door_think =
RotateTargets(); RotateTargets();
self.think = rotate_door_think2; self.think = rotate_door_think2;
} }
self.nextthink = time + 0.01; self.nextthink = time + 0.01;
}; };
void() rotate_door_reversedirection = void() rotate_door_reversedirection =
{ {
local vector start; local vector start;
// change to alternate textures // change to alternate textures
self.frame = 1 - self.frame; self.frame = 1 - self.frame;
if ( self.state == STATE_CLOSING ) if ( self.state == STATE_CLOSING )
{ {
start = self.dest1; start = self.dest1;
@ -1061,20 +902,16 @@ void() rotate_door_reversedirection =
self.dest = self.dest1; self.dest = self.dest1;
self.state = STATE_CLOSING; self.state = STATE_CLOSING;
} }
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
self.rotate = ( self.dest - start ) * ( 1 / self.speed ); self.rotate = ( self.dest - start ) * ( 1 / self.speed );
self.think = rotate_door_think; self.think = rotate_door_think;
self.nextthink = time + 0.02; self.nextthink = time + 0.02;
self.endtime = time + self.speed - ( self.endtime - time ); self.endtime = time + self.speed - ( self.endtime - time );
self.ltime = time; self.ltime = time;
}; };
void() rotate_door_group_reversedirection = void() rotate_door_group_reversedirection =
{ {
local string name; local string name;
// tell all associated rotaters to reverse direction // tell all associated rotaters to reverse direction
if ( self.group ) if ( self.group )
{ {
@ -1091,23 +928,18 @@ void() rotate_door_group_reversedirection =
rotate_door_reversedirection(); rotate_door_reversedirection();
} }
}; };
void() rotate_door_use = void() rotate_door_use =
{ {
local vector start; local vector start;
if ( ( self.state != STATE_OPEN ) && ( self.state != STATE_CLOSED ) ) if ( ( self.state != STATE_OPEN ) && ( self.state != STATE_CLOSED ) )
return; return;
if ( !self.cnt ) if ( !self.cnt )
{ {
self.cnt = 1; self.cnt = 1;
LinkRotateTargets(); LinkRotateTargets();
} }
// change to alternate textures // change to alternate textures
self.frame = 1 - self.frame; self.frame = 1 - self.frame;
if ( self.state == STATE_CLOSED ) if ( self.state == STATE_CLOSED )
{ {
start = self.dest1; start = self.dest1;
@ -1120,59 +952,46 @@ void() rotate_door_use =
self.dest = self.dest1; self.dest = self.dest1;
self.state = STATE_CLOSING; self.state = STATE_CLOSING;
} }
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
self.rotate = ( self.dest - start ) * ( 1 / self.speed ); self.rotate = ( self.dest - start ) * ( 1 / self.speed );
self.think = rotate_door_think; self.think = rotate_door_think;
self.nextthink = time + 0.01; self.nextthink = time + 0.01;
self.endtime = time + self.speed; self.endtime = time + self.speed;
self.ltime = time; self.ltime = time;
}; };
/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN /*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN
Creates a door that rotates between two positions around a point of Creates a door that rotates between two positions around a point of
rotation each time it's triggered. rotation each time it's triggered.
STAYOPEN tells the door to reopen after closing. This prevents a trigger- STAYOPEN tells the door to reopen after closing. This prevents a trigger-
once door from closing again when it's blocked. once door from closing again when it's blocked.
"dmg" specifies the damage to cause when blocked. Defaults to 2. Negative numbers indicate no damage. "dmg" specifies the damage to cause when blocked. Defaults to 2. Negative numbers indicate no damage.
"speed" specifies how the time it takes to rotate "speed" specifies how the time it takes to rotate
"sounds" "sounds"
1) medieval (default) 1) medieval (default)
2) metal 2) metal
3) base 3) base
*/ */
void() func_rotate_door = void() func_rotate_door =
{ {
if (!self.target) if (!self.target)
{ {
objerror( "rotate_door without target." ); objerror( "rotate_door without target." );
} }
self.dest1 = '0 0 0'; self.dest1 = '0 0 0';
self.dest2 = self.angles; self.dest2 = self.angles;
self.angles = self.dest1; self.angles = self.dest1;
// default to 2 seconds // default to 2 seconds
if ( !self.speed ) if ( !self.speed )
{ {
self.speed = 2; self.speed = 2;
} }
self.cnt = 0; self.cnt = 0;
if (!self.dmg) if (!self.dmg)
self.dmg = 2; self.dmg = 2;
else if ( self.dmg < 0 ) else if ( self.dmg < 0 )
{ {
self.dmg = 0; self.dmg = 0;
} }
if (self.sounds == 0) if (self.sounds == 0)
self.sounds = 1; self.sounds = 1;
if (self.sounds == 1) if (self.sounds == 1)
@ -1200,7 +1019,6 @@ void() func_rotate_door =
self.noise1 = "doors/basesec2.wav"; self.noise1 = "doors/basesec2.wav";
self.noise3 = "doors/basesec2.wav"; self.noise3 = "doors/basesec2.wav";
} }
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
setmodel (self, self.model); setmodel (self, self.model);

View file

@ -1,12 +1,9 @@
// POX - had to make room for Paroxysm's DM modes...... // POX - had to make room for Paroxysm's DM modes......
void() W_SetCurrentAmmo; void() W_SetCurrentAmmo;
/* ALL LIGHTS SHOULD BE 0 1 0 IN COLOR ALL OTHER ITEMS SHOULD /* ALL LIGHTS SHOULD BE 0 1 0 IN COLOR ALL OTHER ITEMS SHOULD
BE .8 .3 .4 IN COLOR */ BE .8 .3 .4 IN COLOR */
.entity quadcore; // + POX - used by the dual model quad .entity quadcore; // + POX - used by the dual model quad
void() SUB_regen = void() SUB_regen =
{ {
self.model = self.mdl; // restore original model self.model = self.mdl; // restore original model
@ -22,9 +19,6 @@ void() SUB_regen =
} }
// - POX // - POX
}; };
/*QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8) /*QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8)
prints a warning message when spawned prints a warning message when spawned
*/ */
@ -35,20 +29,15 @@ void() noclass =
dprint ("\n"); dprint ("\n");
remove (self); remove (self);
}; };
void() q_touch; void() q_touch;
void() q_touch = void() q_touch =
{ {
local string s; local string s;
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
self.mdl = self.model; self.mdl = self.model;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
@ -60,13 +49,10 @@ local string s;
// other.armorvalue = 0 * 0.01; // other.armorvalue = 0 * 0.01;
// other.ammo_cells = 0; // other.ammo_cells = 0;
//} //}
// do the apropriate action // do the apropriate action
other.super_time = 1; other.super_time = 1;
other.super_damage_finished = self.cnt; other.super_damage_finished = self.cnt;
s=ftos(rint(other.super_damage_finished - time)); s=ftos(rint(other.super_damage_finished - time));
bprint (PRINT_LOW, other.netname); bprint (PRINT_LOW, other.netname);
//if (deathmatch == 4) //if (deathmatch == 4)
// bprint (PRINT_LOW, " recovered an OctaPower with "); // bprint (PRINT_LOW, " recovered an OctaPower with ");
@ -74,16 +60,12 @@ local string s;
bprint (PRINT_LOW, " recovered a Quad with "); bprint (PRINT_LOW, " recovered a Quad with ");
bprint (PRINT_LOW, s); bprint (PRINT_LOW, s);
bprint (PRINT_LOW, " seconds remaining!\n"); bprint (PRINT_LOW, " seconds remaining!\n");
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
void(float timeleft) DropQuad = void(float timeleft) DropQuad =
{ {
local entity item; local entity item;
item = spawn(); item = spawn();
item.origin = self.origin; item.origin = self.origin;
@ -102,27 +84,20 @@ void(float timeleft) DropQuad =
item.nextthink = time + timeleft; // remove it with the time left on it item.nextthink = time + timeleft; // remove it with the time left on it
item.think = SUB_Remove; item.think = SUB_Remove;
}; };
void() r_touch; void() r_touch;
void() r_touch = void() r_touch =
{ {
local string s; local string s;
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
self.mdl = self.model; self.mdl = self.model;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
other.items = other.items | IT_INVISIBILITY; other.items = other.items | IT_INVISIBILITY;
self.model = string_null; self.model = string_null;
// do the apropriate action // do the apropriate action
other.invisible_time = 1; other.invisible_time = 1;
other.invisible_finished = self.cnt; other.invisible_finished = self.cnt;
@ -132,16 +107,12 @@ local string s;
bprint (PRINT_LOW, s); bprint (PRINT_LOW, s);
bprint (PRINT_LOW, " seconds remaining!\n"); bprint (PRINT_LOW, " seconds remaining!\n");
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
void(float timeleft) DropRing = void(float timeleft) DropRing =
{ {
local entity item; local entity item;
item = spawn(); item = spawn();
item.origin = self.origin; item.origin = self.origin;
@ -160,18 +131,15 @@ void(float timeleft) DropRing =
item.nextthink = time + timeleft; // remove after 30 seconds item.nextthink = time + timeleft; // remove after 30 seconds
item.think = SUB_Remove; item.think = SUB_Remove;
}; };
/* /*
============ ============
PlaceItem PlaceItem
plants the object on the floor plants the object on the floor
============ ============
*/ */
void() PlaceItem = void() PlaceItem =
{ {
local float oldz; local float oldz;
self.mdl = self.model; // so it can be restored on respawn self.mdl = self.model; // so it can be restored on respawn
self.flags = FL_ITEM; // make extra wide self.flags = FL_ITEM; // make extra wide
self.solid = SOLID_TRIGGER; self.solid = SOLID_TRIGGER;
@ -188,11 +156,9 @@ void() PlaceItem =
return; return;
} }
}; };
/* /*
============ ============
StartItem StartItem
Sets the clipping size and plants the object on the floor Sets the clipping size and plants the object on the floor
============ ============
*/ */
@ -201,12 +167,9 @@ void() StartItem =
self.nextthink = time + 0.2; // items start after other solids self.nextthink = time + 0.2; // items start after other solids
self.think = PlaceItem; self.think = PlaceItem;
}; };
/* /*
========================================================================= =========================================================================
HEALTH BOX HEALTH BOX
========================================================================= =========================================================================
*/ */
// //
@ -220,7 +183,6 @@ float (entity e, float healamount, float ignore) T_Heal =
if ((!ignore) && (e.health >= other.max_health)) if ((!ignore) && (e.health >= other.max_health))
return 0; return 0;
healamount = ceil(healamount); healamount = ceil(healamount);
e.health = e.health + healamount; e.health = e.health + healamount;
if ((!ignore) && (e.health >= other.max_health)) if ((!ignore) && (e.health >= other.max_health))
e.health = other.max_health; e.health = other.max_health;
@ -229,7 +191,6 @@ float (entity e, float healamount, float ignore) T_Heal =
e.health = 250; e.health = 250;
return 1; return 1;
}; };
/*QUAKED item_health (.3 .3 1) (0 0 0) (32 32 32) rotten megahealth /*QUAKED item_health (.3 .3 1) (0 0 0) (32 32 32) rotten megahealth
Health box. Normally gives 25 points. Health box. Normally gives 25 points.
Rotten box heals 5-10 points, Rotten box heals 5-10 points,
@ -237,13 +198,11 @@ megahealth will add 100 health, then
rot you down to your maximum health limit, rot you down to your maximum health limit,
one point per second. one point per second.
*/ */
float H_ROTTEN = 1; float H_ROTTEN = 1;
float H_MEGA = 2; float H_MEGA = 2;
.float healamount, healtype; .float healamount, healtype;
void() health_touch; void() health_touch;
void() item_megahealth_rot; void() item_megahealth_rot;
void() item_health = void() item_health =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -254,11 +213,9 @@ void() item_health =
} }
self.touch = health_touch; self.touch = health_touch;
if (self.spawnflags & H_ROTTEN) if (self.spawnflags & H_ROTTEN)
{ {
precache_model("maps/b_bh10.bsp"); precache_model("maps/b_bh10.bsp");
precache_sound("items/health1.wav"); precache_sound("items/health1.wav");
setmodel(self, "maps/b_bh10.bsp"); setmodel(self, "maps/b_bh10.bsp");
self.noise = "items/health1.wav"; self.noise = "items/health1.wav";
@ -287,8 +244,6 @@ void() item_health =
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
void() health_touch = void() health_touch =
{ {
local string s; local string s;
@ -296,7 +251,6 @@ void() health_touch =
//if (deathmatch == 4) //if (deathmatch == 4)
// if (other.invincible_time > 0) // if (other.invincible_time > 0)
// return; // return;
if (other.classname != "player") if (other.classname != "player")
return; return;
@ -320,12 +274,10 @@ void() health_touch =
// health touch sound // health touch sound
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.model = string_null; self.model = string_null;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
// Megahealth = rot down the player's super health // Megahealth = rot down the player's super health
if (self.healtype == 2) if (self.healtype == 2)
{ {
@ -349,7 +301,6 @@ void() health_touch =
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
void() item_megahealth_rot = void() item_megahealth_rot =
{ {
other = self.owner; other = self.owner;
@ -360,7 +311,6 @@ void() item_megahealth_rot =
self.nextthink = time + 1; self.nextthink = time + 1;
return; return;
} }
// it is possible for a player to die and respawn between rots, so don't // it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off // just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH); other.items = other.items - (other.items & IT_SUPERHEALTH);
@ -371,19 +321,14 @@ void() item_megahealth_rot =
self.think = SUB_regen; self.think = SUB_regen;
//} //}
}; };
/* + POX - see sheilds.qc /* + POX - see sheilds.qc
//ARMOR //ARMOR
/* - POX /* - POX
/* /*
=============================================================================== ===============================================================================
WEAPONS WEAPONS
=============================================================================== ===============================================================================
*/ */
void() bound_other_ammo = void() bound_other_ammo =
{ {
if (other.ammo_shells > 100) if (other.ammo_shells > 100)
@ -396,8 +341,6 @@ void() bound_other_ammo =
if (other.ammo_cells > 200) if (other.ammo_cells > 200)
other.ammo_cells = 200; other.ammo_cells = 200;
}; };
float(float w) RankForWeapon = float(float w) RankForWeapon =
{ {
if (w == IT_LIGHTNING) if (w == IT_LIGHTNING)
@ -414,7 +357,6 @@ float(float w) RankForWeapon =
return 6; return 6;
return 7; return 7;
}; };
float (float w) WeaponCode = float (float w) WeaponCode =
{ {
if (w == IT_COMBOGUN) if (w == IT_COMBOGUN)
@ -431,46 +373,37 @@ float (float w) WeaponCode =
return 8; return 8;
return 1; return 1;
}; };
/* /*
============= =============
Deathmatch_Weapon Deathmatch_Weapon
Deathmatch weapon change rules for picking up a weapon Deathmatch weapon change rules for picking up a weapon
.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
============= =============
*/ */
void(float old, float new) Deathmatch_Weapon = void(float old, float new) Deathmatch_Weapon =
{ {
local float or, nr; local float or, nr;
// change self.weapon if desired // change self.weapon if desired
or = RankForWeapon (self.weapon); or = RankForWeapon (self.weapon);
nr = RankForWeapon (new); nr = RankForWeapon (new);
if ( nr < or ) if ( nr < or )
self.weapon = new; self.weapon = new;
}; };
/* /*
============= =============
weapon_touch weapon_touch
============= =============
*/ */
float() W_BestWeapon; float() W_BestWeapon;
void() weapon_touch = void() weapon_touch =
{ {
local float hadammo, best, new = 0, old; local float hadammo, best, new = 0, old;
local entity stemp; local entity stemp;
//local float leave; //local float leave;
// For client weapon_switch // For client weapon_switch
local float w_switch; local float w_switch;
if (!(other.flags & FL_CLIENT)) if (!(other.flags & FL_CLIENT))
return; return;
if ((stof(infokey(other,"w_switch"))) == 0) if ((stof(infokey(other,"w_switch"))) == 0)
w_switch = 8; w_switch = 8;
else else
@ -481,13 +414,11 @@ void() weapon_touch =
self = other; self = other;
best = W_BestWeapon(); best = W_BestWeapon();
self = stemp; self = stemp;
// POX - leave is useless in POX since weapons are never allowed to be picked up if posessed // POX - leave is useless in POX since weapons are never allowed to be picked up if posessed
//if (deathmatch == 2 || deathmatch == 3 || deathmatch == 5) //if (deathmatch == 2 || deathmatch == 3 || deathmatch == 5)
// leave = 1; // leave = 1;
//else //else
// leave = 0; // leave = 0;
// POX - Don't bother checking if weapon is in inventory // POX - Don't bother checking if weapon is in inventory
if (other.items & self.weapon) if (other.items & self.weapon)
{ {
@ -495,9 +426,7 @@ void() weapon_touch =
SUB_UseTargets(); //Just in case it's required to get out of somewhere SUB_UseTargets(); //Just in case it's required to get out of somewhere
return; return;
} }
// POX- changed classnames to constants // POX- changed classnames to constants
if (self.weapon == IT_PLASMAGUN) if (self.weapon == IT_PLASMAGUN)
{ {
hadammo = other.ammo_rockets; hadammo = other.ammo_rockets;
@ -532,23 +461,19 @@ void() weapon_touch =
} }
else else
objerror ("weapon_touch: unknown classname"); objerror ("weapon_touch: unknown classname");
sprint (other, PRINT_LOW, "You got the "); sprint (other, PRINT_LOW, "You got the ");
sprint (other, PRINT_LOW, self.netname); sprint (other, PRINT_LOW, self.netname);
sprint (other, PRINT_LOW, "\n"); sprint (other, PRINT_LOW, "\n");
// weapon touch sound // weapon touch sound
sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
bound_other_ammo (); bound_other_ammo ();
// change to the weapon // change to the weapon
old = other.items; old = other.items;
other.items = other.items | new; other.items = other.items | new;
stemp = self; stemp = self;
self = other; self = other;
//POX - check for autoswitch //POX - check for autoswitch
if (deathmatch & DM_AUTOSWITCH) if (deathmatch & DM_AUTOSWITCH)
{ {
@ -569,14 +494,10 @@ void() weapon_touch =
} }
else else
self.weapon = new; self.weapon = new;
W_SetCurrentAmmo(); W_SetCurrentAmmo();
self = stemp; self = stemp;
//if (leave) //if (leave)
// return; // return;
//if (deathmatch!=3 || deathmatch !=5) //if (deathmatch!=3 || deathmatch !=5)
//{ //{
// remove it in single player, or setup for respawning in deathmatch // remove it in single player, or setup for respawning in deathmatch
@ -589,12 +510,9 @@ void() weapon_touch =
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
// + POX - models/netnames changed // + POX - models/netnames changed
/*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) /*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/ */
void() weapon_supershotgun = void() weapon_supershotgun =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -612,10 +530,8 @@ void() weapon_supershotgun =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
/*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/ */
void() weapon_nailgun = void() weapon_nailgun =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -633,10 +549,8 @@ void() weapon_nailgun =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
/*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/ */
void() weapon_supernailgun = void() weapon_supernailgun =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -654,10 +568,8 @@ void() weapon_supernailgun =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
/*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32)
*/ */
void() weapon_grenadelauncher = void() weapon_grenadelauncher =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -675,10 +587,8 @@ void() weapon_grenadelauncher =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
/*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32)
*/ */
void() weapon_rocketlauncher = void() weapon_rocketlauncher =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -696,10 +606,7 @@ void() weapon_rocketlauncher =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
// + POX - PlasmaGun also replaces Thunderbolt in existing levels // + POX - PlasmaGun also replaces Thunderbolt in existing levels
void() weapon_lightning = void() weapon_lightning =
{ {
// + POX - no items in FFA mode // + POX - no items in FFA mode
@ -717,34 +624,24 @@ void() weapon_lightning =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
StartItem (); StartItem ();
}; };
/* /*
=============================================================================== ===============================================================================
AMMO AMMO
=============================================================================== ===============================================================================
*/ */
void() ammo_touch = void() ammo_touch =
{ {
local entity stemp; local entity stemp;
local float best; local float best;
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
// if the player was using his best weapon, change up to the new one if better // if the player was using his best weapon, change up to the new one if better
stemp = self; stemp = self;
self = other; self = other;
best = W_BestWeapon(); best = W_BestWeapon();
self = stemp; self = stemp;
// shotgun // shotgun
if (self.weapon == 1) if (self.weapon == 1)
{ {
@ -754,7 +651,6 @@ local float best;
//+ POX - switch ammo to shells for ComboGun //+ POX - switch ammo to shells for ComboGun
other.which_ammo = 0; other.which_ammo = 0;
} }
// spikes // spikes
if (self.weapon == 2) if (self.weapon == 2)
{ {
@ -762,7 +658,6 @@ local float best;
return; return;
other.ammo_nails = other.ammo_nails + self.aflag; other.ammo_nails = other.ammo_nails + self.aflag;
} }
// rockets // rockets
if (self.weapon == 3) if (self.weapon == 3)
{ {
@ -770,7 +665,6 @@ local float best;
return; return;
other.ammo_rockets = other.ammo_rockets + self.aflag; other.ammo_rockets = other.ammo_rockets + self.aflag;
} }
// cells // cells
if (self.weapon == 4) if (self.weapon == 4)
{ {
@ -779,7 +673,6 @@ local float best;
return; return;
other.ammo_cells = other.ammo_cells + self.aflag; other.ammo_cells = other.ammo_cells + self.aflag;
} }
bound_other_ammo (); bound_other_ammo ();
sprint (other, PRINT_LOW, "You got the "); sprint (other, PRINT_LOW, "You got the ");
@ -788,7 +681,6 @@ local float best;
// ammo touch sound // ammo touch sound
sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
// change to a better weapon if appropriate // change to a better weapon if appropriate
if (deathmatch & DM_AUTOSWITCH) if (deathmatch & DM_AUTOSWITCH)
{ {
@ -801,38 +693,26 @@ if (deathmatch & DM_AUTOSWITCH)
self = stemp; self = stemp;
} }
} }
// if changed current ammo, update it // if changed current ammo, update it
stemp = self; stemp = self;
self = other; self = other;
W_SetCurrentAmmo(); W_SetCurrentAmmo();
self = stemp; self = stemp;
// remove it in single player, or setup for respawning in deathmatch // remove it in single player, or setup for respawning in deathmatch
self.model = string_null; self.model = string_null;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
//if (deathmatch != 2) //if (deathmatch != 2)
self.nextthink = time + 30; self.nextthink = time + 30;
// Xian -- If playing in DM 3.0 mode, halve the time ammo respawns // Xian -- If playing in DM 3.0 mode, halve the time ammo respawns
// if (deathmatch == 3 || deathmatch == 5) // if (deathmatch == 3 || deathmatch == 5)
// self.nextthink = time + 15; // self.nextthink = time + 15;
self.think = SUB_regen; self.think = SUB_regen;
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
float WEAPON_BIG2 = 1; float WEAPON_BIG2 = 1;
/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) big /*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) big
*/ */
void() item_shells = void() item_shells =
{ {
//if (deathmatch == 4) //if (deathmatch == 4)
@ -846,7 +726,6 @@ void() item_shells =
} }
self.touch = ammo_touch; self.touch = ammo_touch;
if (self.spawnflags & WEAPON_BIG2) if (self.spawnflags & WEAPON_BIG2)
{ {
precache_model ("maps/bspmdls/b_shell1.bsp"); precache_model ("maps/bspmdls/b_shell1.bsp");
@ -864,10 +743,8 @@ void() item_shells =
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big /*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big
*/ */
void() item_spikes = void() item_spikes =
{ {
//if (deathmatch == 4) //if (deathmatch == 4)
@ -879,9 +756,7 @@ void() item_spikes =
remove(self); remove(self);
return; return;
} }
self.touch = ammo_touch; self.touch = ammo_touch;
if (self.spawnflags & WEAPON_BIG2) if (self.spawnflags & WEAPON_BIG2)
{ {
precache_model ("maps/bspmdls/b_nail1.bsp"); precache_model ("maps/bspmdls/b_nail1.bsp");
@ -898,12 +773,9 @@ void() item_spikes =
self.netname = "nails"; self.netname = "nails";
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big /*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big
*/ */
void() item_rockets = void() item_rockets =
{ {
//if (deathmatch == 4) //if (deathmatch == 4)
@ -915,9 +787,7 @@ void() item_rockets =
remove(self); remove(self);
return; return;
} }
self.touch = ammo_touch; self.touch = ammo_touch;
if (self.spawnflags & WEAPON_BIG2) if (self.spawnflags & WEAPON_BIG2)
{ {
precache_model ("maps/bspmdls/b_rock1.bsp"); precache_model ("maps/bspmdls/b_rock1.bsp");
@ -934,13 +804,9 @@ void() item_rockets =
self.netname = "rockets"; self.netname = "rockets";
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big /*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big
*/ */
void() item_cells = void() item_cells =
{ {
//if (deathmatch == 4) //if (deathmatch == 4)
@ -952,9 +818,7 @@ void() item_cells =
remove(self); remove(self);
return; return;
} }
self.touch = ammo_touch; self.touch = ammo_touch;
if (self.spawnflags & WEAPON_BIG2) if (self.spawnflags & WEAPON_BIG2)
{ {
precache_model ("maps/bspmdls/b_batt1.bsp"); precache_model ("maps/bspmdls/b_batt1.bsp");
@ -971,14 +835,10 @@ void() item_cells =
self.netname = "cells"; self.netname = "cells";
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
/*QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big /*QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big
DO NOT USE THIS!!!! IT WILL BE REMOVED! DO NOT USE THIS!!!! IT WILL BE REMOVED!
*/ */
float WEAPON_SHOTGUN = 1; float WEAPON_SHOTGUN = 1;
float WEAPON_ROCKET = 2; float WEAPON_ROCKET = 2;
float WEAPON_SPIKES = 4; float WEAPON_SPIKES = 4;
@ -993,7 +853,6 @@ void() item_weapon =
} }
self.touch = ammo_touch; self.touch = ammo_touch;
if (self.spawnflags & WEAPON_SHOTGUN) if (self.spawnflags & WEAPON_SHOTGUN)
{ {
if (self.spawnflags & WEAPON_BIG) if (self.spawnflags & WEAPON_BIG)
@ -1011,7 +870,6 @@ void() item_weapon =
self.weapon = 1; self.weapon = 1;
self.netname = "shells"; self.netname = "shells";
} }
if (self.spawnflags & WEAPON_SPIKES) if (self.spawnflags & WEAPON_SPIKES)
{ {
if (self.spawnflags & WEAPON_BIG) if (self.spawnflags & WEAPON_BIG)
@ -1029,7 +887,6 @@ void() item_weapon =
self.weapon = 2; self.weapon = 2;
self.netname = "spikes"; self.netname = "spikes";
} }
if (self.spawnflags & WEAPON_ROCKET) if (self.spawnflags & WEAPON_ROCKET)
{ {
if (self.spawnflags & WEAPON_BIG) if (self.spawnflags & WEAPON_BIG)
@ -1051,16 +908,11 @@ void() item_weapon =
setsize (self, '0 0 0', '32 32 56'); setsize (self, '0 0 0', '32 32 56');
StartItem (); StartItem ();
}; };
/* /*
=============================================================================== ===============================================================================
KEYS KEYS
=============================================================================== ===============================================================================
*/ */
void() key_touch = void() key_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
@ -1069,23 +921,17 @@ void() key_touch =
return; return;
if (other.items & self.items) if (other.items & self.items)
return; return;
sprint (other, PRINT_LOW, "You got the "); sprint (other, PRINT_LOW, "You got the ");
sprint (other, PRINT_LOW, self.netname); sprint (other, PRINT_LOW, self.netname);
sprint (other,PRINT_LOW, "\n"); sprint (other,PRINT_LOW, "\n");
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
other.items = other.items | self.items; other.items = other.items | self.items;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.model = string_null; self.model = string_null;
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
void() key_setsounds = void() key_setsounds =
{ {
if (world.worldtype == 0) if (world.worldtype == 0)
@ -1104,7 +950,6 @@ void() key_setsounds =
self.noise = "misc/basekey.wav"; self.noise = "misc/basekey.wav";
} }
}; };
/*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32)
SILVER key SILVER key
In order for keys to work In order for keys to work
@ -1115,7 +960,6 @@ following:
1: metal 1: metal
2: base 2: base
*/ */
void() item_key1 = void() item_key1 =
{ {
if (world.worldtype == 0) if (world.worldtype == 0)
@ -1142,7 +986,6 @@ void() item_key1 =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
/*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32)
GOLD key GOLD key
In order for keys to work In order for keys to work
@ -1153,7 +996,6 @@ following:
1: metal 1: metal
2: base 2: base
*/ */
void() item_key2 = void() item_key2 =
{ {
if (world.worldtype == 0) if (world.worldtype == 0)
@ -1180,17 +1022,11 @@ void() item_key2 =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
/* /*
=============================================================================== ===============================================================================
END OF LEVEL RUNES END OF LEVEL RUNES
=============================================================================== ===============================================================================
*/ */
void() sigil_touch = void() sigil_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
@ -1201,7 +1037,6 @@ void() sigil_touch =
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
centerprint (other, "You got the rune!"); centerprint (other, "You got the rune!");
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
@ -1212,20 +1047,15 @@ void() sigil_touch =
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
/*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4 /*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4
End of level sigil, pick up to end episode and return to jrstart. End of level sigil, pick up to end episode and return to jrstart.
*/ */
void() item_sigil = void() item_sigil =
{ {
if (!self.spawnflags) if (!self.spawnflags)
objerror ("no spawnflags"); objerror ("no spawnflags");
precache_sound ("misc/runekey.wav"); precache_sound ("misc/runekey.wav");
self.noise = "misc/runekey.wav"; self.noise = "misc/runekey.wav";
if (self.spawnflags & 1) if (self.spawnflags & 1)
{ {
precache_model ("progs/end1.mdl"); precache_model ("progs/end1.mdl");
@ -1251,29 +1081,21 @@ void() item_sigil =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
/* /*
=============================================================================== ===============================================================================
POWERUPS POWERUPS
=============================================================================== ===============================================================================
*/ */
void() powerup_touch; void() powerup_touch;
void() powerup_touch = void() powerup_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
sprint (other, PRINT_LOW, "You got the "); sprint (other, PRINT_LOW, "You got the ");
sprint (other,PRINT_LOW, self.netname); sprint (other,PRINT_LOW, self.netname);
sprint (other,PRINT_LOW, "\n"); sprint (other,PRINT_LOW, "\n");
self.mdl = self.model; self.mdl = self.model;
if ((self.classname == "item_artifact_invulnerability") || if ((self.classname == "item_artifact_invulnerability") ||
@ -1283,13 +1105,11 @@ void() powerup_touch =
self.nextthink = time + 60; self.nextthink = time + 60;
self.think = SUB_regen; self.think = SUB_regen;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
other.items = other.items | self.items; other.items = other.items | self.items;
self.model = string_null; self.model = string_null;
// do the apropriate action // do the apropriate action
if (self.classname == "item_artifact_envirosuit") if (self.classname == "item_artifact_envirosuit")
{ {
@ -1308,7 +1128,6 @@ void() powerup_touch =
other.invisible_time = 1; other.invisible_time = 1;
other.invisible_finished = time + 30; other.invisible_finished = time + 30;
} }
if (self.classname == "item_artifact_super_damage") if (self.classname == "item_artifact_super_damage")
{ {
self.quadcore.mdl = self.quadcore.model; self.quadcore.mdl = self.quadcore.model;
@ -1317,20 +1136,16 @@ void() powerup_touch =
other.super_time = 1; other.super_time = 1;
other.super_damage_finished = time + 30; other.super_damage_finished = time + 30;
} }
activator = other; activator = other;
SUB_UseTargets(); // fire all targets / killtargets SUB_UseTargets(); // fire all targets / killtargets
}; };
//POX - just changed the look of these (and some respawn times) //POX - just changed the look of these (and some respawn times)
/*QUAKED item_artifact_invulnerability (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_artifact_invulnerability (0 .5 .8) (-16 -16 -24) (16 16 32)
Player is invulnerable for 30 seconds Player is invulnerable for 30 seconds
*/ */
void() item_artifact_invulnerability = void() item_artifact_invulnerability =
{ {
self.touch = powerup_touch; self.touch = powerup_touch;
precache_model ("progs/poxmegs.mdl"); precache_model ("progs/poxmegs.mdl");
precache_sound ("items/protect.wav"); precache_sound ("items/protect.wav");
precache_sound ("items/protect2.wav"); precache_sound ("items/protect2.wav");
@ -1343,14 +1158,12 @@ void() item_artifact_invulnerability =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
/*QUAKED item_artifact_envirosuit (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_artifact_envirosuit (0 .5 .8) (-16 -16 -24) (16 16 32)
Player takes no damage from water or slime for 30 seconds Player takes no damage from water or slime for 30 seconds
*/ */
void() item_artifact_envirosuit = void() item_artifact_envirosuit =
{ {
self.touch = powerup_touch; self.touch = powerup_touch;
precache_model ("progs/suit.mdl"); precache_model ("progs/suit.mdl");
precache_sound ("items/suit.wav"); precache_sound ("items/suit.wav");
precache_sound ("items/suit2.wav"); precache_sound ("items/suit2.wav");
@ -1361,8 +1174,6 @@ void() item_artifact_envirosuit =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
/*QUAKED item_artifact_invisibility (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_artifact_invisibility (0 .5 .8) (-16 -16 -24) (16 16 32)
Player is invisible for 30 seconds Player is invisible for 30 seconds
*/ */
@ -1373,7 +1184,6 @@ void() item_artifact_invisibility =
remove(self); remove(self);
self.touch = powerup_touch; self.touch = powerup_touch;
precache_model ("progs/cloak.mdl"); precache_model ("progs/cloak.mdl");
precache_sound ("items/inv1.wav"); precache_sound ("items/inv1.wav");
precache_sound ("items/inv2.wav"); precache_sound ("items/inv2.wav");
@ -1385,7 +1195,6 @@ void() item_artifact_invisibility =
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
}; };
//POX - A little hack to get a multi-model item for a cool effect //POX - A little hack to get a multi-model item for a cool effect
void() Spawn_QuadCore = void() Spawn_QuadCore =
{ {
@ -1408,14 +1217,12 @@ void() Spawn_QuadCore =
qcore.nextthink = time + 999999999; qcore.nextthink = time + 999999999;
qcore.think = SUB_Null; qcore.think = SUB_Null;
}; };
/*QUAKED item_artifact_super_damage (0 .5 .8) (-16 -16 -24) (16 16 32) /*QUAKED item_artifact_super_damage (0 .5 .8) (-16 -16 -24) (16 16 32)
The next attack from the player will do 4x damage The next attack from the player will do 4x damage
*/ */
void() item_artifact_super_damage = void() item_artifact_super_damage =
{ {
self.touch = powerup_touch; self.touch = powerup_touch;
precache_model ("progs/poxquad.mdl"); precache_model ("progs/poxquad.mdl");
precache_model ("progs/poxquad2.mdl"); precache_model ("progs/poxquad2.mdl");
@ -1434,17 +1241,11 @@ void() item_artifact_super_damage =
StartItem (); StartItem ();
}; };
/* /*
=============================================================================== ===============================================================================
PLAYER BACKPACKS PLAYER BACKPACKS
=============================================================================== ===============================================================================
*/ */
void() BackpackTouch = void() BackpackTouch =
{ {
local string s; local string s;
@ -1452,17 +1253,14 @@ void() BackpackTouch =
local entity stemp; local entity stemp;
local float acount; local float acount;
local float b_switch; local float b_switch;
//if (deathmatch == 4) //if (deathmatch == 4)
// if (other.invincible_time > 0) // if (other.invincible_time > 0)
// return; // return;
if ((stof(infokey(other,"b_switch"))) == 0) if ((stof(infokey(other,"b_switch"))) == 0)
b_switch = 8; b_switch = 8;
else else
b_switch = stof(infokey(other,"b_switch")); b_switch = stof(infokey(other,"b_switch"));
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
@ -1482,7 +1280,6 @@ void() BackpackTouch =
sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
remove(self); remove(self);
if (other.health >299) if (other.health >299)
{ {
if (other.invincible_time != 1) if (other.invincible_time != 1)
@ -1494,7 +1291,6 @@ void() BackpackTouch =
other.super_time = 1; other.super_time = 1;
other.super_damage_finished = time + 30; other.super_damage_finished = time + 30;
other.items = other.items | IT_QUAD; other.items = other.items | IT_QUAD;
other.ammo_cells = 0; other.ammo_cells = 0;
@ -1521,13 +1317,11 @@ void() BackpackTouch =
self = other; self = other;
best = W_BestWeapon(); best = W_BestWeapon();
self = stemp; self = stemp;
// change weapons // change weapons
other.ammo_shells = other.ammo_shells + self.ammo_shells; other.ammo_shells = other.ammo_shells + self.ammo_shells;
other.ammo_nails = other.ammo_nails + self.ammo_nails; other.ammo_nails = other.ammo_nails + self.ammo_nails;
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells; other.ammo_cells = other.ammo_cells + self.ammo_cells;
new = self.items; new = self.items;
if (!new) if (!new)
new = other.weapon; new = other.weapon;
@ -1535,7 +1329,6 @@ void() BackpackTouch =
other.items = other.items | self.items; other.items = other.items | self.items;
bound_other_ammo (); bound_other_ammo ();
if (self.ammo_shells) if (self.ammo_shells)
{ {
if (acount) if (acount)
@ -1597,7 +1390,6 @@ void() BackpackTouch =
// backpack touch sound // backpack touch sound
sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
remove(self); remove(self);
self = other; self = other;
@ -1623,7 +1415,6 @@ if (deathmatch & DM_AUTOSWITCH)
} }
W_SetCurrentAmmo (); W_SetCurrentAmmo ();
}; };
/* /*
=============== ===============
DropBackpack DropBackpack
@ -1636,7 +1427,6 @@ void() DropBackpack =
// + POX - DM_FFA check // + POX - DM_FFA check
if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells) && !(deathmatch & DM_FFA)) if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells) && !(deathmatch & DM_FFA))
return; // nothing in it return; // nothing in it
item = spawn(); item = spawn();
item.origin = self.origin - '0 0 24'; item.origin = self.origin - '0 0 24';
@ -1666,7 +1456,6 @@ void() DropBackpack =
item.healamount = 25; item.healamount = 25;
item.healtype = 1; item.healtype = 1;
} }
item.ammo_shells = self.ammo_shells; item.ammo_shells = self.ammo_shells;
item.ammo_nails = self.ammo_nails; item.ammo_nails = self.ammo_nails;
item.ammo_rockets = self.ammo_rockets; item.ammo_rockets = self.ammo_rockets;
@ -1674,7 +1463,6 @@ void() DropBackpack =
// + POX - round rockets up to nearest integer incase someone died in between rhino barrel fires // + POX - round rockets up to nearest integer incase someone died in between rhino barrel fires
item.ammo_rockets = rint(item.ammo_rockets); item.ammo_rockets = rint(item.ammo_rockets);
item.ammo_cells = self.ammo_cells; item.ammo_cells = self.ammo_cells;
item.velocity_z = 300; item.velocity_z = 300;
item.velocity_x = -100 + (random() * 200); item.velocity_x = -100 + (random() * 200);
item.velocity_y = -100 + (random() * 200); item.velocity_y = -100 + (random() * 200);
@ -1689,5 +1477,3 @@ void() DropBackpack =
item.nextthink = time + 30; // remove after 1 minutes item.nextthink = time + 30; // remove after 1 minutes
item.think = SUB_Remove; item.think = SUB_Remove;
}; };

View file

@ -6,18 +6,14 @@ void() info_null =
{ {
remove(self); remove(self);
}; };
/*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for lightning. Used as a positional target for lightning.
*/ */
void() info_notnull = void() info_notnull =
{ {
}; };
//============================================================================ //============================================================================
float START_OFF = 1; float START_OFF = 1;
void() light_use = void() light_use =
{ {
if (self.spawnflags & START_OFF) if (self.spawnflags & START_OFF)
@ -31,7 +27,6 @@ void() light_use =
self.spawnflags = self.spawnflags + START_OFF; self.spawnflags = self.spawnflags + START_OFF;
} }
}; };
/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Non-displayed light. Non-displayed light.
Default light value is 300 Default light value is 300
@ -52,7 +47,6 @@ void() light =
remove(self); remove(self);
return; return;
} }
if (self.style >= 32) if (self.style >= 32)
{ {
self.use = light_use; self.use = light_use;
@ -62,7 +56,6 @@ void() light =
lightstyle(self.style, "m"); lightstyle(self.style, "m");
} }
}; };
/*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Non-displayed light. Non-displayed light.
Default light value is 300 Default light value is 300
@ -91,7 +84,6 @@ void() light_fluoro =
precache_sound ("ambience/fl_hum1.wav"); precache_sound ("ambience/fl_hum1.wav");
ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
}; };
/*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8) /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
Non-displayed light. Non-displayed light.
Default light value is 300 Default light value is 300
@ -109,11 +101,9 @@ void() light_fluorospark =
if (!self.style) if (!self.style)
self.style = 10; self.style = 10;
precache_sound ("ambience/buzz1.wav"); precache_sound ("ambience/buzz1.wav");
ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
}; };
/*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8) /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
Sphere globe light. Sphere globe light.
Default light value is 300 Default light value is 300
@ -132,14 +122,12 @@ void() light_globe =
setmodel (self, "progs/s_light.spr"); setmodel (self, "progs/s_light.spr");
makestatic (self); makestatic (self);
}; };
void() FireAmbient = void() FireAmbient =
{ {
precache_sound ("ambience/fire1.wav"); precache_sound ("ambience/fire1.wav");
// attenuate fast // attenuate fast
ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
}; };
/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
Short wall torch Short wall torch
Default light value is 200 Default light value is 200
@ -159,7 +147,6 @@ void() light_torch_small_walltorch =
FireAmbient (); FireAmbient ();
makestatic (self); makestatic (self);
}; };
/*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18) /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
Large yellow flame ball Large yellow flame ball
*/ */
@ -178,7 +165,6 @@ void() light_flame_large_yellow =
FireAmbient (); FireAmbient ();
makestatic (self); makestatic (self);
}; };
/*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Small yellow flame ball Small yellow flame ball
*/ */
@ -196,7 +182,6 @@ void() light_flame_small_yellow =
FireAmbient (); FireAmbient ();
makestatic (self); makestatic (self);
}; };
/*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
Small white flame ball Small white flame ball
*/ */
@ -214,14 +199,10 @@ void() light_flame_small_white =
FireAmbient (); FireAmbient ();
makestatic (self); makestatic (self);
}; };
//============================================================================ //============================================================================
/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
Lava Balls Lava Balls
*/ */
void() fire_fly; void() fire_fly;
void() fire_touch; void() fire_touch;
void() misc_fireball = void() misc_fireball =
@ -234,11 +215,9 @@ void() misc_fireball =
if (!self.speed) if (!self.speed)
self.speed = 1000; self.speed = 1000;
}; };
void() fire_fly = void() fire_fly =
{ {
local entity fireball; local entity fireball;
fireball = spawn(); fireball = spawn();
fireball.solid = SOLID_TRIGGER; fireball.solid = SOLID_TRIGGER;
fireball.movetype = MOVETYPE_TOSS; fireball.movetype = MOVETYPE_TOSS;
@ -257,23 +236,20 @@ local entity fireball;
self.nextthink = time + (random() * 5) + 3; self.nextthink = time + (random() * 5) + 3;
self.think = fire_fly; self.think = fire_fly;
}; };
void() fire_touch = void() fire_touch =
{ {
T_Damage (other, self, self, 20); T_Damage (other, self, self, 20);
remove(self); remove(self);
}; };
//============================================================================ //============================================================================
void() barrel_explode = void() barrel_explode =
{ {
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
self.classname = "explo_box"; self.classname = "explo_box";
// did say self.owner // did say self.owner
T_RadiusDamage (self, self, 160, world, ""); T_RadiusDamage (self, self, 160, world, "");
sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION); WriteByte (MSG_MULTICAST, TE_EXPLOSION);
WriteCoord (MSG_MULTICAST, self.origin_x); WriteCoord (MSG_MULTICAST, self.origin_x);
@ -282,13 +258,9 @@ void() barrel_explode =
multicast (self.origin, MULTICAST_PHS); multicast (self.origin, MULTICAST_PHS);
remove (self); remove (self);
}; };
/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64) /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
TESTING THING TESTING THING
*/ */
void() misc_explobox = void() misc_explobox =
{ {
local float oldz; local float oldz;
@ -302,7 +274,6 @@ void() misc_explobox =
self.health = 20; self.health = 20;
self.th_die = barrel_explode; self.th_die = barrel_explode;
self.takedamage = DAMAGE_AIM; self.takedamage = DAMAGE_AIM;
self.origin_z = self.origin_z + 2; self.origin_z = self.origin_z + 2;
oldz = self.origin_z; oldz = self.origin_z;
droptofloor(); droptofloor();
@ -316,14 +287,9 @@ void() misc_explobox =
self.nobleed = TRUE; self.nobleed = TRUE;
}; };
/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64) /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
Smaller exploding box, REGISTERED ONLY Smaller exploding box, REGISTERED ONLY
*/ */
void() misc_explobox2 = void() misc_explobox2 =
{ {
local float oldz; local float oldz;
@ -337,7 +303,6 @@ void() misc_explobox2 =
self.health = 20; self.health = 20;
self.th_die = barrel_explode; self.th_die = barrel_explode;
self.takedamage = DAMAGE_AIM; self.takedamage = DAMAGE_AIM;
self.origin_z = self.origin_z + 2; self.origin_z = self.origin_z + 2;
oldz = self.origin_z; oldz = self.origin_z;
droptofloor(); droptofloor();
@ -351,20 +316,15 @@ void() misc_explobox2 =
self.nobleed = TRUE; self.nobleed = TRUE;
}; };
//============================================================================ //============================================================================
float SPAWNFLAG_SUPERSPIKE = 1; float SPAWNFLAG_SUPERSPIKE = 1;
float SPAWNFLAG_LASER = 2; float SPAWNFLAG_LASER = 2;
void() Laser_Touch = void() Laser_Touch =
{ {
local vector org; local vector org;
if (other == self.owner) if (other == self.owner)
return; // don't explode on owner return; // don't explode on owner
if (pointcontents(self.origin) == CONTENT_SKY) if (pointcontents(self.origin) == CONTENT_SKY)
{ {
remove(self); remove(self);
@ -373,7 +333,6 @@ void() Laser_Touch =
sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC);
org = self.origin - 8*normalize(self.velocity); org = self.origin - 8*normalize(self.velocity);
if (other.health) if (other.health)
{ {
SpawnBlood (org, 15); SpawnBlood (org, 15);
@ -393,12 +352,10 @@ void() Laser_Touch =
remove(self); remove(self);
}; };
void(vector org, vector vec) LaunchLaser = void(vector org, vector vec) LaunchLaser =
{ {
if (self.classname == "monster_enforcer") if (self.classname == "monster_enforcer")
sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
vec = normalize(vec); vec = normalize(vec);
newmis = spawn(); newmis = spawn();
@ -406,20 +363,15 @@ void(vector org, vector vec) LaunchLaser =
newmis.movetype = MOVETYPE_FLY; newmis.movetype = MOVETYPE_FLY;
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.effects = EF_DIMLIGHT; newmis.effects = EF_DIMLIGHT;
setmodel (newmis, "progs/laser.mdl"); setmodel (newmis, "progs/laser.mdl");
setsize (newmis, '0 0 0', '0 0 0'); setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, org); setorigin (newmis, org);
newmis.velocity = vec * 600; newmis.velocity = vec * 600;
newmis.angles = vectoangles(newmis.velocity); newmis.angles = vectoangles(newmis.velocity);
newmis.nextthink = time + 5; newmis.nextthink = time + 5;
newmis.think = SUB_Remove; newmis.think = SUB_Remove;
newmis.touch = Laser_Touch; newmis.touch = Laser_Touch;
}; };
void() spikeshooter_use = void() spikeshooter_use =
{ {
if (self.spawnflags & SPAWNFLAG_LASER) if (self.spawnflags & SPAWNFLAG_LASER)
@ -436,20 +388,16 @@ void() spikeshooter_use =
newmis.touch = superspike_touch; newmis.touch = superspike_touch;
} }
}; };
void() shooter_think = void() shooter_think =
{ {
spikeshooter_use (); spikeshooter_use ();
self.nextthink = time + self.wait; self.nextthink = time + self.wait;
newmis.velocity = self.movedir * 500; newmis.velocity = self.movedir * 500;
}; };
/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
When triggered, fires a spike in the direction set in QuakeEd. When triggered, fires a spike in the direction set in QuakeEd.
Laser is only for REGISTERED. Laser is only for REGISTERED.
*/ */
void() trap_spikeshooter = void() trap_spikeshooter =
{ {
SetMovedir (); SetMovedir ();
@ -464,8 +412,6 @@ void() trap_spikeshooter =
else else
precache_sound ("weapons/spike2.wav"); precache_sound ("weapons/spike2.wav");
}; };
/*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
Continuously fires spikes. Continuously fires spikes.
"wait" time between spike (1.0 default) "wait" time between spike (1.0 default)
@ -480,35 +426,23 @@ void() trap_shooter =
self.nextthink = self.nextthink + self.wait + self.ltime; self.nextthink = self.nextthink + self.wait + self.ltime;
self.think = shooter_think; self.think = shooter_think;
}; };
/* /*
=============================================================================== ===============================================================================
=============================================================================== ===============================================================================
*/ */
void() make_bubbles; void() make_bubbles;
void() bubble_remove; void() bubble_remove;
void() bubble_bob; void() bubble_bob;
/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
testing air bubbles testing air bubbles
*/ */
void() air_bubbles = void() air_bubbles =
{ {
remove (self); remove (self);
}; };
void() make_bubbles = void() make_bubbles =
{ {
local entity bubble; local entity bubble;
bubble = spawn(); bubble = spawn();
setmodel (bubble, "progs/s_bubble.spr"); setmodel (bubble, "progs/s_bubble.spr");
setorigin (bubble, self.origin); setorigin (bubble, self.origin);
@ -525,7 +459,6 @@ local entity bubble;
self.nextthink = time + random() + 0.5; self.nextthink = time + random() + 0.5;
self.think = make_bubbles; self.think = make_bubbles;
}; };
void() bubble_split = void() bubble_split =
{ {
local entity bubble; local entity bubble;
@ -547,7 +480,6 @@ local entity bubble;
if (self.waterlevel != 3) if (self.waterlevel != 3)
remove (self); remove (self);
}; };
void() bubble_remove = void() bubble_remove =
{ {
if (other.classname == self.classname) if (other.classname == self.classname)
@ -557,21 +489,17 @@ void() bubble_remove =
} }
remove(self); remove(self);
}; };
void() bubble_bob = void() bubble_bob =
{ {
local float rnd1, rnd2, rnd3; local float rnd1, rnd2, rnd3;
self.cnt = self.cnt + 1; self.cnt = self.cnt + 1;
if (self.cnt == 4) if (self.cnt == 4)
bubble_split(); bubble_split();
if (self.cnt == 20) if (self.cnt == 20)
remove(self); remove(self);
rnd1 = self.velocity_x + (-10 + (random() * 20)); rnd1 = self.velocity_x + (-10 + (random() * 20));
rnd2 = self.velocity_y + (-10 + (random() * 20)); rnd2 = self.velocity_y + (-10 + (random() * 20));
rnd3 = self.velocity_z + 10 + random() * 10; rnd3 = self.velocity_z + 10 + random() * 10;
if (rnd1 > 10) if (rnd1 > 10)
rnd1 = 5; rnd1 = 5;
if (rnd1 < -10) if (rnd1 < -10)
@ -594,38 +522,27 @@ local float rnd1, rnd2, rnd3;
self.nextthink = time + 0.5; self.nextthink = time + 0.5;
self.think = bubble_bob; self.think = bubble_bob;
}; };
/*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~> /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>
~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/ ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/
/*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8)
Just for the debugging level. Don't use Just for the debugging level. Don't use
*/ */
void() viewthing = void() viewthing =
{ {
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
precache_model ("progs/player.mdl"); precache_model ("progs/player.mdl");
setmodel (self, "progs/player.mdl"); setmodel (self, "progs/player.mdl");
}; };
/* /*
============================================================================== ==============================================================================
SIMPLE BMODELS SIMPLE BMODELS
============================================================================== ==============================================================================
*/ */
void() func_wall_use = void() func_wall_use =
{ // change to alternate textures { // change to alternate textures
self.frame = 1 - self.frame; self.frame = 1 - self.frame;
}; };
/*QUAKED func_wall (0 .5 .8) ? /*QUAKED func_wall (0 .5 .8) ?
This is just a solid wall if not inhibitted This is just a solid wall if not inhibitted
*/ */
@ -637,13 +554,10 @@ void() func_wall =
self.use = func_wall_use; self.use = func_wall_use;
setmodel (self, self.model); setmodel (self, self.model);
}; };
/*QUAKED func_illusionary (0 .5 .8) ? /*QUAKED func_illusionary (0 .5 .8) ?
A simple entity that looks solid but lets you walk through it. A simple entity that looks solid but lets you walk through it.
*/ */
void() func_illusionary = void() func_illusionary =
{ {
self.angles = '0 0 0'; self.angles = '0 0 0';
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
@ -651,28 +565,23 @@ void() func_illusionary =
setmodel (self, self.model); setmodel (self, self.model);
makestatic (self); makestatic (self);
}; };
/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4
This bmodel will appear if the episode has allready been completed, so players can't reenter it. This bmodel will appear if the episode has allready been completed, so players can't reenter it.
*/ */
void() func_episodegate = void() func_episodegate =
{ {
if (!(serverflags & self.spawnflags)) if (!(serverflags & self.spawnflags))
return; // can still enter episode return; // can still enter episode
self.angles = '0 0 0'; self.angles = '0 0 0';
self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
self.solid = SOLID_BSP; self.solid = SOLID_BSP;
self.use = func_wall_use; self.use = func_wall_use;
setmodel (self, self.model); setmodel (self, self.model);
}; };
/*QUAKED func_bossgate (0 .5 .8) ? /*QUAKED func_bossgate (0 .5 .8) ?
This bmodel appears unless players have all of the episode sigils. This bmodel appears unless players have all of the episode sigils.
*/ */
void() func_bossgate = void() func_bossgate =
{ {
if ( (serverflags & 15) == 15) if ( (serverflags & 15) == 15)
return; // all episodes completed return; // all episodes completed
@ -682,7 +591,6 @@ void() func_bossgate =
self.use = func_wall_use; self.use = func_wall_use;
setmodel (self, self.model); setmodel (self, self.model);
}; };
//============================================================================ //============================================================================
/*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) /*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
*/ */
@ -691,7 +599,6 @@ void() ambient_suck_wind =
precache_sound ("ambience/suck1.wav"); precache_sound ("ambience/suck1.wav");
ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC); ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
}; };
/*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
*/ */
void() ambient_drone = void() ambient_drone =
@ -699,7 +606,6 @@ void() ambient_drone =
precache_sound ("ambience/drone6.wav"); precache_sound ("ambience/drone6.wav");
ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
}; };
/*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
*/ */
void() ambient_flouro_buzz = void() ambient_flouro_buzz =
@ -749,9 +655,7 @@ void() ambient_swamp2 =
precache_sound ("ambience/swamp2.wav"); precache_sound ("ambience/swamp2.wav");
ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
}; };
//============================================================================ //============================================================================
void() noise_think = void() noise_think =
{ {
self.nextthink = time + 0.5; self.nextthink = time + 0.5;
@ -763,14 +667,10 @@ void() noise_think =
sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM); sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM); sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
}; };
/*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10) /*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10)
For optimzation testing, starts a lot of sounds. For optimzation testing, starts a lot of sounds.
*/ */
void() misc_noisemaker = void() misc_noisemaker =
{ {
precache_sound2 ("enforcer/enfire.wav"); precache_sound2 ("enforcer/enfire.wav");
precache_sound2 ("enforcer/enfstop.wav"); precache_sound2 ("enforcer/enfstop.wav");
@ -782,7 +682,6 @@ void() misc_noisemaker =
precache_sound2 ("enforcer/pain2.wav"); precache_sound2 ("enforcer/pain2.wav");
precache_sound2 ("enforcer/death1.wav"); precache_sound2 ("enforcer/death1.wav");
precache_sound2 ("enforcer/idle1.wav"); precache_sound2 ("enforcer/idle1.wav");
self.nextthink = time + 0.1 + random(); self.nextthink = time + 0.1 + random();
self.think = noise_think; self.think = noise_think;
}; };

View file

@ -2,14 +2,10 @@
POX - Last Man Standing Observer Code POX - Last Man Standing Observer Code
This was written to support Last Man Standing Rules, it is a crude form of Spectate that allows This was written to support Last Man Standing Rules, it is a crude form of Spectate that allows
observes to stay connected as players so they can play the next game. observes to stay connected as players so they can play the next game.
An LMS observer is counted as a player, so you can still have the max amount of true Spectors connected An LMS observer is counted as a player, so you can still have the max amount of true Spectors connected
*/ */
entity() SelectSpawnPoint; entity() SelectSpawnPoint;
void() teleport_touch; //POX v1.12 void() teleport_touch; //POX v1.12
//POX v1.12 - sets fov for observer (impulses 1 and 2) //POX v1.12 - sets fov for observer (impulses 1 and 2)
/*------------------ /*------------------
SetObserverFOV SetObserverFOV
@ -23,9 +19,7 @@ void() SetObserverFOV =
stuffcmd (self, "fov "); stuffcmd (self, "fov ");
stuffcmd (self, ob_fov); stuffcmd (self, ob_fov);
stuffcmd (self, "\n"); stuffcmd (self, "\n");
}; };
//POX v1.12 - Allows observers to use teleporters //POX v1.12 - Allows observers to use teleporters
/*------------------ /*------------------
ObserverTeleportTouch ObserverTeleportTouch
@ -44,7 +38,6 @@ local entity t;
setorigin (self, t.origin); setorigin (self, t.origin);
self.angles = t.mangle; self.angles = t.mangle;
self.fixangle = 1; // turn this way immediately self.fixangle = 1; // turn this way immediately
self.teleport_time = time + 1.7;//POX v1.2 increased this self.teleport_time = time + 1.7;//POX v1.2 increased this
if (self.flags & FL_ONGROUND) if (self.flags & FL_ONGROUND)
@ -52,15 +45,12 @@ local entity t;
self.velocity = v_forward * 300; self.velocity = v_forward * 300;
self.flags = self.flags - self.flags & FL_ONGROUND; self.flags = self.flags - self.flags & FL_ONGROUND;
}; };
/*------------------ /*------------------
ObserverImpulses ObserverImpulses
Handels observer controls Handels observer controls
-------------------*/ -------------------*/
void() ObserverImpulses = void() ObserverImpulses =
{ {
//Jump to a dm start point (Fire Button) //Jump to a dm start point (Fire Button)
if (self.button0) if (self.button0)
{ {
@ -133,7 +123,6 @@ void() ObserverImpulses =
else else
{ {
self.target_id_toggle = TRUE; self.target_id_toggle = TRUE;
//POX v1.12 - don't centerprint if a message is up //POX v1.12 - don't centerprint if a message is up
if (self.target_id_finished < time) if (self.target_id_finished < time)
centerprint (self, "Target Identifier ON\n"); centerprint (self, "Target Identifier ON\n");
@ -147,14 +136,11 @@ void() ObserverImpulses =
self.impulse = 0; self.impulse = 0;
self.button0 = 0; self.button0 = 0;
self.button1 = 0; self.button1 = 0;
}; };
/*------------------ /*------------------
ObserverThink ObserverThink
Rerouted from PlayerPostThink Rerouted from PlayerPostThink
-------------------*/ -------------------*/
void() ObserverThink = void() ObserverThink =
{ {
local entity tele; //POX v1.12 local entity tele; //POX v1.12
@ -216,13 +202,10 @@ void() ObserverThink =
} }
ObserverImpulses (); ObserverImpulses ();
}; };
/*------------------ /*------------------
SpawnObserver SpawnObserver
-------------------*/ -------------------*/
void() SpawnObserver = void() SpawnObserver =
{ {
local entity spot; local entity spot;
@ -240,24 +223,19 @@ void() SpawnObserver =
self.invincible_finished = 0; self.invincible_finished = 0;
self.effects = 0; self.effects = 0;
self.invincible_time = 0; self.invincible_time = 0;
self.items = 0; self.items = 0;
self.ammo_shells = 0; self.ammo_shells = 0;
self.ammo_nails = 0; self.ammo_nails = 0;
self.ammo_rockets = 0; self.ammo_rockets = 0;
self.ammo_cells = 0; self.ammo_cells = 0;
self.weapon = 0; self.weapon = 0;
self.armorvalue = 0; self.armorvalue = 0;
self.armortype = 0; self.armortype = 0;
self.deadflag = DEAD_NO; self.deadflag = DEAD_NO;
spot = SelectSpawnPoint (); spot = SelectSpawnPoint ();
self.origin = spot.origin + '0 0 1'; self.origin = spot.origin + '0 0 1';
self.angles = spot.angles; self.angles = spot.angles;
self.fixangle = TRUE; // turn this way immediately self.fixangle = TRUE; // turn this way immediately
setmodel (self, string_null); setmodel (self, string_null);
self.weaponmodel = string_null; self.weaponmodel = string_null;
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
@ -279,9 +257,3 @@ void() SpawnObserver =
stuffcmd (self, "fov 100\n"); stuffcmd (self, "fov 100\n");
self.target_id_toggle = TRUE; //POX v1.12 default to on self.target_id_toggle = TRUE; //POX v1.12 default to on
}; };

View file

@ -1,5 +1,4 @@
void() plat_center_touch; void() plat_center_touch;
void() plat_outside_touch; void() plat_outside_touch;
void() plat_trigger_use; void() plat_trigger_use;
@ -7,12 +6,10 @@ void() plat_go_up;
void() plat_go_down; void() plat_go_down;
void() plat_crush; void() plat_crush;
float PLAT_LOW_TRIGGER = 1; float PLAT_LOW_TRIGGER = 1;
void() plat_spawn_inside_trigger = void() plat_spawn_inside_trigger =
{ {
local entity trigger; local entity trigger;
local vector tmin, tmax; local vector tmin, tmax;
// //
// middle trigger // middle trigger
// //
@ -41,7 +38,6 @@ void() plat_spawn_inside_trigger =
setsize (trigger, tmin, tmax); setsize (trigger, tmin, tmax);
}; };
void() plat_hit_top = void() plat_hit_top =
{ {
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
@ -49,27 +45,23 @@ void() plat_hit_top =
self.think = plat_go_down; self.think = plat_go_down;
self.nextthink = self.ltime + 3; self.nextthink = self.ltime + 3;
}; };
void() plat_hit_bottom = void() plat_hit_bottom =
{ {
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_BOTTOM; self.state = STATE_BOTTOM;
}; };
void() plat_go_down = void() plat_go_down =
{ {
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.state = STATE_DOWN; self.state = STATE_DOWN;
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom); SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
}; };
void() plat_go_up = void() plat_go_up =
{ {
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.state = STATE_UP; self.state = STATE_UP;
SUB_CalcMove (self.pos1, self.speed, plat_hit_top); SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
}; };
void() plat_center_touch = void() plat_center_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
@ -77,19 +69,16 @@ void() plat_center_touch =
if (other.health <= 0) if (other.health <= 0)
return; return;
self = self.enemy; self = self.enemy;
if (self.state == STATE_BOTTOM) if (self.state == STATE_BOTTOM)
plat_go_up (); plat_go_up ();
else if (self.state == STATE_TOP) else if (self.state == STATE_TOP)
self.nextthink = self.ltime + 1; // delay going down self.nextthink = self.ltime + 1; // delay going down
}; };
void() plat_outside_touch = void() plat_outside_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
@ -98,19 +87,15 @@ void() plat_outside_touch =
if (self.state == STATE_TOP) if (self.state == STATE_TOP)
plat_go_down (); plat_go_down ();
}; };
void() plat_trigger_use = void() plat_trigger_use =
{ {
if (self.think) if (self.think)
return; // allready activated return; // allready activated
plat_go_down(); plat_go_down();
}; };
void() plat_crush = void() plat_crush =
{ {
//dprint ("plat_crush\n"); //dprint ("plat_crush\n");
other.deathtype = "squish"; other.deathtype = "squish";
T_Damage (other, self, self, 1); T_Damage (other, self, self, 1);
@ -121,7 +106,6 @@ void() plat_crush =
else else
objerror ("plat_crush: bad self.state\n"); objerror ("plat_crush: bad self.state\n");
}; };
void() plat_use = void() plat_use =
{ {
self.use = SUB_Null; self.use = SUB_Null;
@ -129,34 +113,24 @@ void() plat_use =
objerror ("plat_use: not in up state"); objerror ("plat_use: not in up state");
plat_go_down(); plat_go_down();
}; };
/*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER /*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER
speed default 150 speed default 150
Plats are always drawn in the extended position, so they will light correctly. Plats are always drawn in the extended position, so they will light correctly.
If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat. If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat.
If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height. If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height.
Set "sounds" to one of the following: Set "sounds" to one of the following:
1) base fast 1) base fast
2) chain slow 2) chain slow
*/ */
void() func_plat = void() func_plat =
{ {
if (!self.t_length) if (!self.t_length)
self.t_length = 80; self.t_length = 80;
if (!self.t_width) if (!self.t_width)
self.t_width = 10; self.t_width = 10;
if (self.sounds == 0) if (self.sounds == 0)
self.sounds = 3;// + POX - changed from 2 self.sounds = 3;// + POX - changed from 2
// FIX THIS TO LOAD A GENERIC PLAT SOUND // FIX THIS TO LOAD A GENERIC PLAT SOUND
if (self.sounds == 1) if (self.sounds == 1)
{ {
precache_sound ("plats/plat1.wav"); precache_sound ("plats/plat1.wav");
@ -164,7 +138,6 @@ void() func_plat =
self.noise = "plats/plat1.wav"; self.noise = "plats/plat1.wav";
self.noise1 = "plats/plat2.wav"; self.noise1 = "plats/plat2.wav";
} }
if (self.sounds == 2) if (self.sounds == 2)
{ {
precache_sound ("plats/medplat1.wav"); precache_sound ("plats/medplat1.wav");
@ -180,7 +153,6 @@ void() func_plat =
self.noise = "doors/hydro1.wav"; self.noise = "doors/hydro1.wav";
self.noise1 = "doors/hydro2.wav"; self.noise1 = "doors/hydro2.wav";
} }
if (self.sounds == 4) if (self.sounds == 4)
{ {
precache_sound ("doors/stndr1.wav"); precache_sound ("doors/stndr1.wav");
@ -188,7 +160,6 @@ void() func_plat =
self.noise = "doors/stndr1.wav"; self.noise = "doors/stndr1.wav";
self.noise1 = "doors/stndr2.wav"; self.noise1 = "doors/stndr2.wav";
} }
if (self.sounds == 5) if (self.sounds == 5)
{ {
precache_sound ("doors/ddoor1.wav"); precache_sound ("doors/ddoor1.wav");
@ -197,21 +168,17 @@ void() func_plat =
self.noise1 = "doors/ddoor1.wav"; self.noise1 = "doors/ddoor1.wav";
} }
// - POX // - POX
self.mangle = self.angles; self.mangle = self.angles;
self.angles = '0 0 0'; self.angles = '0 0 0';
self.classname = "plat"; self.classname = "plat";
self.solid = SOLID_BSP; self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH; self.movetype = MOVETYPE_PUSH;
setorigin (self, self.origin); setorigin (self, self.origin);
setmodel (self, self.model); setmodel (self, self.model);
setsize (self, self.mins , self.maxs); setsize (self, self.mins , self.maxs);
self.blocked = plat_crush; self.blocked = plat_crush;
if (!self.speed) if (!self.speed)
self.speed = 150; self.speed = 150;
// pos1 is the top position, pos2 is the bottom // pos1 is the top position, pos2 is the bottom
self.pos1 = self.origin; self.pos1 = self.origin;
self.pos2 = self.origin; self.pos2 = self.origin;
@ -219,11 +186,8 @@ void() func_plat =
self.pos2_z = self.origin_z - self.height; self.pos2_z = self.origin_z - self.height;
else else
self.pos2_z = self.origin_z - self.size_z + 8; self.pos2_z = self.origin_z - self.size_z + 8;
self.use = plat_trigger_use; self.use = plat_trigger_use;
plat_spawn_inside_trigger (); // the "start moving" trigger plat_spawn_inside_trigger (); // the "start moving" trigger
if (self.targetname) if (self.targetname)
{ {
self.state = STATE_UP; self.state = STATE_UP;
@ -235,12 +199,9 @@ void() func_plat =
self.state = STATE_BOTTOM; self.state = STATE_BOTTOM;
} }
}; };
//============================================================================ //============================================================================
void() train_next; void() train_next;
void() func_train_find; void() func_train_find;
void() train_blocked = void() train_blocked =
{ {
if (time < self.attack_finished) if (time < self.attack_finished)
@ -249,14 +210,12 @@ void() train_blocked =
other.deathtype = "squish"; other.deathtype = "squish";
T_Damage (other, self, self, self.dmg); T_Damage (other, self, self, self.dmg);
}; };
void() train_use = void() train_use =
{ {
if (self.think != func_train_find) if (self.think != func_train_find)
return; // already activated return; // already activated
train_next(); train_next();
}; };
void() train_wait = void() train_wait =
{ {
if (self.wait) if (self.wait)
@ -269,11 +228,9 @@ void() train_wait =
self.think = train_next; self.think = train_next;
}; };
void() train_next = void() train_next =
{ {
local entity targ; local entity targ;
targ = find (world, targetname, self.target); targ = find (world, targetname, self.target);
self.target = targ.target; self.target = targ.target;
if (!self.target) if (!self.target)
@ -285,12 +242,9 @@ void() train_next =
sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait); SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait);
}; };
void() func_train_find = void() func_train_find =
{ {
local entity targ; local entity targ;
targ = find (world, targetname, self.target); targ = find (world, targetname, self.target);
self.target = targ.target; self.target = targ.target;
setorigin (self, targ.origin - self.mins); setorigin (self, targ.origin - self.mins);
@ -300,7 +254,6 @@ void() func_train_find =
self.think = train_next; self.think = train_next;
} }
}; };
/*QUAKED func_train (0 .5 .8) ? /*QUAKED func_train (0 .5 .8) ?
Trains are moving platforms that players can ride. Trains are moving platforms that players can ride.
The targets origin specifies the min point of the train at each corner. The targets origin specifies the min point of the train at each corner.
@ -310,7 +263,6 @@ speed default 100
dmg default 2 dmg default 2
sounds sounds
1) ratchet metal 1) ratchet metal
*/ */
void() func_train = void() func_train =
{ {
@ -320,7 +272,6 @@ void() func_train =
objerror ("func_train without a target"); objerror ("func_train without a target");
if (!self.dmg) if (!self.dmg)
self.dmg = 2; self.dmg = 2;
if (self.sounds == 0) if (self.sounds == 0)
{ {
self.noise = ("misc/null.wav"); self.noise = ("misc/null.wav");
@ -328,7 +279,6 @@ void() func_train =
self.noise1 = ("misc/null.wav"); self.noise1 = ("misc/null.wav");
precache_sound ("misc/null.wav"); precache_sound ("misc/null.wav");
} }
if (self.sounds == 1) if (self.sounds == 1)
{ {
self.noise = ("plats/train2.wav"); self.noise = ("plats/train2.wav");
@ -336,24 +286,20 @@ void() func_train =
self.noise1 = ("plats/train1.wav"); self.noise1 = ("plats/train1.wav");
precache_sound ("plats/train1.wav"); precache_sound ("plats/train1.wav");
} }
self.cnt = 1; self.cnt = 1;
self.solid = SOLID_BSP; self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH; self.movetype = MOVETYPE_PUSH;
self.blocked = train_blocked; self.blocked = train_blocked;
self.use = train_use; self.use = train_use;
self.classname = "train"; self.classname = "train";
setmodel (self, self.model); setmodel (self, self.model);
setsize (self, self.mins , self.maxs); setsize (self, self.mins , self.maxs);
setorigin (self, self.origin); setorigin (self, self.origin);
// start trains on the second frame, to make sure their targets have had // start trains on the second frame, to make sure their targets have had
// a chance to spawn // a chance to spawn
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
self.think = func_train_find; self.think = func_train_find;
}; };
/*QUAKED misc_teleporttrain (0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED misc_teleporttrain (0 .5 .8) (-8 -8 -8) (8 8 8)
This is used for the final bos This is used for the final bos
*/ */
@ -363,27 +309,22 @@ void() misc_teleporttrain =
self.speed = 100; self.speed = 100;
if (!self.target) if (!self.target)
objerror ("func_train without a target"); objerror ("func_train without a target");
self.cnt = 1; self.cnt = 1;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.movetype = MOVETYPE_PUSH; self.movetype = MOVETYPE_PUSH;
self.blocked = train_blocked; self.blocked = train_blocked;
self.use = train_use; self.use = train_use;
self.avelocity = '100 200 300'; self.avelocity = '100 200 300';
self.noise = ("misc/null.wav"); self.noise = ("misc/null.wav");
precache_sound ("misc/null.wav"); precache_sound ("misc/null.wav");
self.noise1 = ("misc/null.wav"); self.noise1 = ("misc/null.wav");
precache_sound ("misc/null.wav"); precache_sound ("misc/null.wav");
precache_model2 ("progs/teleport.mdl"); precache_model2 ("progs/teleport.mdl");
setmodel (self, "progs/teleport.mdl"); setmodel (self, "progs/teleport.mdl");
setsize (self, self.mins , self.maxs); setsize (self, self.mins , self.maxs);
setorigin (self, self.origin); setorigin (self, self.origin);
// start trains on the second frame, to make sure their targets have had // start trains on the second frame, to make sure their targets have had
// a chance to spawn // a chance to spawn
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
self.think = func_train_find; self.think = func_train_find;
}; };

View file

@ -1,93 +1,62 @@
void() bubble_bob; void() bubble_bob;
/* /*
============================================================================== ==============================================================================
PLAYER PLAYER
============================================================================== ==============================================================================
*/ */
$cd /raid/quake/id1/models/player_4 $cd /raid/quake/id1/models/player_4
$origin 0 -6 24 $origin 0 -6 24
$base base $base base
$skin skin $skin skin
// //
// running // running
// //
$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 $frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6
$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 $frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6
// //
// standing // standing
// //
$frame stand1 stand2 stand3 stand4 stand5 $frame stand1 stand2 stand3 stand4 stand5
$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
// //
// pain // pain
// //
$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
$frame pain1 pain2 pain3 pain4 pain5 pain6 $frame pain1 pain2 pain3 pain4 pain5 pain6
// //
// death // death
// //
$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 $frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6
$frame axdeth7 axdeth8 axdeth9 $frame axdeth7 axdeth8 axdeth9
$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 $frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8
$frame deatha9 deatha10 deatha11 $frame deatha9 deatha10 deatha11
$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
$frame deathb9 $frame deathb9
$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 $frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8
$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 $frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15
$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 $frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7
$frame deathd8 deathd9 $frame deathd8 deathd9
$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 $frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7
$frame deathe8 deathe9 $frame deathe8 deathe9
// //
// attacks // attacks
// //
$frame nailatt1 nailatt2 $frame nailatt1 nailatt2
$frame light1 light2 $frame light1 light2
$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 $frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6
$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 $frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6
$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 $frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6
$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 $frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6
$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
/* /*
============================================================================== ==============================================================================
PLAYER PLAYER
============================================================================== ==============================================================================
*/ */
void() player_run; void() player_run;
void() player_stand1 =[ $axstnd1, player_stand1 ] void() player_stand1 =[ $axstnd1, player_stand1 ]
{ {
self.weaponframe=0; self.weaponframe=0;
@ -97,7 +66,6 @@ void() player_stand1 =[ $axstnd1, player_stand1 ]
player_run(); player_run();
return; return;
} }
if (self.weapon == IT_AXE) if (self.weapon == IT_AXE)
{ {
if (self.walkframe >= 12) if (self.walkframe >= 12)
@ -112,7 +80,6 @@ void() player_stand1 =[ $axstnd1, player_stand1 ]
} }
self.walkframe = self.walkframe + 1; self.walkframe = self.walkframe + 1;
}; };
void() player_run =[ $rockrun1, player_run ] void() player_run =[ $rockrun1, player_run ]
{ {
self.weaponframe=0; self.weaponframe=0;
@ -122,7 +89,6 @@ void() player_run =[ $rockrun1, player_run ]
player_stand1(); player_stand1();
return; return;
} }
if (self.weapon == IT_AXE) if (self.weapon == IT_AXE)
{ {
if (self.walkframe == 6) if (self.walkframe == 6)
@ -137,7 +103,6 @@ void() player_run =[ $rockrun1, player_run ]
} }
// + POX - footstep sounds // + POX - footstep sounds
self.spawnsilent = self.spawnsilent + vlen(self.origin - self.old_velocity); self.spawnsilent = self.spawnsilent + vlen(self.origin - self.old_velocity);
self.old_velocity = self.origin; self.old_velocity = self.origin;
@ -180,14 +145,12 @@ void() player_run =[ $rockrun1, player_run ]
self.walkframe = self.walkframe + 1; self.walkframe = self.walkframe + 1;
}; };
void()muzzleflash = void()muzzleflash =
{ {
WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH);
WriteEntity (MSG_MULTICAST, self); WriteEntity (MSG_MULTICAST, self);
multicast (self.origin, MULTICAST_PVS); multicast (self.origin, MULTICAST_PVS);
}; };
// POX - used for tShot and ComboGun primary triggers // POX - used for tShot and ComboGun primary triggers
void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe=1;muzzleflash();}; void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe=1;muzzleflash();};
void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe=2;}; void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe=2;};
@ -195,7 +158,6 @@ void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe=3;};
void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe=4;}; void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe=4;};
void() player_shot5 = [$shotatt5, player_shot6 ] {self.weaponframe=5;}; void() player_shot5 = [$shotatt5, player_shot6 ] {self.weaponframe=5;};
void() player_shot6 = [$shotatt6, player_run ] {self.weaponframe=6;}; void() player_shot6 = [$shotatt6, player_run ] {self.weaponframe=6;};
// POX - New Frame Macro For tShot 3 barrel fire // POX - New Frame Macro For tShot 3 barrel fire
void() player_tshot1 = [$shotatt1, player_tshot2 ] {self.weaponframe=1;muzzleflash();}; void() player_tshot1 = [$shotatt1, player_tshot2 ] {self.weaponframe=1;muzzleflash();};
void() player_tshot2 = [$shotatt2, player_tshot3 ] {self.weaponframe=16;};//triple flare frame void() player_tshot2 = [$shotatt2, player_tshot3 ] {self.weaponframe=16;};//triple flare frame
@ -203,7 +165,6 @@ void() player_tshot3 = [$shotatt3, player_tshot4 ] {self.weaponframe=3;};
void() player_tshot4 = [$shotatt4, player_tshot5 ] {self.weaponframe=4;}; void() player_tshot4 = [$shotatt4, player_tshot5 ] {self.weaponframe=4;};
void() player_tshot5 = [$shotatt5, player_tshot6 ] {self.weaponframe=5;}; void() player_tshot5 = [$shotatt5, player_tshot6 ] {self.weaponframe=5;};
void() player_tshot6 = [$shotatt6, player_run ] {self.weaponframe=6;}; void() player_tshot6 = [$shotatt6, player_run ] {self.weaponframe=6;};
// POX - New Frame Macro For tShot 3 barrel prime // POX - New Frame Macro For tShot 3 barrel prime
void() player_reshot1 = [$shotatt1, player_reshot2 ] {self.weaponframe=7;}; void() player_reshot1 = [$shotatt1, player_reshot2 ] {self.weaponframe=7;};
void() player_reshot2 = [$shotatt3, player_reshot3 ] {self.weaponframe=8;}; void() player_reshot2 = [$shotatt3, player_reshot3 ] {self.weaponframe=8;};
@ -214,42 +175,32 @@ void() player_reshot6 = [$shotatt5, player_reshot7 ] {self.weaponframe=12;};
void() player_reshot7 = [$shotatt4, player_reshot8 ] {self.weaponframe=13;}; void() player_reshot7 = [$shotatt4, player_reshot8 ] {self.weaponframe=13;};
void() player_reshot8 = [$shotatt3, player_reshot9 ] {self.weaponframe=14;}; void() player_reshot8 = [$shotatt3, player_reshot9 ] {self.weaponframe=14;};
void() player_reshot9 = [$shotatt1, player_run ] {self.weaponframe=15;}; void() player_reshot9 = [$shotatt1, player_run ] {self.weaponframe=15;};
// POX - New Frame Macro For ComboGun Second Trigger (Impact Grenades) // POX - New Frame Macro For ComboGun Second Trigger (Impact Grenades)
void() player_gshot1 = [$shotatt1, player_gshot2 ] {self.weaponframe=2;muzzleflash();}; void() player_gshot1 = [$shotatt1, player_gshot2 ] {self.weaponframe=2;muzzleflash();};
void() player_gshot2 = [$shotatt2, player_gshot3 ] {self.weaponframe=3;}; void() player_gshot2 = [$shotatt2, player_gshot3 ] {self.weaponframe=3;};
void() player_gshot3 = [$shotatt3, player_gshot4 ] {self.weaponframe=4;}; void() player_gshot3 = [$shotatt3, player_gshot4 ] {self.weaponframe=4;};
void() player_gshot4 = [$shotatt4, player_gshot5 ] {self.weaponframe=5;}; void() player_gshot4 = [$shotatt4, player_gshot5 ] {self.weaponframe=5;};
void() player_gshot5 = [$shotatt5, player_run ] {self.weaponframe=6;}; void() player_gshot5 = [$shotatt5, player_run ] {self.weaponframe=6;};
// POX - New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb) // POX - New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb)
void() player_shrap1 = [$nailatt1, player_shrap2 ] {muzzleflash();}; void() player_shrap1 = [$nailatt1, player_shrap2 ] {muzzleflash();};
void() player_shrap2 = [$nailatt2, player_run ] {}; void() player_shrap2 = [$nailatt2, player_run ] {};
void() player_axe1 = [$axatt1, player_axe2 ] {self.weaponframe=1;}; void() player_axe1 = [$axatt1, player_axe2 ] {self.weaponframe=1;};
void() player_axe2 = [$axatt2, player_axe3 ] {self.weaponframe=2;}; void() player_axe2 = [$axatt2, player_axe3 ] {self.weaponframe=2;};
void() player_axe3 = [$axatt3, player_axe4 ] {self.weaponframe=3;W_FireAxe();}; void() player_axe3 = [$axatt3, player_axe4 ] {self.weaponframe=3;W_FireAxe();};
void() player_axe4 = [$axatt4, player_run ] {self.weaponframe=4;}; void() player_axe4 = [$axatt4, player_run ] {self.weaponframe=4;};
void() player_axeb1 = [$axattb1, player_axeb2 ] {self.weaponframe=5;}; void() player_axeb1 = [$axattb1, player_axeb2 ] {self.weaponframe=5;};
void() player_axeb2 = [$axattb2, player_axeb3 ] {self.weaponframe=6;}; void() player_axeb2 = [$axattb2, player_axeb3 ] {self.weaponframe=6;};
void() player_axeb3 = [$axattb3, player_axeb4 ] {self.weaponframe=7;W_FireAxe();}; void() player_axeb3 = [$axattb3, player_axeb4 ] {self.weaponframe=7;W_FireAxe();};
void() player_axeb4 = [$axattb4, player_run ] {self.weaponframe=8;}; void() player_axeb4 = [$axattb4, player_run ] {self.weaponframe=8;};
void() player_axec1 = [$axattc1, player_axec2 ] {self.weaponframe=1;}; void() player_axec1 = [$axattc1, player_axec2 ] {self.weaponframe=1;};
void() player_axec2 = [$axattc2, player_axec3 ] {self.weaponframe=2;}; void() player_axec2 = [$axattc2, player_axec3 ] {self.weaponframe=2;};
void() player_axec3 = [$axattc3, player_axec4 ] {self.weaponframe=3;W_FireAxe();}; void() player_axec3 = [$axattc3, player_axec4 ] {self.weaponframe=3;W_FireAxe();};
void() player_axec4 = [$axattc4, player_run ] {self.weaponframe=4;}; void() player_axec4 = [$axattc4, player_run ] {self.weaponframe=4;};
void() player_axed1 = [$axattd1, player_axed2 ] {self.weaponframe=5;}; void() player_axed1 = [$axattd1, player_axed2 ] {self.weaponframe=5;};
void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe=6;}; void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe=6;};
void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe=7;W_FireAxe();}; void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe=7;W_FireAxe();};
void() player_axed4 = [$axattd4, player_run ] {self.weaponframe=8;}; void() player_axed4 = [$axattd4, player_run ] {self.weaponframe=8;};
//============================================================================ //============================================================================
// POX - NailGun animation - In sync with Paroxysm v1.1 // POX - NailGun animation - In sync with Paroxysm v1.1
void() player_nail1 =[$nailatt1, player_nail2 ] void() player_nail1 =[$nailatt1, player_nail2 ]
{ {
@ -265,7 +216,6 @@ void() player_nail1 =[$nailatt1, player_nail2 ]
else else
{ {
muzzleflash(); muzzleflash();
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
self.weaponframe = self.weaponframe + 1; self.weaponframe = self.weaponframe + 1;
@ -295,7 +245,6 @@ void() player_nail2 =[$nailatt2, player_nail1 ]
{ {
muzzleflash(); muzzleflash();
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
self.weaponframe = self.weaponframe + 1; self.weaponframe = self.weaponframe + 1;
@ -311,11 +260,8 @@ void() player_nail2 =[$nailatt2, player_nail1 ]
} }
}; };
//============================================================================ //============================================================================
// POX - PlasmaGun animation - In sync with Paroxysm v1.1 // POX - PlasmaGun animation - In sync with Paroxysm v1.1
void() player_plasma1 =[$nailatt1, player_plasma2 ] void() player_plasma1 =[$nailatt1, player_plasma2 ]
{ {
if (self.st_plasma > time) if (self.st_plasma > time)
@ -348,9 +294,7 @@ void() player_plasma1 =[$nailatt1, player_plasma2 ]
self.st_plasma = time + 0.1; self.st_plasma = time + 0.1;
} }
}; };
void() player_plasma2 =[$nailatt2, player_plasma1 ] void() player_plasma2 =[$nailatt2, player_plasma1 ]
{ {
if (self.st_plasma > time) if (self.st_plasma > time)
@ -385,16 +329,12 @@ void() player_plasma2 =[$nailatt2, player_plasma1 ]
self.st_plasma = time + 0.1; self.st_plasma = time + 0.1;
} }
}; };
//============================================================================ //============================================================================
// POX - MegaPlasma Burst // POX - MegaPlasma Burst
void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {self.weaponframe=0;}; void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {self.weaponframe=0;};
void() player_mplasma2 =[$rockatt2, player_mplasma3 ] {}; void() player_mplasma2 =[$rockatt2, player_mplasma3 ] {};
void() player_mplasma3 =[$rockatt3, player_run ] {}; void() player_mplasma3 =[$rockatt3, player_run ] {};
// POX - Grenadelauncher Animation // POX - Grenadelauncher Animation
void() player_grenade1 =[$rockatt1, player_grenade2 ] {self.weaponframe=1;muzzleflash();}; void() player_grenade1 =[$rockatt1, player_grenade2 ] {self.weaponframe=1;muzzleflash();};
void() player_grenade2 =[$rockatt2, player_grenade3 ] {self.weaponframe=2;}; void() player_grenade2 =[$rockatt2, player_grenade3 ] {self.weaponframe=2;};
@ -402,7 +342,6 @@ void() player_grenade3 =[$rockatt3, player_grenade4 ] {self.weaponframe=3;};
void() player_grenade4 =[$rockatt4, player_grenade5 ] {self.weaponframe=4;}; void() player_grenade4 =[$rockatt4, player_grenade5 ] {self.weaponframe=4;};
void() player_grenade5 =[$rockatt5, player_grenade6 ] {self.weaponframe=5;}; void() player_grenade5 =[$rockatt5, player_grenade6 ] {self.weaponframe=5;};
void() player_grenade6 =[$rockatt6, player_run ] {self.weaponframe=6;}; void() player_grenade6 =[$rockatt6, player_run ] {self.weaponframe=6;};
// POX - Annihilator firing sequence // POX - Annihilator firing sequence
void() player_rocket1 =[$rockatt1, player_rocket2 ] {self.weaponframe=1; void() player_rocket1 =[$rockatt1, player_rocket2 ] {self.weaponframe=1;
W_FireRocket('0 0 16'); W_FireRocket('0 0 16');
@ -411,16 +350,12 @@ sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM);
if (self.flags & FL_ONGROUND) if (self.flags & FL_ONGROUND)
self.velocity = v_forward* -25; self.velocity = v_forward* -25;
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_BIGKICK); WriteByte (MSG_ONE, SVC_BIGKICK);
muzzleflash();}; muzzleflash();};
void() player_rocket2 =[$rockatt2, player_rocket3 ] {self.weaponframe=2; void() player_rocket2 =[$rockatt2, player_rocket3 ] {self.weaponframe=2;
W_FireRocket('0 0 24');}; W_FireRocket('0 0 24');};
void() player_rocket3 =[$rockatt3, player_run ] {self.weaponframe=3;}; void() player_rocket3 =[$rockatt3, player_run ] {self.weaponframe=3;};
// POX - Annihilator Reload sequence // POX - Annihilator Reload sequence
void() player_rocketload1 =[$rockatt1, player_rocketload2 ] {self.weaponframe=4;}; void() player_rocketload1 =[$rockatt1, player_rocketload2 ] {self.weaponframe=4;};
void() player_rocketload2 =[$rockatt3, player_rocketload3 ] {self.weaponframe=5;}; void() player_rocketload2 =[$rockatt3, player_rocketload3 ] {self.weaponframe=5;};
@ -428,22 +363,17 @@ void() player_rocketload3 =[$rockatt4, player_rocketload4 ] {self.weaponframe
void() player_rocketload4 =[$rockatt5, player_rocketload5 ] {self.weaponframe=7;}; void() player_rocketload4 =[$rockatt5, player_rocketload5 ] {self.weaponframe=7;};
void() player_rocketload5 =[$rockatt6, player_rocketload6 ] {self.weaponframe=8;}; void() player_rocketload5 =[$rockatt6, player_rocketload6 ] {self.weaponframe=8;};
void() player_rocketload6 =[$rockatt4, player_run ] {self.weaponframe=9;}; void() player_rocketload6 =[$rockatt4, player_run ] {self.weaponframe=9;};
void(float num_bubbles) DeathBubbles; void(float num_bubbles) DeathBubbles;
void() PainSound = void() PainSound =
{ {
local float rs; local float rs;
if (self.health < 0) if (self.health < 0)
return; return;
if (damage_attacker.classname == "teledeath") if (damage_attacker.classname == "teledeath")
{ {
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
return; return;
} }
// water pain sounds // water pain sounds
if (self.watertype == CONTENT_WATER && self.waterlevel == 3) if (self.watertype == CONTENT_WATER && self.waterlevel == 3)
{ {
@ -454,7 +384,6 @@ local float rs;
sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
return; return;
} }
// slime pain sounds // slime pain sounds
if (self.watertype == CONTENT_SLIME) if (self.watertype == CONTENT_SLIME)
{ {
@ -465,7 +394,6 @@ local float rs;
sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
return; return;
} }
if (self.watertype == CONTENT_LAVA) if (self.watertype == CONTENT_LAVA)
{ {
if (random() > 0.5) if (random() > 0.5)
@ -474,16 +402,13 @@ local float rs;
sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
return; return;
} }
if (self.pain_finished > time) if (self.pain_finished > time)
{ {
self.axhitme = 0; self.axhitme = 0;
return; return;
} }
self.pain_finished = time + 0.5; self.pain_finished = time + 0.5;
// don't make multiple pain sounds right after each other // don't make multiple pain sounds right after each other
// ax pain sound // ax pain sound
if (self.axhitme == 1) if (self.axhitme == 1)
{ {
@ -492,9 +417,7 @@ local float rs;
return; return;
} }
rs = rint((random() * 5) + 1); rs = rint((random() * 5) + 1);
self.noise = ""; self.noise = "";
if (rs == 1) if (rs == 1)
self.noise = "player/pain1.wav"; self.noise = "player/pain1.wav";
@ -508,46 +431,38 @@ local float rs;
self.noise = "player/pain5.wav"; self.noise = "player/pain5.wav";
else else
self.noise = "player/pain6.wav"; self.noise = "player/pain6.wav";
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
return; return;
}; };
void() player_pain1 = [ $pain1, player_pain2 ] {PainSound();self.weaponframe=0;}; void() player_pain1 = [ $pain1, player_pain2 ] {PainSound();self.weaponframe=0;};
void() player_pain2 = [ $pain2, player_pain3 ] {}; void() player_pain2 = [ $pain2, player_pain3 ] {};
void() player_pain3 = [ $pain3, player_pain4 ] {}; void() player_pain3 = [ $pain3, player_pain4 ] {};
void() player_pain4 = [ $pain4, player_pain5 ] {}; void() player_pain4 = [ $pain4, player_pain5 ] {};
void() player_pain5 = [ $pain5, player_pain6 ] {}; void() player_pain5 = [ $pain5, player_pain6 ] {};
void() player_pain6 = [ $pain6, player_run ] {}; void() player_pain6 = [ $pain6, player_run ] {};
void() player_axpain1 = [ $axpain1, player_axpain2 ] {PainSound();self.weaponframe=0;}; void() player_axpain1 = [ $axpain1, player_axpain2 ] {PainSound();self.weaponframe=0;};
void() player_axpain2 = [ $axpain2, player_axpain3 ] {}; void() player_axpain2 = [ $axpain2, player_axpain3 ] {};
void() player_axpain3 = [ $axpain3, player_axpain4 ] {}; void() player_axpain3 = [ $axpain3, player_axpain4 ] {};
void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; void() player_axpain4 = [ $axpain4, player_axpain5 ] {};
void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; void() player_axpain5 = [ $axpain5, player_axpain6 ] {};
void() player_axpain6 = [ $axpain6, player_run ] {}; void() player_axpain6 = [ $axpain6, player_run ] {};
void(entity attacker, float damage) player_pain = void(entity attacker, float damage) player_pain =
{ {
if (self.weaponframe) if (self.weaponframe)
return; return;
if (self.invisible_finished > time) if (self.invisible_finished > time)
return; // eyes don't have pain frames return; // eyes don't have pain frames
if (self.weapon == IT_AXE) if (self.weapon == IT_AXE)
player_axpain1 (); player_axpain1 ();
else else
player_pain1 (); player_pain1 ();
}; };
void() player_diea1; void() player_diea1;
void() player_dieb1; void() player_dieb1;
void() player_diec1; void() player_diec1;
void() player_died1; void() player_died1;
void() player_diee1; void() player_diee1;
void() player_die_ax1; void() player_die_ax1;
void() DeathBubblesSpawn = void() DeathBubblesSpawn =
{ {
local entity bubble; local entity bubble;
@ -571,7 +486,6 @@ local entity bubble;
if (self.air_finished >= self.bubble_count) if (self.air_finished >= self.bubble_count)
remove(self); remove(self);
}; };
void(float num_bubbles) DeathBubbles = void(float num_bubbles) DeathBubbles =
{ {
local entity bubble_spawner; local entity bubble_spawner;
@ -587,12 +501,9 @@ local entity bubble_spawner;
bubble_spawner.bubble_count = num_bubbles; bubble_spawner.bubble_count = num_bubbles;
return; return;
}; };
void() DeathSound = void() DeathSound =
{ {
local float rs; local float rs;
// water death sounds // water death sounds
if (self.waterlevel == 3) if (self.waterlevel == 3)
{ {
@ -612,23 +523,18 @@ local float rs;
self.noise = "player/death4.wav"; self.noise = "player/death4.wav";
if (rs == 5) if (rs == 5)
self.noise = "player/death5.wav"; self.noise = "player/death5.wav";
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE); sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
return; return;
}; };
void() PlayerDead = void() PlayerDead =
{ {
self.nextthink = -1; self.nextthink = -1;
// allow respawn after a certain time // allow respawn after a certain time
self.deadflag = DEAD_DEAD; self.deadflag = DEAD_DEAD;
}; };
vector(float dm) VelocityForDamage = vector(float dm) VelocityForDamage =
{ {
local vector v; local vector v;
if (vlen(damage_inflictor.velocity)>0) if (vlen(damage_inflictor.velocity)>0)
{ {
v = 0.5 * damage_inflictor.velocity; v = 0.5 * damage_inflictor.velocity;
@ -644,11 +550,9 @@ vector(float dm) VelocityForDamage =
v_y = 100 * crandom(); v_y = 100 * crandom();
v_z = 200 + 100 * random(); v_z = 200 + 100 * random();
} }
//v_x = 100 * crandom(); //v_x = 100 * crandom();
//v_y = 100 * crandom(); //v_y = 100 * crandom();
//v_z = 200 + 100 * random(); //v_z = 200 + 100 * random();
if (dm > -50) if (dm > -50)
{ {
// dprint ("level 1\n"); // dprint ("level 1\n");
@ -661,14 +565,11 @@ vector(float dm) VelocityForDamage =
} }
else else
v = v * 10; v = v * 10;
return v; return v;
}; };
void(string gibname, float dm) ThrowGib = void(string gibname, float dm) ThrowGib =
{ {
local entity new; local entity new;
new = spawn(); new = spawn();
new.origin = self.origin; new.origin = self.origin;
setmodel (new, gibname); setmodel (new, gibname);
@ -685,7 +586,6 @@ void(string gibname, float dm) ThrowGib =
new.frame = 0; new.frame = 0;
new.flags = 0; new.flags = 0;
}; };
void(string gibname, float dm) ThrowHead = void(string gibname, float dm) ThrowHead =
{ {
setmodel (self, gibname); setmodel (self, gibname);
@ -701,8 +601,6 @@ void(string gibname, float dm) ThrowHead =
self.flags = self.flags - (self.flags & FL_ONGROUND); self.flags = self.flags - (self.flags & FL_ONGROUND);
self.avelocity = crandom() * '0 600 0'; self.avelocity = crandom() * '0 600 0';
}; };
void() GibPlayer = void() GibPlayer =
{ {
@ -714,15 +612,12 @@ void() GibPlayer =
ThrowGib ("progs/gib1.mdl", self.health); ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health); ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health); ThrowGib ("progs/gib3.mdl", self.health);
self.deadflag = DEAD_DEAD; self.deadflag = DEAD_DEAD;
if (damage_attacker.classname == "teledeath") if (damage_attacker.classname == "teledeath")
{ {
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
return; return;
} }
if (damage_attacker.classname == "teledeath2") if (damage_attacker.classname == "teledeath2")
{ {
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
@ -734,14 +629,12 @@ void() GibPlayer =
else else
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE);
}; };
void() PlayerDie = void() PlayerDie =
{ {
local float i; local float i;
local string s; local string s;
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items - (self.items & IT_INVISIBILITY);
if ((stof(infokey(world,"dq"))) != 0) if ((stof(infokey(world,"dq"))) != 0)
{ {
if (self.super_damage_finished > 0) if (self.super_damage_finished > 0)
@ -757,7 +650,6 @@ void() PlayerDie =
bprint (PRINT_LOW, " seconds remaining\n"); bprint (PRINT_LOW, " seconds remaining\n");
} }
} }
if ((stof(infokey(world,"dr"))) != 0) if ((stof(infokey(world,"dr"))) != 0)
{ {
if (self.invisible_finished > 0) if (self.invisible_finished > 0)
@ -770,7 +662,6 @@ void() PlayerDie =
DropRing (self.invisible_finished - time); DropRing (self.invisible_finished - time);
} }
} }
self.invisible_finished = 0; // don't die as eyes self.invisible_finished = 0; // don't die as eyes
self.invincible_finished = 0; self.invincible_finished = 0;
self.super_damage_finished = 0; self.super_damage_finished = 0;
@ -826,9 +717,7 @@ void() PlayerDie =
player_died1(); player_died1();
else else
player_diee1(); player_diee1();
}; };
void() set_suicide_frame = void() set_suicide_frame =
{ // used by klill command and diconnect command { // used by klill command and diconnect command
if (self.model != "progs/player.mdl") if (self.model != "progs/player.mdl")
@ -839,8 +728,6 @@ void() set_suicide_frame =
self.deadflag = DEAD_DEAD; self.deadflag = DEAD_DEAD;
self.nextthink = -1; self.nextthink = -1;
}; };
void() player_diea1 = [ $deatha1, player_diea2 ] {}; void() player_diea1 = [ $deatha1, player_diea2 ] {};
void() player_diea2 = [ $deatha2, player_diea3 ] {}; void() player_diea2 = [ $deatha2, player_diea3 ] {};
void() player_diea3 = [ $deatha3, player_diea4 ] {}; void() player_diea3 = [ $deatha3, player_diea4 ] {};
@ -852,7 +739,6 @@ void() player_diea8 = [ $deatha8, player_diea9 ] {};
void() player_diea9 = [ $deatha9, player_diea10 ] {}; void() player_diea9 = [ $deatha9, player_diea10 ] {};
void() player_diea10 = [ $deatha10, player_diea11 ] {}; void() player_diea10 = [ $deatha10, player_diea11 ] {};
void() player_diea11 = [ $deatha11, player_diea11 ] {PlayerDead();}; void() player_diea11 = [ $deatha11, player_diea11 ] {PlayerDead();};
void() player_dieb1 = [ $deathb1, player_dieb2 ] {}; void() player_dieb1 = [ $deathb1, player_dieb2 ] {};
void() player_dieb2 = [ $deathb2, player_dieb3 ] {}; void() player_dieb2 = [ $deathb2, player_dieb3 ] {};
void() player_dieb3 = [ $deathb3, player_dieb4 ] {}; void() player_dieb3 = [ $deathb3, player_dieb4 ] {};
@ -862,7 +748,6 @@ void() player_dieb6 = [ $deathb6, player_dieb7 ] {};
void() player_dieb7 = [ $deathb7, player_dieb8 ] {}; void() player_dieb7 = [ $deathb7, player_dieb8 ] {};
void() player_dieb8 = [ $deathb8, player_dieb9 ] {}; void() player_dieb8 = [ $deathb8, player_dieb9 ] {};
void() player_dieb9 = [ $deathb9, player_dieb9 ] {PlayerDead();}; void() player_dieb9 = [ $deathb9, player_dieb9 ] {PlayerDead();};
void() player_diec1 = [ $deathc1, player_diec2 ] {}; void() player_diec1 = [ $deathc1, player_diec2 ] {};
void() player_diec2 = [ $deathc2, player_diec3 ] {}; void() player_diec2 = [ $deathc2, player_diec3 ] {};
void() player_diec3 = [ $deathc3, player_diec4 ] {}; void() player_diec3 = [ $deathc3, player_diec4 ] {};
@ -878,7 +763,6 @@ void() player_diec12 = [ $deathc12, player_diec13 ] {};
void() player_diec13 = [ $deathc13, player_diec14 ] {}; void() player_diec13 = [ $deathc13, player_diec14 ] {};
void() player_diec14 = [ $deathc14, player_diec15 ] {}; void() player_diec14 = [ $deathc14, player_diec15 ] {};
void() player_diec15 = [ $deathc15, player_diec15 ] {PlayerDead();}; void() player_diec15 = [ $deathc15, player_diec15 ] {PlayerDead();};
void() player_died1 = [ $deathd1, player_died2 ] {}; void() player_died1 = [ $deathd1, player_died2 ] {};
void() player_died2 = [ $deathd2, player_died3 ] {}; void() player_died2 = [ $deathd2, player_died3 ] {};
void() player_died3 = [ $deathd3, player_died4 ] {}; void() player_died3 = [ $deathd3, player_died4 ] {};
@ -888,7 +772,6 @@ void() player_died6 = [ $deathd6, player_died7 ] {};
void() player_died7 = [ $deathd7, player_died8 ] {}; void() player_died7 = [ $deathd7, player_died8 ] {};
void() player_died8 = [ $deathd8, player_died9 ] {}; void() player_died8 = [ $deathd8, player_died9 ] {};
void() player_died9 = [ $deathd9, player_died9 ] {PlayerDead();}; void() player_died9 = [ $deathd9, player_died9 ] {PlayerDead();};
void() player_diee1 = [ $deathe1, player_diee2 ] {}; void() player_diee1 = [ $deathe1, player_diee2 ] {};
void() player_diee2 = [ $deathe2, player_diee3 ] {}; void() player_diee2 = [ $deathe2, player_diee3 ] {};
void() player_diee3 = [ $deathe3, player_diee4 ] {}; void() player_diee3 = [ $deathe3, player_diee4 ] {};
@ -898,7 +781,6 @@ void() player_diee6 = [ $deathe6, player_diee7 ] {};
void() player_diee7 = [ $deathe7, player_diee8 ] {}; void() player_diee7 = [ $deathe7, player_diee8 ] {};
void() player_diee8 = [ $deathe8, player_diee9 ] {}; void() player_diee8 = [ $deathe8, player_diee9 ] {};
void() player_diee9 = [ $deathe9, player_diee9 ] {PlayerDead();}; void() player_diee9 = [ $deathe9, player_diee9 ] {PlayerDead();};
void() player_die_ax1 = [ $axdeth1, player_die_ax2 ] {}; void() player_die_ax1 = [ $axdeth1, player_die_ax2 ] {};
void() player_die_ax2 = [ $axdeth2, player_die_ax3 ] {}; void() player_die_ax2 = [ $axdeth2, player_die_ax3 ] {};
void() player_die_ax3 = [ $axdeth3, player_die_ax4 ] {}; void() player_die_ax3 = [ $axdeth3, player_die_ax4 ] {};

View file

@ -1,48 +1,36 @@
// POX - bunch of new variable declarations and prototypes for POXworld // POX - bunch of new variable declarations and prototypes for POXworld
//New stuff for timing second triggers and other weapon stuff //New stuff for timing second triggers and other weapon stuff
.float prime_tshot; //this is set when tShot is primed for a triple barrel fire .float prime_tshot; //this is set when tShot is primed for a triple barrel fire
.float st_tshotload; //used to time out the tSot's trigger during reload .float st_tshotload; //used to time out the tSot's trigger during reload
.float st_sshotgun; //next attack for ComboGun .float st_sshotgun; //next attack for ComboGun
.float st_pball; //next attack for Impact grenade .float st_pball; //next attack for Impact grenade
.float which_ammo; //used to clean up ammo switching for ComboGun .float which_ammo; //used to clean up ammo switching for ComboGun
.float st_mplasma; //next attack for MegaPlasma Burst .float st_mplasma; //next attack for MegaPlasma Burst
.float st_plasma; //next attack for PlasmaGun .float st_plasma; //next attack for PlasmaGun
.float LorR; //sets which barrel to use for next PlasmaGun shot .float LorR; //sets which barrel to use for next PlasmaGun shot
.float st_mine; //next attack for PhaseMine .float st_mine; //next attack for PhaseMine
.float st_grenade; //next attack for Grenades .float st_grenade; //next attack for Grenades
.float no_obj; //fixes a problem with 'hanging' mines on breakable objects destroyed be something else .float no_obj; //fixes a problem with 'hanging' mines on breakable objects destroyed be something else
.entity spawnmaster; .entity spawnmaster;
.entity lastowner; .entity lastowner;
.float st_nailgun; //next attack for Nailgun .float st_nailgun; //next attack for Nailgun
.float st_shrapnel; //next attack for ShrapnelBomb .float st_shrapnel; //next attack for ShrapnelBomb
.float shrap_detonate; //decide whether to launch or detonate a ShrapnelBomb .float shrap_detonate; //decide whether to launch or detonate a ShrapnelBomb
.float shrap_time; //holds the bombs time out (2 minutes then boom) - just in case owner died .float shrap_time; //holds the bombs time out (2 minutes then boom) - just in case owner died
.float reload_rocket; //keeps count of rockets fired .float reload_rocket; //keeps count of rockets fired
.float st_rocketload; //used to time out the rhino's trigger during reload .float st_rocketload; //used to time out the rhino's trigger during reload
.float missfire_finished; //used to seperate attacks and missfires (POXnote : DO I STILL NEED THIS?) .float missfire_finished; //used to seperate attacks and missfires (POXnote : DO I STILL NEED THIS?)
.float nobleed; //set to TRUE for triggers, breakable objects, buttons, etc... .float nobleed; //set to TRUE for triggers, breakable objects, buttons, etc...
// Footsteps // Footsteps
.float spawnsilent; .float spawnsilent;
.vector old_velocity; .vector old_velocity;
//POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM) //POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM)
void() func_earthquake = {remove(self);}; void() func_earthquake = {remove(self);};
//Water Movement //Water Movement
.float uwmuffle; //underwater muffle sound timeout .float uwmuffle; //underwater muffle sound timeout
.float onwsound; //on water sound timeout .float onwsound; //on water sound timeout
.float outwsound; //head out of water sound flag .float outwsound; //head out of water sound flag
.float inwsound; //head in water sound flag .float inwsound; //head in water sound flag
//New DM option constants //New DM option constants
float DM_PREDATOR = 2; float DM_PREDATOR = 2;
float DM_DARK = 4; float DM_DARK = 4;
@ -50,7 +38,6 @@ float DM_LMS = 8;
float DM_FFA = 16; float DM_FFA = 16;
float DM_GIB = 32; float DM_GIB = 32;
float DM_AUTOSWITCH = 128; float DM_AUTOSWITCH = 128;
float fraglimit_LMS; // stores the fraglimit at worldspawn so it can't be changed during a game float fraglimit_LMS; // stores the fraglimit at worldspawn so it can't be changed during a game
float lms_plrcount; // Keeps track of the number of players in an LMS game float lms_plrcount; // Keeps track of the number of players in an LMS game
float lms_gameover; // Lets CheckRules know when one or zero players are left float lms_gameover; // Lets CheckRules know when one or zero players are left
@ -59,26 +46,20 @@ float lms_gameover; // Lets CheckRules know when one or zero players are left
.float LMS_observer_fov; // Stores observer's current fov .float LMS_observer_fov; // Stores observer's current fov
.float LMS_zoom; // 1 = zoom in, 2 = zoom out, 0 = stop .float LMS_zoom; // 1 = zoom in, 2 = zoom out, 0 = stop
.float LMS_observer_time; // times the display of observer instructions .float LMS_observer_time; // times the display of observer instructions
//Dark Mode stuff... //Dark Mode stuff...
.float flash_flag; // flashlight toggle (no user toggle) .float flash_flag; // flashlight toggle (no user toggle)
.entity flash; // flash entity .entity flash; // flash entity
// Moved here for use in weapons.qc // Moved here for use in weapons.qc
float intermission_running; float intermission_running;
.float gl_fix; //a hack for toggling gl_flashblend .float gl_fix; //a hack for toggling gl_flashblend
//Used by Target ID impulse //Used by Target ID impulse
.float target_id_finished; .float target_id_finished;
.float target_id_toggle; .float target_id_toggle;
.float target_id_same; .float target_id_same;
.entity last_target_id; .entity last_target_id;
void(entity client, string s1, string s2, string s3, string s4) centerprint4 = #73; void(entity client, string s1, string s2, string s3, string s4) centerprint4 = #73;
//POX v1.2 - improved reseting of colour_light //POX v1.2 - improved reseting of colour_light
.float cshift_finished; .float cshift_finished;
.float cshift_off; .float cshift_off;
//POX 1.2 - allows idtarget state to be saved across levelchanges //POX 1.2 - allows idtarget state to be saved across levelchanges
.float target_id_temp; .float target_id_temp;

View file

@ -2,17 +2,13 @@
void(float shotcount, vector dir, vector spread) FireBullets2; void(float shotcount, vector dir, vector spread) FireBullets2;
void(float damage) spawn_touchblood; void(float damage) spawn_touchblood;
void() muzzleflash; void() muzzleflash;
void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; void (entity targ, entity inflictor, entity attacker, float damage) T_Damage;
void () player_run; void () player_run;
void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage; void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage;
void(vector org, float damage) SpawnBlood; void(vector org, float damage) SpawnBlood;
void() SuperDamageSound; void() SuperDamageSound;
float SECOND_TRIGGER = 15; // Impulse constant for second trigger (more readable than 15) float SECOND_TRIGGER = 15; // Impulse constant for second trigger (more readable than 15)
void(vector org) launch_shrapnel; //Predeclare void(vector org) launch_shrapnel; //Predeclare
void() player_shot1; void() player_shot1;
void() player_gshot1; void() player_gshot1;
void() player_plasma1; void() player_plasma1;
@ -30,12 +26,10 @@ void() player_axeb1;
void() player_axec1; void() player_axec1;
void() player_axed1; void() player_axed1;
//Some nitty-gritty from weapons.qc ... //Some nitty-gritty from weapons.qc ...
float() crandom = float() crandom =
{ {
return 2*(random() - 0.5); return 2 * (random() - 0.5);
}; };
@ -50,7 +44,6 @@ vector() wall_velocity =
return vel; return vel;
}; };
/* /*
================ ================
Triple Barrel Shot for T-shot Triple Barrel Shot for T-shot
@ -77,7 +70,6 @@ void() W_FireTShot =
FireBullets2 (12, dir, '0.16 0.1 0'); //make priming this thing worth while! FireBullets2 (12, dir, '0.16 0.1 0'); //make priming this thing worth while!
}; };
//================================================================================= //=================================================================================
//Start MegaPlasmaBurst - Used by PlasmaGun's Second Trigger //Start MegaPlasmaBurst - Used by PlasmaGun's Second Trigger
//================================================================================= //=================================================================================
@ -95,12 +87,10 @@ void() T_MplasmaTouch =
self.voided = 1; self.voided = 1;
if (pointcontents(self.origin) == CONTENT_SKY) if (pointcontents(self.origin) == CONTENT_SKY) {
{
remove(self); remove(self);
return; return;
} }
damg = 120 + random()*20; damg = 120 + random()*20;
T_RadiusDamage (self, self.owner, damg, world, "megaplasma"); T_RadiusDamage (self, self.owner, damg, world, "megaplasma");
@ -114,14 +104,10 @@ void() T_MplasmaTouch =
WriteCoord (MSG_MULTICAST, self.origin_y); WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z); WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS); multicast (self.origin, MULTICAST_PHS);
remove(self); remove(self);
}; };
//launch_megaplasma //launch_megaplasma
void() launch_megaplasma = void() launch_megaplasma =
{ {
local vector dir; local vector dir;
@ -129,7 +115,6 @@ void() launch_megaplasma =
self.currentammo = self.ammo_cells = self.ammo_cells - 9; self.currentammo = self.ammo_cells = self.ammo_cells - 9;
sound (self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM);
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_BIGKICK); WriteByte (MSG_ONE, SVC_BIGKICK);
@ -145,7 +130,7 @@ void() launch_megaplasma =
newmis.classname = "megaplasma"; newmis.classname = "megaplasma";
newmis.effects = newmis.effects | EF_BLUE; newmis.effects = newmis.effects | EF_BLUE;
// set speed // set speed
dir = aim ( self, 1000 ); dir = aim ( self, 1000 );
newmis.velocity = dir * 0.01; newmis.velocity = dir * 0.01;
newmis.avelocity = '300 300 300'; newmis.avelocity = '300 300 300';
@ -155,28 +140,23 @@ void() launch_megaplasma =
newmis.touch = T_MplasmaTouch; newmis.touch = T_MplasmaTouch;
// set duration // set duration
newmis.think = SUB_Remove; newmis.think = SUB_Remove;
newmis.nextthink = time + 5; newmis.nextthink = time + 5;
setmodel (newmis, "progs/plasma.mdl"); setmodel (newmis, "progs/plasma.mdl");
setsize (newmis, '0 0 0', '0 0 0'); setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin + v_forward*12 + '0 0 12'); setorigin (newmis, self.origin + v_forward*12 + '0 0 12');
}; };
//End MegaPlasmaBurst //End MegaPlasmaBurst
//================================================================================= //=================================================================================
//============================================================================= //=============================================================================
// //
// START PumkinBall CODE - Used by SuperShotgun's Second Trigger (Impact Grenades) // START PumkinBall CODE - Used by SuperShotgun's Second Trigger (Impact Grenades)
// //
//============================================================================= //=============================================================================
void() T_PballTouch = void() T_PballTouch =
{ {
local float damg; local float damg;
if (other == self.owner) if (other == self.owner)
return; // don't explode on owner return; // don't explode on owner
@ -193,7 +173,6 @@ void() T_PballTouch =
} }
damg = 100 + random()*20; damg = 100 + random()*20;
T_RadiusDamage (self, self.owner, damg, world, "impactgrenade"); T_RadiusDamage (self, self.owner, damg, world, "impactgrenade");
// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); // sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
@ -205,10 +184,8 @@ void() T_PballTouch =
WriteCoord (MSG_MULTICAST, self.origin_y); WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z); WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS); multicast (self.origin, MULTICAST_PHS);
remove(self); remove(self);
}; };
/* /*
================ ================
W_FirePball W_FirePball
@ -216,11 +193,9 @@ W_FirePball
*/ */
void() W_FirePball = void() W_FirePball =
{ {
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_AUTO, "weapons/ssgrnde.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/gren2.wav", 1, ATTN_NORM);
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_BIGKICK); WriteByte (MSG_ONE, SVC_BIGKICK);
@ -235,29 +210,24 @@ void() W_FirePball =
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.classname = "impactgrenade"; newmis.classname = "impactgrenade";
// set newmis speed // set newmis speed
makevectors (self.v_angle); makevectors (self.v_angle);
newmis.velocity = v_forward*700 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; newmis.velocity = v_forward*700 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
newmis.angles = vectoangles(newmis.velocity); newmis.angles = vectoangles(newmis.velocity);
newmis.touch = T_PballTouch; newmis.touch = T_PballTouch;
// set newmis duration // set newmis duration
newmis.nextthink = time + 2.5; newmis.think = SUB_Remove;
newmis.nextthink = time + 5;
setmodel (newmis, "progs/grenade.mdl"); setmodel (newmis, "progs/grenade.mdl");
setsize (newmis, '0 0 0', '0 0 0'); setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin + v_forward*4); setorigin (newmis, self.origin + v_forward*4);
}; };
// END PumkinBall CODE // END PumkinBall CODE
//============================================================================= //=============================================================================
//============================================================================= //=============================================================================
// //
// START MINE CODE (based on hipnotic's proximity mine - uh... hacked to death) // START MINE CODE (based on hipnotic's proximity mine - uh... hacked to death)
@ -266,12 +236,11 @@ void() W_FirePball =
// But it works. // But it works.
// //
//============================================================================= //=============================================================================
void() M_DamExplode = void() M_DamExplode =
{ {
if (self.voided) { if (self.voided)
return; return;
}
self.voided = 1; self.voided = 1;
T_RadiusDamage (self, self.owner, 95, world, "mine"); T_RadiusDamage (self, self.owner, 95, world, "mine");
@ -284,13 +253,11 @@ void() M_DamExplode =
remove (self); remove (self);
}; };
/* /*
================ ================
MineExplode MineExplode
================ ================
*/ */
//explode immediately! (for doors, plats and breakable objects //explode immediately! (for doors, plats and breakable objects
void() MineImExplode = void() MineImExplode =
{ {
@ -315,58 +282,48 @@ MineTouch
================ ================
*/ */
void() MineTouch = void() MineTouch =
{ {
if (other == self) if (other == self)
{
return; return;
}
if (other.solid == SOLID_TRIGGER) {
if (other.solid == SOLID_TRIGGER)
{
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
return; return;
} }
if (other.classname == "grenade") if (other.classname == "grenade") {
{
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1; self.nextthink = time + 1;
return; return;
} }
if (other.classname == "mine") if (other.classname == "mine") {
{
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1; self.nextthink = time + 1;
return; return;
} }
if (other.classname == "minearm") if (other.classname == "minearm") {
{
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1; self.nextthink = time + 1;
return; return;
} }
if (other.classname == "minearmed") if (other.classname == "minearmed") {
{
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
self.classname = "minearm"; self.classname = "minearm";
self.nextthink = time + 1; self.nextthink = time + 1;
return; return;
} }
if (other.classname == "player") if (other.classname == "player") {
{
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
MineExplode(); MineExplode();
self.nextthink = time + 0.4; self.nextthink = time + 0.4;
return; return;
} }
if (other.takedamage == DAMAGE_AIM) if (other.takedamage == DAMAGE_AIM) {
{
MineExplode(); MineExplode();
self.think(); self.think();
return; return;
@ -377,19 +334,17 @@ void() MineTouch =
self.spawnmaster = other; self.spawnmaster = other;
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
/* /*
================ ================
MineArm MineArm
================ ================
*/ */
void() MineArm = void() MineArm =
{ {
local entity head; local entity head;
local float detonate; local float detonate;
if (self.classname == "minearm") if (self.classname == "minearm") {
{
sound (self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM);
setsize (self, '-3 -3 -3', '3 3 3'); setsize (self, '-3 -3 -3', '3 3 3');
self.owner = world; self.owner = world;
@ -398,7 +353,6 @@ void() MineArm =
self.classname = "minearmed"; self.classname = "minearmed";
muzzleflash(); //Will this work? muzzleflash(); //Will this work?
} }
if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE)) if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE))
{ {
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
@ -420,29 +374,26 @@ void() MineArm =
// Ogres still don't always detonate mines (?) // Ogres still don't always detonate mines (?)
head = findradius(self.origin, 39); head = findradius(self.origin, 39);
detonate = 0; detonate = 0;
if (self.health < 0) if (self.health < 0)
detonate = 1; detonate = 1;
while (head) while (head) {
{
if ((head != self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=self.classname)) if ((head != self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=self.classname))
detonate = 1; detonate = 1;
traceline(self.origin, head.origin, TRUE, self);
traceline(self.origin,head.origin,TRUE,self);
if (trace_fraction != 1.0) if (trace_fraction != 1.0)
detonate = 0; detonate = 0;
if (detonate==1) if (detonate==1) {
{ sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); MineExplode();
MineExplode(); self.nextthink = time + 0.25;
self.nextthink = time + 0.25; return;
return; }
}
head = head.chain; head = head.chain;
} }
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
/* /*
@ -453,8 +404,7 @@ W_FireMine
void() W_FireMine = void() W_FireMine =
{ {
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM);
sound (self, CHAN_AUTO, "weapons/ssgrnde.wav", 1, ATTN_NORM);
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK); WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -476,40 +426,33 @@ void() W_FireMine =
//POX v1.2 - mines don't bleed.... //POX v1.2 - mines don't bleed....
newmis.nobleed = TRUE; newmis.nobleed = TRUE;
// set missile speed // set missile speed
makevectors (self.v_angle); makevectors (self.v_angle);
if (self.v_angle_x) {
if (self.v_angle_x)
newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
else } else {
{
newmis.velocity = aim(self, 10000); newmis.velocity = aim(self, 10000);
newmis.velocity = newmis.velocity * 600; newmis.velocity = newmis.velocity * 600;
newmis.velocity_z = 200; newmis.velocity_z = 200;
} }
newmis.avelocity = '100 600 100'; newmis.avelocity = '100 600 100';
newmis.angles = vectoangles(newmis.velocity);
newmis.touch = MineTouch;
newmis.angles = vectoangles(newmis.velocity); // set missile duration
newmis.nextthink = time + 0.2;
newmis.delay = time + 60;
newmis.think = MineArm;
newmis.th_die = MineExplode;
newmis.touch = MineTouch; setmodel (newmis, "progs/grenade.mdl");
setorigin (newmis, self.origin + v_forward*4);
// set missile duration setsize (newmis, '-1 -1 -1', '0 0 0');
newmis.nextthink = time + 0.2;
newmis.delay = time + 15;
newmis.think = MineArm;
newmis.th_die = MineExplode;
setmodel (newmis, "progs/grenade.mdl");
setorigin (newmis, self.origin + v_forward*4);
setsize (newmis, '-1 -1 -1', '0 0 0');
}; };
// END MINE CODE // END MINE CODE
//=============================================================================
//=============================================================================
//============================================================================= //=============================================================================
// //
@ -519,34 +462,30 @@ void() W_FireMine =
//---------------------------------------------------------- //----------------------------------------------------------
//These functions launch a single spike in a random direction //These functions launch a single spike in a random direction
void() spikenal_touch = void() spikenal_touch =
{ {
if (pointcontents(self.origin) == CONTENT_SKY) {
remove(self);
return;
}
if (self.voided) { if (self.voided) {
return; return;
} }
self.voided = 1; self.voided = 1;
if (other.solid == SOLID_TRIGGER) if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
// hit something that bleeds // hit something that bleeds
if (other.takedamage) if (other.takedamage) {
{
spawn_touchblood (12); spawn_touchblood (12);
other.deathtype = "shrapnel"; other.deathtype = "shrapnel";
T_Damage (other, self, self.owner, 12); T_Damage (other, self, self.owner, 12);
remove(self); remove(self);
} }
else if (random() > 0.9) else if (random() > 0.9) {
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_SPIKE); WriteByte (MSG_MULTICAST, TE_SPIKE);
WriteCoord (MSG_MULTICAST, self.origin_x); WriteCoord (MSG_MULTICAST, self.origin_x);
@ -555,14 +494,12 @@ void() spikenal_touch =
multicast (self.origin, MULTICAST_PHS); multicast (self.origin, MULTICAST_PHS);
remove(self); remove(self);
} }
}; };
//POX - Get a random vector for Shrapnel //POX - Get a random vector for Shrapnel
vector() VelocityForShrapnel = vector() VelocityForShrapnel =
{ {
local vector v; local vector v;
v_x = 200 * crandom(); v_x = 200 * crandom();
v_y = 200 * crandom(); v_y = 200 * crandom();
v_z = 200 * crandom(); v_z = 200 * crandom();
@ -571,7 +508,6 @@ vector() VelocityForShrapnel =
v_z = v_z - (v_z*2); v_z = v_z - (v_z*2);
v = v * 6; v = v * 6;
return v; return v;
}; };
@ -579,31 +515,29 @@ vector() VelocityForShrapnel =
void(vector org) launch_shrapnel = void(vector org) launch_shrapnel =
{ {
newmis = spawn (); newmis = spawn ();
newmis.voided = 0; newmis.voided = 0;
newmis.owner = self.owner; newmis.owner = self.owner;
newmis.movetype = MOVETYPE_BOUNCE; newmis.movetype = MOVETYPE_BOUNCE;
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.touch = spikenal_touch; newmis.touch = spikenal_touch;
newmis.classname = "spikenal"; newmis.classname = "spikenal";
newmis.velocity = VelocityForShrapnel(); newmis.velocity = VelocityForShrapnel();
newmis.avelocity_x = random()*800; newmis.avelocity_x = random()*800;
newmis.avelocity_y = random()*800; newmis.avelocity_y = random()*800;
newmis.avelocity_z = random()*800; newmis.avelocity_z = random()*800;
newmis.think = SUB_Remove; newmis.think = SUB_Remove;
newmis.nextthink = time + 3; newmis.nextthink = time + 3;
setmodel (newmis, "progs/mwrub1.mdl"); setmodel (newmis, "progs/mwrub1.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, org); setorigin (newmis, org);
}; };
//---------------------------------------------------------- //----------------------------------------------------------
//and now the bomb code... //and now the bomb code...
void() ShrapnelExplode = void() ShrapnelExplode =
{ {
if (self.voided) { if (self.voided) {
@ -611,18 +545,16 @@ void() ShrapnelExplode =
} }
self.voided = 1; self.voided = 1;
//POX - 1.0b1 - A LOT less Shrapnel! // Toss the nails (this function is with the spike stuff since it uses the same touch)
launch_shrapnel(self.origin); launch_shrapnel(self.origin);
launch_shrapnel(self.origin); launch_shrapnel(self.origin);
launch_shrapnel(self.origin); launch_shrapnel(self.origin);
launch_shrapnel(self.origin); launch_shrapnel(self.origin);
launch_shrapnel(self.origin); launch_shrapnel(self.origin);
T_RadiusDamage (self, self.owner, 160, world, "shrapnel"); T_RadiusDamage (self, self.owner, 160, world, "shrapnel");
if (self.owner != world) if (self.owner != world)
self.owner.shrap_detonate = FALSE;//Enable next launch self.owner.shrap_detonate = FALSE; // Enable next launch
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION); WriteByte (MSG_MULTICAST, TE_EXPLOSION);
@ -630,7 +562,6 @@ void() ShrapnelExplode =
WriteCoord (MSG_MULTICAST, self.origin_y); WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z); WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS); multicast (self.origin, MULTICAST_PHS);
remove (self); remove (self);
}; };
@ -641,7 +572,7 @@ void() ShrapnelDetonate =
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
//Wait for a detonation impulse or time up // Wait for a detonation impulse or time up
void() ShrapnelThink = void() ShrapnelThink =
{ {
if (self.shrap_time < time) if (self.shrap_time < time)
@ -650,9 +581,8 @@ void() ShrapnelThink =
if (self.owner == world) if (self.owner == world)
return; return;
//Owner died so change to world and wait for detonate // Owner died so change to world and wait for detonate
if (self.owner.health <= 0) if (self.owner.health <= 0) {
{
self.owner.shrap_detonate = FALSE;//Enable next launch self.owner.shrap_detonate = FALSE;//Enable next launch
self.owner = world; self.owner = world;
self.nextthink = self.shrap_time; self.nextthink = self.shrap_time;
@ -666,9 +596,10 @@ void() ShrapnelThink =
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
void() ShrapnelTouch = void() ShrapnelTouch =
{ {
local float r; local float r;
r = random(); r = random();
@ -690,10 +621,9 @@ void() ShrapnelTouch =
if (self.velocity == '0 0 0') if (self.velocity == '0 0 0')
self.avelocity = '0 0 0'; self.avelocity = '0 0 0';
}; };
// End shrapnel bomb // End shrapnel bomb
//=============================================================================
//=============================================================================
/* /*
================ ================
@ -704,8 +634,7 @@ void() W_FireShrapnel =
{ {
self.ammo_rockets = self.ammo_rockets - 1; self.ammo_rockets = self.ammo_rockets - 1;
self.currentammo = self.ammo_nails = self.ammo_nails - 30; self.currentammo = self.ammo_nails = self.ammo_nails - 30;
sound (self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM);
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK); WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -713,73 +642,59 @@ void() W_FireShrapnel =
//Added weapon kickback (as long as you're not in mid air) //Added weapon kickback (as long as you're not in mid air)
if (self.flags & FL_ONGROUND) if (self.flags & FL_ONGROUND)
self.velocity = self.velocity + v_forward* -115; self.velocity = self.velocity + v_forward* -115;
newmis = spawn (); newmis = spawn ();
newmis.voided = 0; newmis.voided = 0;
newmis.owner = self; newmis.owner = self;
newmis.movetype = MOVETYPE_BOUNCE; newmis.movetype = MOVETYPE_BOUNCE;
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.classname = "shrapnel"; newmis.classname = "shrapnel";
newmis.shrap_time = time + 120; newmis.shrap_time = time + 120;
// set newmis speed // set newmis speed
makevectors (self.v_angle); makevectors (self.v_angle);
if (self.v_angle_x) {
if (self.v_angle_x)
newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
else } else {
{
newmis.velocity = aim(self, 10000); newmis.velocity = aim(self, 10000);
newmis.velocity = newmis.velocity * 600; newmis.velocity = newmis.velocity * 600;
newmis.velocity_z = 200; newmis.velocity_z = 200;
} }
newmis.avelocity = '300 300 300'; newmis.avelocity = '300 300 300';
newmis.angles = vectoangles(newmis.velocity); newmis.angles = vectoangles(newmis.velocity);
newmis.touch = ShrapnelTouch; newmis.touch = ShrapnelTouch;
// set newmis duration // set newmis duration
newmis.nextthink = time + 0.1; newmis.nextthink = time + 0.1;
newmis.think = ShrapnelThink; newmis.think = ShrapnelThink;
setmodel (newmis, "progs/grenade.mdl"); setmodel (newmis, "progs/grenade.mdl");
newmis.skin = 2; newmis.skin = 2;
setsize (newmis, '0 0 0', '0 0 0'); setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin); setorigin (newmis, self.origin);
}; };
/* /*
============ ============
W_SecondTrigger W_SecondTrigger
Second Trigger Impulses Second Trigger Impulses
POX v1.1 - seperated this from weapons.qc - cleaned it up a bit POX v1.1 - seperated this from weapons.qc - cleaned it up a bit
============ ============
*/ */
void() W_SecondTrigger = void() W_SecondTrigger =
{ {
//Don't fire during intermission // Don't fire during intermission
if (intermission_running) if (intermission_running)
return; return;
// check for NailGun's second Trigger // check for NailGun's second Trigger
if (self.weapon == IT_SUPER_NAILGUN) if (self.weapon == IT_SUPER_NAILGUN) {
{ if (!self.shrap_detonate) { // Check if a bomb is already set
if (!self.shrap_detonate) // Check if a bomb is already set
{
// check for nails and rockets // check for nails and rockets
if ((self.ammo_nails < 30) || (self.ammo_rockets < 1)) if ((self.ammo_nails < 30) || (self.ammo_rockets < 1)) {
{
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
sprint (self, PRINT_HIGH, "Not enough ammo...\n"); sprint (self, PRINT_HIGH, "Not enough ammo...\n");
}
else if (self.st_shrapnel < time) } else if (self.st_shrapnel < time) {
{
self.weaponframe = 0; self.weaponframe = 0;
SuperDamageSound(); SuperDamageSound();
self.st_shrapnel = time + 0.1; // Allow a fast detonate self.st_shrapnel = time + 0.1; // Allow a fast detonate
@ -787,12 +702,10 @@ void() W_SecondTrigger =
W_FireShrapnel(); W_FireShrapnel();
self.shrap_detonate = TRUE; self.shrap_detonate = TRUE;
} } else {
else
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
} }
else } else {
{
sound (self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM);
SuperDamageSound(); SuperDamageSound();
self.st_shrapnel = time + 0.7; // Time out before next launch self.st_shrapnel = time + 0.7; // Time out before next launch
@ -800,46 +713,39 @@ void() W_SecondTrigger =
} }
} }
// check for t-shot prime
if (self.weapon == IT_TSHOT) {
if (self.prime_tshot == TRUE) { // already primed
// check for t-shot prime
if (self.weapon == IT_TSHOT)
{
//already primed
if (self.prime_tshot == TRUE)
SUB_Null (); SUB_Null ();
//not enough ammo } else if (self.ammo_shells < 3) { // not enough ammo
else if (self.ammo_shells < 3)
{
SUB_Null (); SUB_Null ();
}
else } else {
{
self.st_tshotload = time + 0.9; //give the reload a chance to happen self.st_tshotload = time + 0.9; //give the reload a chance to happen
//make a reload sound! //make a reload sound!
sound (self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM);
player_reshot1(); //play prime animation player_reshot1(); // play prime animation
self.prime_tshot = TRUE; //set the prime bit self.prime_tshot = TRUE; //set the prime bit
} }
} }
// check for rhino reload // check for rhino reload
if (self.weapon == IT_ROCKET_LAUNCHER) if (self.weapon == IT_ROCKET_LAUNCHER) {
{ if (self.reload_rocket == 0) { // already reloaded
//already reloaded
if (self.reload_rocket == 0)
SUB_Null (); SUB_Null ();
//if no rockets go away } else if (self.ammo_rockets < 1) { // if no rockets go away
else if (self.ammo_rockets < 1)
{
SUB_Null (); SUB_Null ();
}
else } else {
{
self.st_rocketload = time + 0.6; //give the reload a chance to happen self.st_rocketload = time + 0.6; //give the reload a chance to happen
sound (self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM);
@ -849,93 +755,76 @@ void() W_SecondTrigger =
self.reload_rocket = 0; //reset reload bit self.reload_rocket = 0; //reset reload bit
} }
} }
// check for Plasmagun second Trigger // check for Plasmagun second Trigger
if (self.weapon == IT_PLASMAGUN) if (self.weapon == IT_PLASMAGUN) {
{
// check for cells if (self.ammo_cells < 9) { // check for cells
if (self.ammo_cells < 9)
{
sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM);
}
} else {
else if (self.st_mplasma < time) {
if (self.waterlevel > 1) { // explode under water
if (self.st_mplasma < time) sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
{ self.ammo_cells = 0;
if (self.waterlevel > 1) //explode under water W_SetCurrentAmmo ();
{ T_RadiusDamage (self, self, 250, world, "waterplasma");
sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM); return;
self.ammo_cells = 0; }
W_SetCurrentAmmo ();
T_RadiusDamage (self, self, 250, world, "waterplasma"); self.weaponframe = 0;
return; SuperDamageSound();
self.st_mplasma = time + 1.9;
player_mplasma1();
launch_megaplasma();
} else {
SUB_Null ();
} }
self.weaponframe = 0;
SuperDamageSound();
self.st_mplasma = time + 1.9;
player_mplasma1();
launch_megaplasma();
} }
else
SUB_Null ();
} }
// check for Super Shotgun second Trigger // check for Super Shotgun second Trigger
if (self.weapon == IT_COMBOGUN) if (self.weapon == IT_COMBOGUN) {
{
// check for rockets if (self.ammo_rockets < 1) { // check for rockets
if (self.ammo_rockets < 1)
{
self.items = self.items - ( self.items & (IT_SHELLS) ); self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS; self.items = self.items | IT_ROCKETS;
self.currentammo = self.ammo_rockets; self.currentammo = self.ammo_rockets;
self.which_ammo = 1; self.which_ammo = 1;
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
} else {
if (self.st_pball < time) {
self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS;
self.currentammo = self.ammo_rockets;
self.which_ammo = 1;
player_gshot1();
SuperDamageSound();
W_FirePball();
self.st_pball = time + 0.9;
} else {
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
}
} }
else
if (self.st_pball < time)
{
self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS;
self.currentammo = self.ammo_rockets;
self.which_ammo = 1;
player_gshot1();
SuperDamageSound();
W_FirePball();
self.st_pball = time + 0.9;
}
else
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
} }
// check for GrenadeLauncher second Trigger
if (self.weapon == IT_GRENADE_LAUNCHER)
{
// check for rockets
if (self.ammo_rockets < 1)
{
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
}
else
if (self.st_mine < time)
{
player_grenade1();
W_FireMine();
//big delay between refires helps keep the # of mines down in a deathmatch game
self.st_mine = time + 1.25;
// check for GrenadeLauncher second Trigger
if (self.weapon == IT_GRENADE_LAUNCHER) {
if (self.ammo_rockets < 1) { // check for rockets
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
} else {
if (self.st_mine < time) {
player_grenade1();
W_FireMine();
// big delay between refires helps keep the # of mines down in a deathmatch game
self.st_mine = time + 1.25;
} else {
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
}
} }
else
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
} }
self.impulse = 0; self.impulse = 0;

View file

@ -15,30 +15,21 @@ void() monster_shalrath = {remove(self);};
void() monster_enforcer = {remove(self);}; void() monster_enforcer = {remove(self);};
void() monster_oldone = {remove(self);}; void() monster_oldone = {remove(self);};
void() event_lightning = {remove(self);}; void() event_lightning = {remove(self);};
/* /*
============================================================================== ==============================================================================
MOVETARGET CODE MOVETARGET CODE
The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target. The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
targetname targetname
must be present. The name of this movetarget. must be present. The name of this movetarget.
target target
the next spot to move to. If not present, stop here for good. the next spot to move to. If not present, stop here for good.
pausetime pausetime
The number of seconds to spend standing or bowing for path_stand or path_bow The number of seconds to spend standing or bowing for path_stand or path_bow
============================================================================== ==============================================================================
*/ */
/* /*
============= =============
t_movetarget t_movetarget
Something has bumped into a movetarget. If it is a monster Something has bumped into a movetarget. If it is a monster
moving towards it, change the next destination and continue. moving towards it, change the next destination and continue.
============== ==============
@ -46,20 +37,16 @@ moving towards it, change the next destination and continue.
void() t_movetarget = void() t_movetarget =
{ {
local entity temp; local entity temp;
if (other.movetarget != self) if (other.movetarget != self)
return; return;
if (other.enemy) if (other.enemy)
return; // fighting, not following a path return; // fighting, not following a path
temp = self; temp = self;
self = other; self = other;
other = temp; other = temp;
if (self.classname == "monster_ogre") if (self.classname == "monster_ogre")
sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
//dprint ("t_movetarget\n"); //dprint ("t_movetarget\n");
self.goalentity = self.movetarget = find (world, targetname, other.target); self.goalentity = self.movetarget = find (world, targetname, other.target);
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
@ -70,9 +57,6 @@ local entity temp;
return; return;
} }
}; };
void() movetarget_f = void() movetarget_f =
{ {
if (!self.targetname) if (!self.targetname)
@ -83,7 +67,6 @@ void() movetarget_f =
setsize (self, '-8 -8 -8', '8 8 8'); setsize (self, '-8 -8 -8', '8 8 8');
}; };
/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
Monsters will continue walking towards the next target corner. Monsters will continue walking towards the next target corner.
*/ */
@ -91,7 +74,4 @@ void() path_corner =
{ {
movetarget_f (); movetarget_f ();
}; };
//============================================================================
//============================================================================

View file

@ -3,31 +3,23 @@ EMAIL: pox@planetquake.com
WEB: http://www.planetquake.com/paroxysm/ WEB: http://www.planetquake.com/paroxysm/
========================================================================= =========================================================================
*/ */
//Armor regeneration stations //Armor regeneration stations
//surprisingly little coding required to get this going //surprisingly little coding required to get this going
//Had to add a value/type check routine in T_Damage //Had to add a value/type check routine in T_Damage
//Armour is now gained by standing at Regen_stations, //Armour is now gained by standing at Regen_stations,
//The colour of armour only indocates how much you have, it is always the same strength //The colour of armour only indocates how much you have, it is always the same strength
//Here's a breakdown: //Here's a breakdown:
//1 - 50 points is blue //1 - 50 points is blue
//51 - 150 points is yellow //51 - 150 points is yellow
//151 - 255 points is red //151 - 255 points is red
//POX v1.2 - moved to client.qc //POX v1.2 - moved to client.qc
//.float armregen; //.float armregen;
//RegenStation Default Ambient Sound //RegenStation Default Ambient Sound
void() regen_ambientsound = void() regen_ambientsound =
{ {
ambientsound (self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC); ambientsound (self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC);
}; };
//POX v1.11 - particle stream replaced by a mdl with client side animation (for POXworld) //POX v1.11 - particle stream replaced by a mdl with client side animation (for POXworld)
/* /*
//A paritcle effect for regen stations //A paritcle effect for regen stations
void() regen_make_smoke = void() regen_make_smoke =
@ -37,7 +29,6 @@ void() regen_make_smoke =
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
*/ */
//Particle emiting entity //Particle emiting entity
void(float colour) regen_streamer = void(float colour) regen_streamer =
{ {
@ -48,9 +39,7 @@ void(float colour) regen_streamer =
streamer.movetype = MOVETYPE_TOSS; streamer.movetype = MOVETYPE_TOSS;
setmodel(streamer, "progs/stream.mdl"); setmodel(streamer, "progs/stream.mdl");
setsize (streamer, '-16 -16 0', '16 16 56'); setsize (streamer, '-16 -16 0', '16 16 56');
streamer.velocity = '0 0 0'; streamer.velocity = '0 0 0';
setorigin(streamer, self.origin); setorigin(streamer, self.origin);
@ -59,13 +48,10 @@ void(float colour) regen_streamer =
regen_ambientsound(); regen_ambientsound();
}; };
void() regen_touch = void() regen_touch =
{ {
if (other.regen_finished > time) //already touched if (other.regen_finished > time) //already touched
return; return;
if (other.classname != "player") if (other.classname != "player")
return; return;
@ -79,32 +65,24 @@ void() regen_touch =
other.regen_finished = time + 0.2; other.regen_finished = time + 0.2;
}; };
//Regen triggers for custom maps - can be BIG (whole rooms) //Regen triggers for custom maps - can be BIG (whole rooms)
void() regen_station = void() regen_station =
{ {
if (self.armregen <= 0) if (self.armregen <= 0)
self.armregen = 50; self.armregen = 50;
InitTrigger (); InitTrigger ();
self.touch = regen_touch; self.touch = regen_touch;
//self.netname = "regen station"; //self.netname = "regen station";
}; };
//These replace armor in existing Maps //These replace armor in existing Maps
void() item_armor1 = void() item_armor1 =
{ {
precache_sound("ambience/regen1.wav"); precache_sound("ambience/regen1.wav");
precache_model ("progs/regen.mdl"); precache_model ("progs/regen.mdl");
precache_model ("progs/stream.mdl"); precache_model ("progs/stream.mdl");
self.touch = regen_touch; self.touch = regen_touch;
setmodel (self, "progs/regen.mdl"); setmodel (self, "progs/regen.mdl");
self.skin = 0; self.skin = 0;
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
@ -114,25 +92,20 @@ void() item_armor1 =
self.movetype = MOVETYPE_TOSS; self.movetype = MOVETYPE_TOSS;
self.velocity = '0 0 0'; self.velocity = '0 0 0';
self.origin_z = self.origin_z + 6; self.origin_z = self.origin_z + 6;
self.armregen = 50; self.armregen = 50;
//self.netname = "regen station"; //self.netname = "regen station";
regen_streamer(0); regen_streamer(0);
}; };
void() item_armor2 = void() item_armor2 =
{ {
precache_sound("ambience/regen1.wav"); precache_sound("ambience/regen1.wav");
precache_model ("progs/regen.mdl"); precache_model ("progs/regen.mdl");
precache_model ("progs/stream.mdl"); precache_model ("progs/stream.mdl");
self.touch = regen_touch; self.touch = regen_touch;
setmodel (self, "progs/regen.mdl"); setmodel (self, "progs/regen.mdl");
self.skin = 1; self.skin = 1;
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
@ -146,20 +119,15 @@ void() item_armor2 =
//self.netname = "regen station"; //self.netname = "regen station";
regen_streamer(1); regen_streamer(1);
}; };
void() item_armorInv = void() item_armorInv =
{ {
precache_sound("ambience/regen1.wav"); precache_sound("ambience/regen1.wav");
precache_model ("progs/regen.mdl"); precache_model ("progs/regen.mdl");
precache_model ("progs/stream.mdl"); precache_model ("progs/stream.mdl");
self.touch = regen_touch; self.touch = regen_touch;
setmodel (self, "progs/regen.mdl"); setmodel (self, "progs/regen.mdl");
self.skin = 2; self.skin = 2;
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
@ -173,7 +141,4 @@ void() item_armorInv =
//self.netname = "regen station"; //self.netname = "regen station";
regen_streamer(2); regen_streamer(2);
};
};

View file

@ -2,65 +2,44 @@
EMAIL: pox@planetquake.com EMAIL: pox@planetquake.com
WEB: http://www.planetquake.com/paroxysm WEB: http://www.planetquake.com/paroxysm
========================================================================= =========================================================================
Custom Paroxysm visual and audio effects Custom Paroxysm visual and audio effects
These are simple little ambient effects that are customizable within Quiver. These are simple little ambient effects that are customizable within Quiver.
Feel free to use this code in anyway. Feel free to use this code in anyway.
========================================================================= =========================================================================
*/ */
//NOT USED IN POXworld //NOT USED IN POXworld
.float spark_freq; // To avoid 'not a feild' server errors .float spark_freq; // To avoid 'not a feild' server errors
void() e_spark = void() e_spark =
{remove(self);}; {remove(self);};
void() a_drip = void() a_drip =
{remove(self);}; {remove(self);};
/* /*
================================================================================================= =================================================================================================
Custom Sound Entity (cust_sound) Custom Sound Entity (cust_sound)
The lack of a Mac sound editor that produces looping .wav files in a format that Quake understands The lack of a Mac sound editor that produces looping .wav files in a format that Quake understands
prompted the creation of this function. Then I added some options to make it worth while. prompted the creation of this function. Then I added some options to make it worth while.
snd_attn - sets the sound's attenuation (defaults to ATTN_NORM (1)) snd_attn - sets the sound's attenuation (defaults to ATTN_NORM (1))
snd_volume - sets the sounds overall volume (typically values of 0.5 to 1) default is 1 snd_volume - sets the sounds overall volume (typically values of 0.5 to 1) default is 1
strt_onoff - 0 = initially on, 1 = initially off strt_onoff - 0 = initially on, 1 = initially off
snd_rep - number of times to play the sound (-2 is infinite loop) snd_rep - number of times to play the sound (-2 is infinite loop)
snd_loop - delay in seconds before playing sound again (use sound length for looping sounds) snd_loop - delay in seconds before playing sound again (use sound length for looping sounds)
snd_rand - random seed, this number is multiplied by random() and added to loop (default 0 is no random) snd_rand - random seed, this number is multiplied by random() and added to loop (default 0 is no random)
the_snd - directory path to the sound - example: "misc/mysound.wav" NOTE: "sound/" is NOT needed the_snd - directory path to the sound - example: "misc/mysound.wav" NOTE: "sound/" is NOT needed
targetname - sounds can be triggered by using a targetname. targetname - sounds can be triggered by using a targetname.
TOGGLE_SND - spawn flag, determines if sounds can be toggled on and off. TOGGLE_SND - spawn flag, determines if sounds can be toggled on and off.
BUGS BUGS
1. Quake won't start playing these sounds on the first frame - (Unless you precache every possible sound 1. Quake won't start playing these sounds on the first frame - (Unless you precache every possible sound
at world_spawn) at world_spawn)
HACKY FIX - If you need a sound to play right away; HACKY FIX - If you need a sound to play right away;
Position a trigger in such a way that it is touched when the player enters the map - NOT touching the Position a trigger in such a way that it is touched when the player enters the map - NOT touching the
player initially (doesn't work on frame 1 remember?). Try making a trigger 4 units tall and place player initially (doesn't work on frame 1 remember?). Try making a trigger 4 units tall and place
info_player_start just above it. Not pretty, but it does the trick - Don't forget to set info_player_start just above it. Not pretty, but it does the trick - Don't forget to set
strt_onoff to 1 (initially off) for this to work strt_onoff to 1 (initially off) for this to work
2. When Quake no longer 'hears' or more arcurately - 'sees' the sound, it kills it until it comes into view 2. When Quake no longer 'hears' or more arcurately - 'sees' the sound, it kills it until it comes into view
again. This causes the sound to stop playing and remsume at the NEXT loop point when it is in view, so for again. This causes the sound to stop playing and remsume at the NEXT loop point when it is in view, so for
sounds that must be looped constantly, I would reccomend using the ambient_sound function (see below) sounds that must be looped constantly, I would reccomend using the ambient_sound function (see below)
================================================================================================= =================================================================================================
*/ */
//NOTE: some of these .floats are used in ambient_sound as well (see below) //NOTE: some of these .floats are used in ambient_sound as well (see below)
float TOGGLE_SND = 1; float TOGGLE_SND = 1;
.float snd_attn; .float snd_attn;
@ -71,17 +50,14 @@ float TOGGLE_SND = 1;
.float snd_loop; .float snd_loop;
.float snd_strt; .float snd_strt;
.string the_snd; .string the_snd;
void() sound_think; void() sound_think;
void() play_sound; void() play_sound;
void() sound_wait = void() sound_wait =
{ {
// hang around until next use // hang around until next use
self.nextthink = time + 60*10; self.nextthink = time + 60*10;
self.think = sound_wait; self.think = sound_wait;
}; };
void() stop_sound = void() stop_sound =
{ {
// if sound is set to toggle, silence it and set use to play // if sound is set to toggle, silence it and set use to play
@ -99,7 +75,6 @@ void() stop_sound =
remove (self); remove (self);
} }
}; };
void() play_sound = void() play_sound =
{ {
//infinite repeat //infinite repeat
@ -122,7 +97,6 @@ void() play_sound =
} }
}; };
void() sound_think = void() sound_think =
{ {
// if sound is toggled, set next use to stop // if sound is toggled, set next use to stop
@ -133,7 +107,6 @@ void() sound_think =
self.nextthink = time + (random()*self.snd_rand) + self.snd_loop; self.nextthink = time + (random()*self.snd_rand) + self.snd_loop;
self.think = play_sound; self.think = play_sound;
}; };
void() cust_sound = void() cust_sound =
{ {
precache_sound (self.the_snd); precache_sound (self.the_snd);
@ -167,7 +140,6 @@ void() cust_sound =
} }
}; };
//Made this so custom ambient sounds could be called with a single function //Made this so custom ambient sounds could be called with a single function
//ONLY WORKS WITH LOOPED .WAV FILES //ONLY WORKS WITH LOOPED .WAV FILES
@ -176,12 +148,10 @@ void() cust_sound =
//To my knowledge you can't make these with existing Mac sound editors //To my knowledge you can't make these with existing Mac sound editors
//(you can make looping wavs, just not ones Quake will loop) //(you can make looping wavs, just not ones Quake will loop)
//CoolEdit 1.5 (for Windows) is the only editor that can create these looping wavs (to my knowledge) //CoolEdit 1.5 (for Windows) is the only editor that can create these looping wavs (to my knowledge)
void() ambientsound_go = void() ambientsound_go =
{ {
ambientsound (self.origin, self.the_snd, self.snd_volume, self.snd_attn); ambientsound (self.origin, self.the_snd, self.snd_volume, self.snd_attn);
}; };
void() ambient_sound = void() ambient_sound =
{ {
precache_sound (self.the_snd); precache_sound (self.the_snd);
@ -208,36 +178,26 @@ void() ambient_sound =
else else
self.use = ambientsound_go; self.use = ambientsound_go;
}; };
/* /*
colour_light is a small hack to try and simulate coloured lighting. colour_light is a small hack to try and simulate coloured lighting.
It does this by calling the built-in v_cshift function It does this by calling the built-in v_cshift function
This can be used for 'atmospheric' effects like outdoor haze and darkness. This can be used for 'atmospheric' effects like outdoor haze and darkness.
This function is overriden by Quake when under liquids and by the background flash when an item is picked up This function is overriden by Quake when under liquids and by the background flash when an item is picked up
The GL Quake command 'gl_polyblend 0' also negates this entity. The GL Quake command 'gl_polyblend 0' also negates this entity.
colourvalue - this is the only parameter, must be in this format; colourvalue - this is the only parameter, must be in this format;
v_cshift R G B I\n v_cshift R G B I\n
where R is Red (0 - 255), G is Green (0 - 255), B is Rlue (0 - 255), and I is Intensity (0 - 255) where R is Red (0 - 255), G is Green (0 - 255), B is Rlue (0 - 255), and I is Intensity (0 - 255)
This effect works poorly in small increments in GL Quake, no colour will be noticeable until about an This effect works poorly in small increments in GL Quake, no colour will be noticeable until about an
intesity of about 5 (depending on the colour) and some colour/intensity combinations result in ugly intesity of about 5 (depending on the colour) and some colour/intensity combinations result in ugly
banding. It's best to test colour levels in the console before applying them in your map. banding. It's best to test colour levels in the console before applying them in your map.
These entities are activated by touch (the colour shift only occurs when the player is touching the trigger field) These entities are activated by touch (the colour shift only occurs when the player is touching the trigger field)
But can also be enabled/disabled by using a targetname. But can also be enabled/disabled by using a targetname.
The string must be exactly as shown (including the v_cshift and the carraige return The string must be exactly as shown (including the v_cshift and the carraige return
at the end) I could have used multiple stuffcmd statements to make it more user friendly but.. eh. at the end) I could have used multiple stuffcmd statements to make it more user friendly but.. eh.
*/ */
void() colourlight_wait; void() colourlight_wait;
.string colourvalue; .string colourvalue;
float CLSTART_OFF = 1; float CLSTART_OFF = 1;
void() colourlight_off = void() colourlight_off =
{ {
if(other.classname != "player") if(other.classname != "player")
@ -249,7 +209,6 @@ void() colourlight_off =
self.touch = SUB_Null; self.touch = SUB_Null;
}; };
void() colourlight_toggle = void() colourlight_toggle =
{ {
//called after light is triggered a second time //called after light is triggered a second time
@ -276,14 +235,11 @@ void() colourlight_use =
self.use = colourlight_toggle; self.use = colourlight_toggle;
}; };
void() colourlight_wait = void() colourlight_wait =
{ {
//activated by a trigger so wait for touch //activated by a trigger so wait for touch
self.touch = colourlight_use; self.touch = colourlight_use;
}; };
void() colour_light = void() colour_light =
{ {
InitTrigger (); InitTrigger ();
@ -298,23 +254,16 @@ void() colour_light =
self.use = colourlight_wait; self.use = colourlight_wait;
self.touch = SUB_Null; self.touch = SUB_Null;
} }
}; };
/* /*
particle_stream particle_stream
Changed for Paroxysm v1.11's new regen stations Changed for Paroxysm v1.11's new regen stations
Creates a regen stream-pulse model with out a grate and no touch Creates a regen stream-pulse model with out a grate and no touch
This entity should be used in conjunction with a regen_station trigger This entity should be used in conjunction with a regen_station trigger
clr = skin# (0 = blue, 1 = yellow, 2 = red) clr = skin# (0 = blue, 1 = yellow, 2 = red)
*/ */
.float clr; .float clr;
void() regen_ambientsound; void() regen_ambientsound;
void() particle_stream = void() particle_stream =
{ {
precache_sound("ambience/regen1.wav"); precache_sound("ambience/regen1.wav");
@ -336,15 +285,12 @@ void() particle_stream =
makestatic (self); makestatic (self);
}; };
/* /*
POX v1.2 POX v1.2
misc_explobox misc_explobox
BSP based explo_box'es BSP based explo_box'es
Try to use rectangular objects, since entites use bounding box collision detection Try to use rectangular objects, since entites use bounding box collision detection
*/ */
void() bsp_explode = void() bsp_explode =
{ {
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
@ -352,6 +298,7 @@ void() bsp_explode =
// did say self.owner // did say self.owner
T_RadiusDamage (self.trigger_field, self.trigger_field, self.dmg, world, ""); T_RadiusDamage (self.trigger_field, self.trigger_field, self.dmg, world, "");
sound (self.trigger_field, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION); WriteByte (MSG_MULTICAST, TE_EXPLOSION);
@ -362,9 +309,7 @@ void() bsp_explode =
remove (self); remove (self);
remove (self.trigger_field); remove (self.trigger_field);
}; };
void() misc_explobsp = void() misc_explobsp =
{ {
local entity spot; local entity spot;
@ -374,7 +319,6 @@ void() misc_explobsp =
setmodel (self, self.model); setmodel (self, self.model);
setsize( self, self.mins, self.maxs ); setsize( self, self.mins, self.maxs );
precache_sound ("weapons/r_exp3.wav"); precache_sound ("weapons/r_exp3.wav");
if (!self.health) if (!self.health)

View file

@ -8,11 +8,9 @@
// have any weapons and things can explode. // have any weapons and things can explode.
// //
// --- Zoid. // --- Zoid.
/* /*
=========== ===========
SpectatorConnect SpectatorConnect
called when a spectator connects to a server called when a spectator connects to a server
============ ============
*/ */
@ -21,14 +19,11 @@ void() SpectatorConnect =
bprint (PRINT_MEDIUM, "Spectator "); bprint (PRINT_MEDIUM, "Spectator ");
bprint (PRINT_MEDIUM, self.netname); bprint (PRINT_MEDIUM, self.netname);
bprint (PRINT_MEDIUM, " entered the game\n"); bprint (PRINT_MEDIUM, " entered the game\n");
self.goalentity = world; // used for impulse 1 below self.goalentity = world; // used for impulse 1 below
}; };
/* /*
=========== ===========
SpectatorDisconnect SpectatorDisconnect
called when a spectator disconnects from a server called when a spectator disconnects from a server
============ ============
*/ */
@ -38,11 +33,9 @@ void() SpectatorDisconnect =
bprint (PRINT_MEDIUM, self.netname); bprint (PRINT_MEDIUM, self.netname);
bprint (PRINT_MEDIUM, " left the game\n"); bprint (PRINT_MEDIUM, " left the game\n");
}; };
/* /*
================ ================
SpectatorImpulseCommand SpectatorImpulseCommand
Called by SpectatorThink if the spectator entered an impulse Called by SpectatorThink if the spectator entered an impulse
================ ================
*/ */
@ -61,14 +54,11 @@ void() SpectatorImpulseCommand =
self.fixangle = TRUE; // turn this way immediately self.fixangle = TRUE; // turn this way immediately
} }
} }
self.impulse = 0; self.impulse = 0;
}; };
/* /*
================ ================
SpectatorThink SpectatorThink
Called every frame after physics are run Called every frame after physics are run
================ ================
*/ */
@ -76,9 +66,6 @@ void() SpectatorThink =
{ {
// self.origin, etc contains spectator position, so you could // self.origin, etc contains spectator position, so you could
// do some neat stuff here // do some neat stuff here
if (self.impulse) if (self.impulse)
SpectatorImpulseCommand(); SpectatorImpulseCommand();
}; };

View file

@ -1,10 +1,6 @@
void() SUB_Null = {}; void() SUB_Null = {};
void() SUB_Remove = {remove(self);}; void() SUB_Remove = {remove(self);};
/* /*
QuakeEd only writes a single float for angles (bad idea), so up and down are QuakeEd only writes a single float for angles (bad idea), so up and down are
just constant angles. just constant angles.
@ -23,7 +19,6 @@ vector() SetMovedir =
self.angles = '0 0 0'; self.angles = '0 0 0';
}; };
/* /*
================ ================
InitTrigger InitTrigger
@ -41,11 +36,9 @@ void() InitTrigger =
self.modelindex = 0; self.modelindex = 0;
self.model = ""; self.model = "";
}; };
/* /*
============= =============
SUB_CalcMove SUB_CalcMove
calculate self.velocity and self.nextthink to reach dest from calculate self.velocity and self.nextthink to reach dest from
self.origin traveling at speed self.origin traveling at speed
=============== ===============
@ -55,23 +48,18 @@ void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt =
local entity stemp; local entity stemp;
stemp = self; stemp = self;
self = ent; self = ent;
SUB_CalcMove (tdest, tspeed, func); SUB_CalcMove (tdest, tspeed, func);
self = stemp; self = stemp;
}; };
void(vector tdest, float tspeed, void() func) SUB_CalcMove = void(vector tdest, float tspeed, void() func) SUB_CalcMove =
{ {
local vector vdestdelta; local vector vdestdelta;
local float len, traveltime; local float len, traveltime;
if (!tspeed) if (!tspeed)
objerror("No speed is defined!"); objerror("No speed is defined!");
self.think1 = func; self.think1 = func;
self.finaldest = tdest; self.finaldest = tdest;
self.think = SUB_CalcMoveDone; self.think = SUB_CalcMoveDone;
if (tdest == self.origin) if (tdest == self.origin)
{ {
self.velocity = '0 0 0'; self.velocity = '0 0 0';
@ -87,17 +75,14 @@ local float len, traveltime;
// divide by speed to get time to reach dest // divide by speed to get time to reach dest
traveltime = len / tspeed; traveltime = len / tspeed;
if (traveltime < 0.03) if (traveltime < 0.03)
traveltime = 0.03; traveltime = 0.03;
// set nextthink to trigger a think when dest is reached // set nextthink to trigger a think when dest is reached
self.nextthink = self.ltime + traveltime; self.nextthink = self.ltime + traveltime;
// scale the destdelta vector by the time spent traveling to get velocity // scale the destdelta vector by the time spent traveling to get velocity
self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float
}; };
/* /*
============ ============
After moving, set origin to exact final destination After moving, set origin to exact final destination
@ -111,15 +96,11 @@ void() SUB_CalcMoveDone =
if (self.think1) if (self.think1)
self.think1(); self.think1();
}; };
/* /*
============= =============
SUB_CalcAngleMove SUB_CalcAngleMove
calculate self.avelocity and self.nextthink to reach destangle from calculate self.avelocity and self.nextthink to reach destangle from
self.angles rotating self.angles rotating
The calling function should make sure self.think is valid The calling function should make sure self.think is valid
=============== ===============
*/ */
@ -131,12 +112,10 @@ local entity stemp;
SUB_CalcAngleMove (destangle, tspeed, func); SUB_CalcAngleMove (destangle, tspeed, func);
self = stemp; self = stemp;
}; };
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
{ {
local vector destdelta; local vector destdelta;
local float len, traveltime; local float len, traveltime;
if (!tspeed) if (!tspeed)
objerror("No speed is defined!"); objerror("No speed is defined!");
@ -148,10 +127,8 @@ local float len, traveltime;
// divide by speed to get time to reach dest // divide by speed to get time to reach dest
traveltime = len / tspeed; traveltime = len / tspeed;
// set nextthink to trigger a think when dest is reached // set nextthink to trigger a think when dest is reached
self.nextthink = self.ltime + traveltime; self.nextthink = self.ltime + traveltime;
// scale the destdelta vector by the time spent traveling to get velocity // scale the destdelta vector by the time spent traveling to get velocity
self.avelocity = destdelta * (1 / traveltime); self.avelocity = destdelta * (1 / traveltime);
@ -159,7 +136,6 @@ local float len, traveltime;
self.finalangle = destangle; self.finalangle = destangle;
self.think = SUB_CalcAngleMoveDone; self.think = SUB_CalcAngleMoveDone;
}; };
/* /*
============ ============
After rotating, set angle to exact final angle After rotating, set angle to exact final angle
@ -173,40 +149,29 @@ void() SUB_CalcAngleMoveDone =
if (self.think1) if (self.think1)
self.think1(); self.think1();
}; };
//============================================================================= //=============================================================================
void() DelayThink = void() DelayThink =
{ {
activator = self.enemy; activator = self.enemy;
SUB_UseTargets (); SUB_UseTargets ();
remove(self); remove(self);
}; };
/* /*
============================== ==============================
SUB_UseTargets SUB_UseTargets
the global "activator" should be set to the entity that initiated the firing. the global "activator" should be set to the entity that initiated the firing.
If self.delay is set, a DelayedUse entity will be created that will actually If self.delay is set, a DelayedUse entity will be created that will actually
do the SUB_UseTargets after that many seconds have passed. do the SUB_UseTargets after that many seconds have passed.
Centerprints any self.message to the activator. Centerprints any self.message to the activator.
Removes all entities with a targetname that match self.killtarget, Removes all entities with a targetname that match self.killtarget,
and removes them, so some events can remove other triggers. and removes them, so some events can remove other triggers.
Search for (string)targetname in all entities that Search for (string)targetname in all entities that
match (string)self.target and call their .use function match (string)self.target and call their .use function
============================== ==============================
*/ */
void() SUB_UseTargets = void() SUB_UseTargets =
{ {
local entity t, stemp, otemp, act; local entity t, stemp, otemp, act;
// //
// check for a delay // check for a delay
// //
@ -236,7 +201,6 @@ void() SUB_UseTargets =
if (!self.noise) if (!self.noise)
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
} }
// //
// kill the killtagets // kill the killtagets
// //
@ -281,6 +245,4 @@ void() SUB_UseTargets =
} while ( 1 ); } while ( 1 );
} }
};
};

View file

@ -1,6 +1,5 @@
// POX - v1.1 target identifier ala Quake3 - displays the name of players who cross your sight // POX - v1.1 target identifier ala Quake3 - displays the name of players who cross your sight
// by Frank Condello (POX) - http://www.planetquake.com/paroxysm/ - pox@planetquake.com // by Frank Condello (POX) - http://www.planetquake.com/paroxysm/ - pox@planetquake.com
/* POX - from original Quake ai.qc /* POX - from original Quake ai.qc
============= =============
visible visible
@ -17,14 +16,11 @@ float (entity targ) visible =
if (trace_inopen && trace_inwater) if (trace_inopen && trace_inwater)
return FALSE; // sight line crossed contents return FALSE; // sight line crossed contents
if (trace_fraction == 1) if (trace_fraction == 1)
return TRUE; return TRUE;
return FALSE; return FALSE;
}; };
// Short and sweet.... // Short and sweet....
void() ID_CheckTarget = void() ID_CheckTarget =
{ {
@ -37,11 +33,9 @@ void() ID_CheckTarget =
self.last_target_id = world; self.last_target_id = world;
traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self); traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self);
org = trace_endpos; org = trace_endpos;
spot = findradius(org, 200); spot = findradius(org, 200);
while (spot) while (spot)
{ {
if ((spot.classname == "player") && spot.takedamage) if ((spot.classname == "player") && spot.takedamage)
@ -75,5 +69,4 @@ void() ID_CheckTarget =
spot = spot.chain; spot = spot.chain;
} }
};
};

View file

@ -1,17 +1,12 @@
entity stemp, otemp, s, old; entity stemp, otemp, s, old;
void() trigger_reactivate = void() trigger_reactivate =
{ {
self.solid = SOLID_TRIGGER; self.solid = SOLID_TRIGGER;
}; };
//============================================================================= //=============================================================================
float SPAWNFLAG_NOMESSAGE = 1; float SPAWNFLAG_NOMESSAGE = 1;
float SPAWNFLAG_NOTOUCH = 1; float SPAWNFLAG_NOTOUCH = 1;
// the wait time has passed, so set back up for another activation // the wait time has passed, so set back up for another activation
void() multi_wait = void() multi_wait =
{ {
@ -22,8 +17,6 @@ void() multi_wait =
self.solid = SOLID_BBOX; self.solid = SOLID_BBOX;
} }
}; };
// the trigger was just touched/killed/used // the trigger was just touched/killed/used
// self.enemy should be set to the activator so it can be held through a delay // self.enemy should be set to the activator so it can be held through a delay
// so wait for the delay time before firing // so wait for the delay time before firing
@ -33,7 +26,6 @@ void() multi_trigger =
{ {
return; // allready been triggered return; // allready been triggered
} }
if (self.classname == "trigger_secret") if (self.classname == "trigger_secret")
{ {
if (self.enemy.classname != "player") if (self.enemy.classname != "player")
@ -41,17 +33,13 @@ void() multi_trigger =
found_secrets = found_secrets + 1; found_secrets = found_secrets + 1;
WriteByte (MSG_ALL, SVC_FOUNDSECRET); WriteByte (MSG_ALL, SVC_FOUNDSECRET);
} }
if (self.noise) if (self.noise)
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
// don't trigger again until reset // don't trigger again until reset
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
activator = self.enemy; activator = self.enemy;
SUB_UseTargets(); SUB_UseTargets();
if (self.wait > 0) if (self.wait > 0)
{ {
self.think = multi_wait; self.think = multi_wait;
@ -65,19 +53,16 @@ void() multi_trigger =
self.think = SUB_Remove; self.think = SUB_Remove;
} }
}; };
void() multi_killed = void() multi_killed =
{ {
self.enemy = damage_attacker; self.enemy = damage_attacker;
multi_trigger(); multi_trigger();
}; };
void() multi_use = void() multi_use =
{ {
self.enemy = activator; self.enemy = activator;
multi_trigger(); multi_trigger();
}; };
void() multi_touch = void() multi_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
@ -94,7 +79,6 @@ void() multi_touch =
self.enemy = other; self.enemy = other;
multi_trigger (); multi_trigger ();
}; };
/*QUAKED trigger_multiple (.5 .5 .5) ? notouch /*QUAKED trigger_multiple (.5 .5 .5) ? notouch
Variable sized repeatable trigger. Must be targeted at one or more entities. If "health" is set, the trigger must be killed to activate each time. Variable sized repeatable trigger. Must be targeted at one or more entities. If "health" is set, the trigger must be killed to activate each time.
If "delay" is set, the trigger waits some time after activating before firing. If "delay" is set, the trigger waits some time after activating before firing.
@ -129,9 +113,7 @@ void() trigger_multiple =
if (!self.wait) if (!self.wait)
self.wait = 0.2; self.wait = 0.2;
self.use = multi_use; self.use = multi_use;
InitTrigger (); InitTrigger ();
if (self.health) if (self.health)
{ {
if (self.spawnflags & SPAWNFLAG_NOTOUCH) if (self.spawnflags & SPAWNFLAG_NOTOUCH)
@ -155,8 +137,6 @@ void() trigger_multiple =
} }
} }
}; };
/*QUAKED trigger_once (.5 .5 .5) ? notouch /*QUAKED trigger_once (.5 .5 .5) ? notouch
Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching
"targetname". If "health" is set, the trigger must be killed to activate. "targetname". If "health" is set, the trigger must be killed to activate.
@ -175,9 +155,7 @@ void() trigger_once =
self.wait = -1; self.wait = -1;
trigger_multiple(); trigger_multiple();
}; };
//============================================================================= //=============================================================================
/*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) /*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8)
This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages. This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages.
*/ */
@ -185,10 +163,7 @@ void() trigger_relay =
{ {
self.use = SUB_UseTargets; self.use = SUB_UseTargets;
}; };
//============================================================================= //=============================================================================
/*QUAKED trigger_secret (.5 .5 .5) ? /*QUAKED trigger_secret (.5 .5 .5) ?
secret counter trigger secret counter trigger
sounds sounds
@ -217,13 +192,9 @@ void() trigger_secret =
precache_sound ("misc/talk.wav"); precache_sound ("misc/talk.wav");
self.noise = "misc/talk.wav"; self.noise = "misc/talk.wav";
} }
trigger_multiple (); trigger_multiple ();
}; };
//============================================================================= //=============================================================================
void() counter_use = void() counter_use =
{ {
self.count = self.count - 1; self.count = self.count - 1;
@ -258,12 +229,9 @@ void() counter_use =
self.enemy = activator; self.enemy = activator;
multi_trigger (); multi_trigger ();
}; };
/*QUAKED trigger_counter (.5 .5 .5) ? nomessage /*QUAKED trigger_counter (.5 .5 .5) ? nomessage
Acts as an intermediary for an action that takes multiple inputs. Acts as an intermediary for an action that takes multiple inputs.
If nomessage is not set, t will print "1 more.. " etc when triggered and "sequence complete" when finished. If nomessage is not set, t will print "1 more.. " etc when triggered and "sequence complete" when finished.
After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself. After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself.
*/ */
void() trigger_counter = void() trigger_counter =
@ -271,22 +239,15 @@ void() trigger_counter =
self.wait = -1; self.wait = -1;
if (!self.count) if (!self.count)
self.count = 2; self.count = 2;
self.use = counter_use; self.use = counter_use;
}; };
/* /*
============================================================================== ==============================================================================
TELEPORT TRIGGERS TELEPORT TRIGGERS
============================================================================== ==============================================================================
*/ */
float PLAYER_ONLY = 1; float PLAYER_ONLY = 1;
float SILENT = 2; float SILENT = 2;
void() play_teleport = void() play_teleport =
{ {
local string tmpstr; local string tmpstr;
@ -295,18 +256,15 @@ void() play_teleport =
tmpstr = "misc/r_tele1.wav"; tmpstr = "misc/r_tele1.wav";
else else
tmpstr = "misc/r_tele2.wav"; tmpstr = "misc/r_tele2.wav";
sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM); sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM);
remove (self); remove (self);
}; };
void(vector org) spawn_tfog = void(vector org) spawn_tfog =
{ {
s = spawn (); s = spawn ();
s.origin = org; s.origin = org;
s.nextthink = time + 0.1;// + POX - quicker s.nextthink = time + 0.1;// + POX - quicker
s.think = play_teleport; s.think = play_teleport;
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_TELEPORT); WriteByte (MSG_MULTICAST, TE_TELEPORT);
WriteCoord (MSG_MULTICAST, org_x); WriteCoord (MSG_MULTICAST, org_x);
@ -314,15 +272,11 @@ void(vector org) spawn_tfog =
WriteCoord (MSG_MULTICAST, org_z); WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PHS); multicast (org, MULTICAST_PHS);
}; };
void() tdeath_touch = void() tdeath_touch =
{ {
local entity other2; local entity other2;
if (other == self.owner) if (other == self.owner)
return; return;
// frag anyone who teleports in on top of an invincible player // frag anyone who teleports in on top of an invincible player
if (other.classname == "player") if (other.classname == "player")
{ {
@ -345,18 +299,14 @@ void() tdeath_touch =
} }
} }
if (other.health) if (other.health)
{ {
T_Damage (other, self, self, 50000); T_Damage (other, self, self, 50000);
} }
}; };
void(vector org, entity death_owner) spawn_tdeath = void(vector org, entity death_owner) spawn_tdeath =
{ {
local entity death; local entity death;
death = spawn(); death = spawn();
death.classname = "teledeath"; death.classname = "teledeath";
death.movetype = MOVETYPE_NONE; death.movetype = MOVETYPE_NONE;
@ -371,12 +321,10 @@ local entity death;
force_retouch = 2; // make sure even still objects get hit force_retouch = 2; // make sure even still objects get hit
}; };
void() teleport_touch = void() teleport_touch =
{ {
local entity t; local entity t;
local vector org; local vector org;
if (self.targetname) if (self.targetname)
{ {
if (self.nextthink < time) if (self.nextthink < time)
@ -390,16 +338,12 @@ local vector org;
if (other.classname != "player") if (other.classname != "player")
return; return;
} }
// only teleport living creatures // only teleport living creatures
if (other.health <= 0 || other.solid != SOLID_SLIDEBOX) if (other.health <= 0 || other.solid != SOLID_SLIDEBOX)
return; return;
SUB_UseTargets (); SUB_UseTargets ();
// put a tfog where the player was // put a tfog where the player was
spawn_tfog (other.origin); spawn_tfog (other.origin);
t = find (world, targetname, self.target); t = find (world, targetname, self.target);
if (!t) if (!t)
objerror ("couldn't find target"); objerror ("couldn't find target");
@ -407,10 +351,8 @@ local vector org;
// spawn a tfog flash in front of the destination // spawn a tfog flash in front of the destination
makevectors (t.mangle); makevectors (t.mangle);
org = t.origin + 32 * v_forward; org = t.origin + 32 * v_forward;
spawn_tfog (org); spawn_tfog (org);
spawn_tdeath(t.origin, other); spawn_tdeath(t.origin, other);
// move the player and lock him down for a little while // move the player and lock him down for a little while
if (!other.health) if (!other.health)
{ {
@ -418,7 +360,6 @@ local vector org;
other.velocity = (v_forward * other.velocity_x) + (v_forward * other.velocity_y); other.velocity = (v_forward * other.velocity_x) + (v_forward * other.velocity_y);
return; return;
} }
setorigin (other, t.origin); setorigin (other, t.origin);
other.angles = t.mangle; other.angles = t.mangle;
if (other.classname == "player") if (other.classname == "player")
@ -434,7 +375,6 @@ local vector org;
} }
other.flags = other.flags - other.flags & FL_ONGROUND; other.flags = other.flags - other.flags & FL_ONGROUND;
}; };
/*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32) /*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32)
This is the destination marker for a teleporter. It should have a "targetname" field with the same value as a teleporter's "target" field. This is the destination marker for a teleporter. It should have a "targetname" field with the same value as a teleporter's "target" field.
*/ */
@ -448,30 +388,25 @@ void() info_teleport_destination =
if (!self.targetname) if (!self.targetname)
objerror ("no targetname"); objerror ("no targetname");
}; };
void() teleport_use = void() teleport_use =
{ {
self.nextthink = time + 0.2; self.nextthink = time + 0.2;
force_retouch = 2; // make sure even still objects get hit force_retouch = 2; // make sure even still objects get hit
self.think = SUB_Null; self.think = SUB_Null;
}; };
/*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT /*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT
Any object touching this will be transported to the corresponding info_teleport_destination entity. You must set the "target" field, and create an object with a "targetname" field that matches. Any object touching this will be transported to the corresponding info_teleport_destination entity. You must set the "target" field, and create an object with a "targetname" field that matches.
If the trigger_teleport has a targetname, it will only teleport entities when it has been fired. If the trigger_teleport has a targetname, it will only teleport entities when it has been fired.
*/ */
void() trigger_teleport = void() trigger_teleport =
{ {
local vector o; local vector o;
InitTrigger (); InitTrigger ();
self.touch = teleport_touch; self.touch = teleport_touch;
// find the destination // find the destination
if (!self.target) if (!self.target)
objerror ("no target"); objerror ("no target");
self.use = teleport_use; self.use = teleport_use;
if (!(self.spawnflags & SILENT)) if (!(self.spawnflags & SILENT))
{ {
precache_sound ("ambience/hum1.wav"); precache_sound ("ambience/hum1.wav");
@ -479,15 +414,11 @@ void() trigger_teleport =
ambientsound (o, "ambience/hum1.wav",0.5 , ATTN_STATIC); ambientsound (o, "ambience/hum1.wav",0.5 , ATTN_STATIC);
} }
}; };
/* /*
============================================================================== ==============================================================================
trigger_setskill trigger_setskill
============================================================================== ==============================================================================
*/ */
/*QUAKED trigger_setskill (.5 .5 .5) ? /*QUAKED trigger_setskill (.5 .5 .5) ?
sets skill level to the value of "message". sets skill level to the value of "message".
Only used on start map. Only used on start map.
@ -496,23 +427,17 @@ void() trigger_setskill =
{ {
remove (self); remove (self);
}; };
/* /*
============================================================================== ==============================================================================
ONLY REGISTERED TRIGGERS ONLY REGISTERED TRIGGERS
============================================================================== ==============================================================================
*/ */
void() trigger_onlyregistered_touch = void() trigger_onlyregistered_touch =
{ {
if (other.classname != "player") if (other.classname != "player")
return; return;
if (self.attack_finished > time) if (self.attack_finished > time)
return; return;
self.attack_finished = time + 2; self.attack_finished = time + 2;
if (cvar("registered")) if (cvar("registered"))
{ {
@ -531,7 +456,6 @@ void() trigger_onlyregistered_touch =
} }
} }
}; };
/*QUAKED trigger_onlyregistered (.5 .5 .5) ? /*QUAKED trigger_onlyregistered (.5 .5 .5) ?
Only fires if playing the registered version, otherwise prints the message Only fires if playing the registered version, otherwise prints the message
*/ */
@ -541,15 +465,12 @@ void() trigger_onlyregistered =
InitTrigger (); InitTrigger ();
self.touch = trigger_onlyregistered_touch; self.touch = trigger_onlyregistered_touch;
}; };
//============================================================================ //============================================================================
void() hurt_on = void() hurt_on =
{ {
self.solid = SOLID_TRIGGER; self.solid = SOLID_TRIGGER;
self.nextthink = -1; self.nextthink = -1;
}; };
void() hurt_touch = void() hurt_touch =
{ {
if (other.takedamage) if (other.takedamage)
@ -559,10 +480,8 @@ void() hurt_touch =
self.think = hurt_on; self.think = hurt_on;
self.nextthink = time + 1; self.nextthink = time + 1;
} }
return; return;
}; };
/*QUAKED trigger_hurt (.5 .5 .5) ? /*QUAKED trigger_hurt (.5 .5 .5) ?
Any object touching this will be hurt Any object touching this will be hurt
set dmg to damage amount set dmg to damage amount
@ -575,11 +494,8 @@ void() trigger_hurt =
if (!self.dmg) if (!self.dmg)
self.dmg = 5; self.dmg = 5;
}; };
//============================================================================ //============================================================================
float PUSH_ONCE = 1; float PUSH_ONCE = 1;
void() trigger_push_touch = void() trigger_push_touch =
{ {
if (other.classname == "grenade") if (other.classname == "grenade")
@ -599,8 +515,6 @@ void() trigger_push_touch =
if (self.spawnflags & PUSH_ONCE) if (self.spawnflags & PUSH_ONCE)
remove(self); remove(self);
}; };
/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE /*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE
Pushes the player Pushes the player
*/ */
@ -612,24 +526,18 @@ void() trigger_push =
if (!self.speed) if (!self.speed)
self.speed = 1000; self.speed = 1000;
}; };
/*-------------------- /*--------------------
trigger_bouncepad trigger_bouncepad
POX v1.2 - Adds Q3A style bounce pads POX v1.2 - Adds Q3A style bounce pads
It's kind of a low level entity to create, you must grasp the concept of 3D vectors and acceleration to get it to work It's kind of a low level entity to create, you must grasp the concept of 3D vectors and acceleration to get it to work
angles - must be entered as '0 0 0' (roll, pitch, yaw) in English, that's (left/right, forward/backward, up/down) angles - must be entered as '0 0 0' (roll, pitch, yaw) in English, that's (left/right, forward/backward, up/down)
so, negative numbers are (left, back, down) positive numbers are (right, forward, up) The bigger the number, so, negative numbers are (left, back, down) positive numbers are (right, forward, up) The bigger the number,
(in the positive or negative direction) the greater the acceleration in that direction. (in the positive or negative direction) the greater the acceleration in that direction.
A value of (0 40 800) is a good starting point for a vertical, slightly-forward bounce A value of (0 40 800) is a good starting point for a vertical, slightly-forward bounce
(Just remeber that forward (pitch) is ALWAYS NORTH when viewing a map from above) (Just remeber that forward (pitch) is ALWAYS NORTH when viewing a map from above)
Use SMALL triggers for this one (it has a touch timeout to prevent serious acceleration) Use SMALL triggers for this one (it has a touch timeout to prevent serious acceleration)
---------------------*/ ---------------------*/
.float bounce_time; .float bounce_time;
void() trigger_bounce_touch = void() trigger_bounce_touch =
{ {
if (other.bounce_time > time) if (other.bounce_time > time)
@ -643,8 +551,6 @@ void() trigger_bounce_touch =
sound (other, CHAN_AUTO, "misc/menu2.wav", 1, ATTN_NORM); sound (other, CHAN_AUTO, "misc/menu2.wav", 1, ATTN_NORM);
} }
}; };
void() trigger_bouncepad = void() trigger_bouncepad =
{ {
self.solid = SOLID_TRIGGER; self.solid = SOLID_TRIGGER;
@ -652,18 +558,13 @@ void() trigger_bouncepad =
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
self.modelindex = 0; self.modelindex = 0;
self.model = ""; self.model = "";
self.touch = trigger_bounce_touch; self.touch = trigger_bounce_touch;
}; };
//============================================================================ //============================================================================
void() trigger_monsterjump_touch = void() trigger_monsterjump_touch =
{ {
if ( other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER ) if ( other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER )
return; return;
// set XY even if not on ground, so the jump will clear lips // set XY even if not on ground, so the jump will clear lips
other.velocity_x = self.movedir_x * self.speed; other.velocity_x = self.movedir_x * self.speed;
other.velocity_y = self.movedir_y * self.speed; other.velocity_y = self.movedir_y * self.speed;
@ -672,10 +573,8 @@ void() trigger_monsterjump_touch =
return; return;
other.flags = other.flags - FL_ONGROUND; other.flags = other.flags - FL_ONGROUND;
other.velocity_z = self.height; other.velocity_z = self.height;
}; };
/*QUAKED trigger_monsterjump (.5 .5 .5) ? /*QUAKED trigger_monsterjump (.5 .5 .5) ?
Walking monsters that touch this will jump in the direction of the trigger's angle Walking monsters that touch this will jump in the direction of the trigger's angle
"speed" default to 200, the speed thrown forward "speed" default to 200, the speed thrown forward
@ -692,4 +591,3 @@ void() trigger_monsterjump =
InitTrigger (); InitTrigger ();
self.touch = trigger_monsterjump_touch; self.touch = trigger_monsterjump_touch;
}; };

View file

@ -7,42 +7,70 @@ void() W_Precache =
{ {
precache_model ("progs/plasma.mdl"); precache_model ("progs/plasma.mdl");
precache_model ("progs/laser.mdl"); precache_model ("progs/laser.mdl");
precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
precache_sound ("weapons/rocket1i.wav"); // spike gun precache_sound ("weapons/rocket1i.wav"); // spike gun
precache_sound ("weapons/sgun1.wav"); precache_sound ("weapons/sgun1.wav");
precache_sound ("weapons/ric1.wav"); // ricochet (used in c code) precache_sound ("weapons/ric1.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric2.wav"); // ricochet (used in c code) precache_sound ("weapons/ric2.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric3.wav"); // ricochet (used in c code) precache_sound ("weapons/ric3.wav"); // ricochet (used in c code)
precache_sound ("weapons/spike2.wav"); // super spikes precache_sound ("weapons/spike2.wav"); // super spikes
precache_sound ("weapons/nailgun.wav"); // new nailgun sound precache_sound ("weapons/hog.wav"); // new nailgun sound
precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code) precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code)
precache_sound ("weapons/tink2.wav"); precache_sound ("weapons/tink2.wav");
precache_sound ("weapons/grenade.wav"); // grenade launcher precache_sound ("weapons/gren.wav"); // grenade launcher
precache_sound ("weapons/gren2.wav"); // second trigger grenades
precache_sound ("weapons/bounce.wav"); // grenade bounce precache_sound ("weapons/bounce.wav"); // grenade bounce
precache_sound ("weapons/bounce2.wav"); // grenade bounce alt precache_sound ("weapons/bounce2.wav"); // grenade bounce alt
precache_sound ("weapons/shotgn2.wav"); // super shotgun precache_sound ("weapons/shotgn2.wav"); // super shotgun
precache_sound ("weapons/mfire1.wav"); // missfire precache_sound ("weapons/mfire1.wav"); // misfire
precache_sound ("weapons/mfire2.wav"); // megaplasma burst missfire precache_sound ("weapons/mfire2.wav"); // megaplasma burst misfire
precache_sound ("weapons/plasma.wav"); // plasmagun fire precache_sound ("weapons/plasma.wav"); // plasmagun fire
precache_sound ("weapons/mplasma.wav"); // megaplasmagun fire precache_sound ("weapons/mplasma.wav"); // megaplasmagun fire
precache_sound ("weapons/mplasex.wav"); // megaplasmagun explosion precache_sound ("weapons/mplasex.wav"); // megaplasmagun explosion
precache_sound ("weapons/ssgrnde.wav"); // super shotgun grenade fire precache_sound ("weapons/gren.wav"); // super shotgun grenade fire
precache_sound ("weapons/armed.wav"); // mine armed sound precache_sound ("weapons/armed.wav"); // mine armed sound
precache_sound ("weapons/minedet.wav"); //mine detonate click precache_sound ("weapons/minedet.wav"); //mine detonate click
precache_sound ("weapons/rhino.wav"); //rhino firing sound precache_sound ("weapons/rhino.wav"); //rhino firing sound
precache_sound ("weapons/rhinore.wav"); //rhino reload sound precache_sound ("weapons/rhinore.wav"); //rhino reload sound
precache_sound ("weapons/error.wav"); //weapon error sound precache_sound ("weapons/error.wav"); //weapon error sound
precache_sound ("weapons/tsload.wav"); //t-shot load precache_sound ("weapons/tsload.wav"); //t-shot load
precache_sound ("weapons/tsfire.wav"); //t-shot single fire precache_sound ("weapons/tsfire.wav"); //t-shot single fire
precache_sound ("weapons/ts3fire.wav"); //t-shot triple fire precache_sound ("weapons/ts3fire.wav"); //t-shot triple fire
precache_sound ("weapons/shrapdet.wav"); //ShrapnelBomb detonation-confirmation beep precache_sound ("weapons/shrapdet.wav"); //ShrapnelBomb detonation-confirmation beep
//Shrapnel Model
precache_model("progs/mwrub1.mdl"); /*
Precached models
*/
precache_model ("progs/mwrub1.mdl"); //Shrapnel Model
/*
// VisWeap - Player
precache_model ("progs/bsaw_p.mdl");
precache_model ("progs/tshot_p.mdl");
precache_model ("progs/combo_p.mdl");
precache_model ("progs/plasma_p.mdl");
precache_model ("progs/nail_p.mdl");
precache_model ("progs/gren_p.mdl");
precache_model ("progs/rhino_p.mdl");
// VisWeap - Weapon drop
precache_model ("progs/d_bsaw.mdl");
precache_model ("progs/d_tshot.mdl");
precache_model ("progs/d_combo.mdl");
precache_model ("progs/d_plasma.mdl");
precache_model ("progs/d_nail.mdl");
precache_model ("progs/d_gren.mdl");
precache_model ("progs/d_rhino.mdl");
// No weapon Death Model (weapons are dropped)
precache_model ("progs/death_p.mdl");
*/
}; };
/* /*
@ -63,17 +91,14 @@ void() W_FireAxe =
org = trace_endpos - v_forward*4; org = trace_endpos - v_forward*4;
if (trace_ent.takedamage) if (trace_ent.takedamage) {
{
trace_ent.axhitme = 1; trace_ent.axhitme = 1;
SpawnBlood (org, 20); SpawnBlood (org, 20);
//if (deathmatch > 3) //if (deathmatch > 3)
// T_Damage (trace_ent, self, self, 75); // T_Damage (trace_ent, self, self, 75);
//else //else
T_Damage (trace_ent, self, self, 20); T_Damage (trace_ent, self, self, 20);
} } else { // hit wall
else
{ // hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
@ -119,21 +144,6 @@ void(vector org, vector vel) SpawnMeatSpray =
setorigin (missile, org); setorigin (missile, org);
}; };
// + POX - SpawnNoBleed
// Entities with .nobleed=TRUE will display a gunshot particle instead of blood
void(vector org, float damage) SpawnNoBleed =
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_GUNSHOT);
WriteByte (MSG_MULTICAST, 5);
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PVS);
};
// - POX
/* /*
================ ================
SpawnBlood SpawnBlood
@ -141,21 +151,19 @@ SpawnBlood
*/ */
void(vector org, float damage) SpawnBlood = void(vector org, float damage) SpawnBlood =
{ {
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
// + POX - check for a bleeder if (trace_ent.nobleed) {
if (trace_ent.nobleed) WriteByte (MSG_MULTICAST, TE_GUNSHOT);
SpawnNoBleed (org, damage); WriteByte (MSG_MULTICAST, 5);
else } else {
// - POX
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_BLOOD); WriteByte (MSG_MULTICAST, TE_BLOOD);
WriteByte (MSG_MULTICAST, 1); WriteByte (MSG_MULTICAST, 1);
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PVS);
} }
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PVS);
}; };
@ -170,12 +178,7 @@ void(float damage) spawn_touchblood =
vel = wall_velocity () * 0.2; vel = wall_velocity () * 0.2;
// + POX - check for a bleeder SpawnBlood (self.origin + vel*0.01, damage);
if (other.nobleed)
SpawnNoBleed (self.origin + vel*0.01, damage);
else
// - POX
SpawnBlood (self.origin + vel*0.01, damage);
}; };
/* /*
@ -580,7 +583,7 @@ void() W_FireGrenade =
{ {
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/gren.wav", 1, ATTN_NORM);
msg_entity = self; msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK); WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -828,7 +831,7 @@ void(float ox) W_FireNails =
self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels
sound (self, CHAN_WEAPON, "weapons/nailgun.wav", 1, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/hog.wav", 0.8, ATTN_NORM);
self.currentammo = self.ammo_nails = self.ammo_nails - 1; self.currentammo = self.ammo_nails = self.ammo_nails - 1;

View file

@ -1,49 +1,38 @@
void() InitBodyQue; void() InitBodyQue;
void() main = void() main =
{ {
dprint ("main function\n"); dprint ("main function\n");
// these are just commands the the prog compiler to copy these files // these are just commands the the prog compiler to copy these files
precache_file ("progs.dat"); precache_file ("progs.dat");
precache_file ("gfx.wad"); precache_file ("gfx.wad");
precache_file ("quake.rc"); precache_file ("quake.rc");
precache_file ("default.cfg"); precache_file ("default.cfg");
precache_file ("end1.bin"); precache_file ("end1.bin");
precache_file2 ("end2.bin"); precache_file2 ("end2.bin");
precache_file ("demo1.dem"); precache_file ("demo1.dem");
precache_file ("demo2.dem"); precache_file ("demo2.dem");
precache_file ("demo3.dem"); precache_file ("demo3.dem");
// //
// these are all of the lumps from the cached.ls files // these are all of the lumps from the cached.ls files
// //
precache_file ("gfx/palette.lmp"); precache_file ("gfx/palette.lmp");
precache_file ("gfx/colormap.lmp"); precache_file ("gfx/colormap.lmp");
precache_file2 ("gfx/pop.lmp"); precache_file2 ("gfx/pop.lmp");
precache_file ("gfx/complete.lmp"); precache_file ("gfx/complete.lmp");
precache_file ("gfx/inter.lmp"); precache_file ("gfx/inter.lmp");
precache_file ("gfx/ranking.lmp"); precache_file ("gfx/ranking.lmp");
precache_file ("gfx/vidmodes.lmp"); precache_file ("gfx/vidmodes.lmp");
precache_file ("gfx/finale.lmp"); precache_file ("gfx/finale.lmp");
precache_file ("gfx/conback.lmp"); precache_file ("gfx/conback.lmp");
precache_file ("gfx/qplaque.lmp"); precache_file ("gfx/qplaque.lmp");
precache_file ("gfx/menudot1.lmp"); precache_file ("gfx/menudot1.lmp");
precache_file ("gfx/menudot2.lmp"); precache_file ("gfx/menudot2.lmp");
precache_file ("gfx/menudot3.lmp"); precache_file ("gfx/menudot3.lmp");
precache_file ("gfx/menudot4.lmp"); precache_file ("gfx/menudot4.lmp");
precache_file ("gfx/menudot5.lmp"); precache_file ("gfx/menudot5.lmp");
precache_file ("gfx/menudot6.lmp"); precache_file ("gfx/menudot6.lmp");
precache_file ("gfx/menuplyr.lmp"); precache_file ("gfx/menuplyr.lmp");
precache_file ("gfx/bigbox.lmp"); precache_file ("gfx/bigbox.lmp");
precache_file ("gfx/dim_modm.lmp"); precache_file ("gfx/dim_modm.lmp");
@ -87,26 +76,20 @@ void() main =
precache_file ("gfx/help3.lmp"); precache_file ("gfx/help3.lmp");
precache_file ("gfx/help4.lmp"); precache_file ("gfx/help4.lmp");
precache_file ("gfx/help5.lmp"); precache_file ("gfx/help5.lmp");
precache_file ("gfx/pause.lmp"); precache_file ("gfx/pause.lmp");
precache_file ("gfx/loading.lmp"); precache_file ("gfx/loading.lmp");
precache_file ("gfx/p_option.lmp"); precache_file ("gfx/p_option.lmp");
precache_file ("gfx/p_load.lmp"); precache_file ("gfx/p_load.lmp");
precache_file ("gfx/p_save.lmp"); precache_file ("gfx/p_save.lmp");
precache_file ("gfx/p_multi.lmp"); precache_file ("gfx/p_multi.lmp");
// sounds loaded by C code // sounds loaded by C code
precache_sound ("misc/menu1.wav"); precache_sound ("misc/menu1.wav");
precache_sound ("misc/menu2.wav"); precache_sound ("misc/menu2.wav");
precache_sound ("misc/menu3.wav"); precache_sound ("misc/menu3.wav");
precache_sound ("ambience/water1.wav"); precache_sound ("ambience/water1.wav");
precache_sound ("ambience/wind2.wav"); precache_sound ("ambience/wind2.wav");
// shareware // shareware
precache_file ("maps/start.bsp"); precache_file ("maps/start.bsp");
precache_file ("maps/e1m1.bsp"); precache_file ("maps/e1m1.bsp");
precache_file ("maps/e1m2.bsp"); precache_file ("maps/e1m2.bsp");
precache_file ("maps/e1m3.bsp"); precache_file ("maps/e1m3.bsp");
@ -115,10 +98,8 @@ void() main =
precache_file ("maps/e1m6.bsp"); precache_file ("maps/e1m6.bsp");
precache_file ("maps/e1m7.bsp"); precache_file ("maps/e1m7.bsp");
precache_file ("maps/e1m8.bsp"); precache_file ("maps/e1m8.bsp");
// registered // registered
precache_file2 ("gfx/pop.lmp"); precache_file2 ("gfx/pop.lmp");
precache_file2 ("maps/e2m1.bsp"); precache_file2 ("maps/e2m1.bsp");
precache_file2 ("maps/e2m2.bsp"); precache_file2 ("maps/e2m2.bsp");
precache_file2 ("maps/e2m3.bsp"); precache_file2 ("maps/e2m3.bsp");
@ -126,7 +107,6 @@ void() main =
precache_file2 ("maps/e2m5.bsp"); precache_file2 ("maps/e2m5.bsp");
precache_file2 ("maps/e2m6.bsp"); precache_file2 ("maps/e2m6.bsp");
precache_file2 ("maps/e2m7.bsp"); precache_file2 ("maps/e2m7.bsp");
precache_file2 ("maps/e3m1.bsp"); precache_file2 ("maps/e3m1.bsp");
precache_file2 ("maps/e3m2.bsp"); precache_file2 ("maps/e3m2.bsp");
precache_file2 ("maps/e3m3.bsp"); precache_file2 ("maps/e3m3.bsp");
@ -134,7 +114,6 @@ void() main =
precache_file2 ("maps/e3m5.bsp"); precache_file2 ("maps/e3m5.bsp");
precache_file2 ("maps/e3m6.bsp"); precache_file2 ("maps/e3m6.bsp");
precache_file2 ("maps/e3m7.bsp"); precache_file2 ("maps/e3m7.bsp");
precache_file2 ("maps/e4m1.bsp"); precache_file2 ("maps/e4m1.bsp");
precache_file2 ("maps/e4m2.bsp"); precache_file2 ("maps/e4m2.bsp");
precache_file2 ("maps/e4m3.bsp"); precache_file2 ("maps/e4m3.bsp");
@ -143,9 +122,7 @@ void() main =
precache_file2 ("maps/e4m6.bsp"); precache_file2 ("maps/e4m6.bsp");
precache_file2 ("maps/e4m7.bsp"); precache_file2 ("maps/e4m7.bsp");
precache_file2 ("maps/e4m8.bsp"); precache_file2 ("maps/e4m8.bsp");
precache_file2 ("maps/end.bsp"); precache_file2 ("maps/end.bsp");
precache_file2 ("maps/dm1.bsp"); precache_file2 ("maps/dm1.bsp");
precache_file2 ("maps/dm2.bsp"); precache_file2 ("maps/dm2.bsp");
precache_file2 ("maps/dm3.bsp"); precache_file2 ("maps/dm3.bsp");
@ -153,16 +130,12 @@ void() main =
precache_file2 ("maps/dm5.bsp"); precache_file2 ("maps/dm5.bsp");
precache_file2 ("maps/dm6.bsp"); precache_file2 ("maps/dm6.bsp");
}; };
entity lastspawn; entity lastspawn;
//======================= //=======================
/*QUAKED worldspawn (0 0 0) ? /*QUAKED worldspawn (0 0 0) ?
Only used for the world entity. Only used for the world entity.
Set message to the level name. Set message to the level name.
Set sounds to the cd track to play. Set sounds to the cd track to play.
World Types: World Types:
0: medieval 0: medieval
1: metal 1: metal
@ -173,37 +146,27 @@ void() worldspawn =
{ {
lastspawn = world; lastspawn = world;
InitBodyQue (); InitBodyQue ();
rj = 1;
// custom map attributes // custom map attributes
if (self.model == "maps/e1m8.bsp") if (self.model == "maps/e1m8.bsp")
cvar_set ("sv_gravity", "100"); cvar_set ("sv_gravity", "100");
// +POX // +POX
else else
cvar_set ("sv_gravity", "790"); cvar_set ("sv_gravity", "790");
cvar_set ("sv_friction", "3.12"); cvar_set ("sv_friction", "3.12");
// + POX-- make sure gamedir is "pox" // + POX-- make sure gamedir is "pox"
if (infokey(world, "*gamedir") != "pox") if (infokey(world, "*gamedir") != "paroxysm")
error("Gamedir must be pox\n"); error("Gamedir must be \"paroxysm\"\n");
// - POX // - POX
//POX - for Last Man Standing Mode //POX - for Last Man Standing Mode
fraglimit_LMS = cvar("fraglimit"); fraglimit_LMS = cvar("fraglimit");
// -POX // -POX
// the area based ambient sounds MUST be the first precache_sounds // the area based ambient sounds MUST be the first precache_sounds
// player precaches // player precaches
W_Precache (); // get weapon precaches W_Precache (); // get weapon precaches
// sounds used from C physics code // sounds used from C physics code
precache_sound ("demon/dland2.wav"); // landing thud precache_sound ("demon/dland2.wav"); // landing thud
precache_sound ("misc/h2ohit1.wav"); // landing splash precache_sound ("misc/h2ohit1.wav"); // landing splash
// setup precaches allways needed // setup precaches allways needed
precache_sound ("items/itembk2.wav"); // item respawn sound precache_sound ("items/itembk2.wav"); // item respawn sound
precache_sound ("player/plyrjmp8.wav"); // player jump precache_sound ("player/plyrjmp8.wav"); // player jump
@ -214,7 +177,6 @@ void() worldspawn =
precache_sound ("player/gasp1.wav"); // gasping for air precache_sound ("player/gasp1.wav"); // gasping for air
precache_sound ("player/gasp2.wav"); // taking breath precache_sound ("player/gasp2.wav"); // taking breath
precache_sound ("player/h2odeath.wav"); // drowning death precache_sound ("player/h2odeath.wav"); // drowning death
precache_sound ("misc/talk.wav"); // talk precache_sound ("misc/talk.wav"); // talk
precache_sound ("player/teledth1.wav"); // telefrag precache_sound ("player/teledth1.wav"); // telefrag
precache_sound ("misc/r_tele1.wav"); // teleport sounds precache_sound ("misc/r_tele1.wav"); // teleport sounds
@ -228,69 +190,54 @@ void() worldspawn =
precache_sound ("weapons/lhit.wav"); //lightning precache_sound ("weapons/lhit.wav"); //lightning
precache_sound ("weapons/lstart.wav"); //lightning start precache_sound ("weapons/lstart.wav"); //lightning start
precache_sound ("items/damage3.wav"); precache_sound ("items/damage3.wav");
precache_sound ("misc/power.wav"); //lightning for boss precache_sound ("misc/power.wav"); //lightning for boss
// player gib sounds // player gib sounds
precache_sound ("player/gib.wav"); // player gib sound precache_sound ("player/gib.wav"); // player gib sound
precache_sound ("player/udeath.wav"); // player gib sound precache_sound ("player/udeath.wav"); // player gib sound
precache_sound ("player/tornoff2.wav"); // gib sound precache_sound ("player/tornoff2.wav"); // gib sound
// player pain sounds // player pain sounds
precache_sound ("player/pain1.wav"); precache_sound ("player/pain1.wav");
precache_sound ("player/pain2.wav"); precache_sound ("player/pain2.wav");
precache_sound ("player/pain3.wav"); precache_sound ("player/pain3.wav");
precache_sound ("player/pain4.wav"); precache_sound ("player/pain4.wav");
precache_sound ("player/pain5.wav"); precache_sound ("player/pain5.wav");
precache_sound ("player/pain6.wav"); precache_sound ("player/pain6.wav");
// player death sounds // player death sounds
precache_sound ("player/death1.wav"); precache_sound ("player/death1.wav");
precache_sound ("player/death2.wav"); precache_sound ("player/death2.wav");
precache_sound ("player/death3.wav"); precache_sound ("player/death3.wav");
precache_sound ("player/death4.wav"); precache_sound ("player/death4.wav");
precache_sound ("player/death5.wav"); precache_sound ("player/death5.wav");
precache_sound ("boss1/sight1.wav"); precache_sound ("boss1/sight1.wav");
// ax sounds // ax sounds
precache_sound ("weapons/ax1.wav"); // ax swoosh precache_sound ("weapons/ax1.wav"); // ax swoosh
precache_sound ("player/axhit1.wav"); // ax hit meat precache_sound ("player/axhit1.wav"); // ax hit meat
precache_sound ("player/axhit2.wav"); // ax hit world precache_sound ("player/axhit2.wav"); // ax hit world
precache_sound ("player/h2ojump.wav"); // player jumping into water precache_sound ("player/h2ojump.wav"); // player jumping into water
precache_sound ("player/slimbrn2.wav"); // player enter slime precache_sound ("player/slimbrn2.wav"); // player enter slime
precache_sound ("player/inh2o.wav"); // player enter water precache_sound ("player/inh2o.wav"); // player enter water
precache_sound ("player/inlava.wav"); // player enter lava precache_sound ("player/inlava.wav"); // player enter lava
precache_sound ("misc/outwater.wav"); // leaving water sound precache_sound ("misc/outwater.wav"); // leaving water sound
precache_sound ("player/lburn1.wav"); // lava burn precache_sound ("player/lburn1.wav"); // lava burn
precache_sound ("player/lburn2.wav"); // lava burn precache_sound ("player/lburn2.wav"); // lava burn
precache_sound ("misc/water1.wav"); // swimming precache_sound ("misc/water1.wav"); // swimming
precache_sound ("misc/water2.wav"); // swimming precache_sound ("misc/water2.wav"); // swimming
// Invulnerability sounds // Invulnerability sounds
precache_sound ("items/protect.wav"); precache_sound ("items/protect.wav");
precache_sound ("items/protect2.wav"); precache_sound ("items/protect2.wav");
precache_sound ("items/protect3.wav"); precache_sound ("items/protect3.wav");
// POX - for Predator Mode // POX - for Predator Mode
precache_sound ("items/inv1.wav"); precache_sound ("items/inv1.wav");
precache_sound ("items/inv2.wav"); precache_sound ("items/inv2.wav");
precache_sound ("items/inv3.wav"); precache_sound ("items/inv3.wav");
precache_model ("progs/player.mdl"); precache_model ("progs/player.mdl");
precache_model ("progs/eyes.mdl"); precache_model ("progs/eyes.mdl");
precache_model ("progs/h_player.mdl"); precache_model ("progs/h_player.mdl");
precache_model ("progs/gib1.mdl"); precache_model ("progs/gib1.mdl");
precache_model ("progs/gib2.mdl"); precache_model ("progs/gib2.mdl");
precache_model ("progs/gib3.mdl"); precache_model ("progs/gib3.mdl");
precache_model ("progs/s_bubble.spr"); // drowning bubbles precache_model ("progs/s_bubble.spr"); // drowning bubbles
precache_model ("progs/s_explod.spr"); // sprite explosion precache_model ("progs/s_explod.spr"); // sprite explosion
precache_model ("progs/v_axe.mdl"); precache_model ("progs/v_axe.mdl");
/* /*
precache_model ("progs/v_shot.mdl"); precache_model ("progs/v_shot.mdl");
@ -299,8 +246,6 @@ void() worldspawn =
precache_model ("progs/v_shot2.mdl"); precache_model ("progs/v_shot2.mdl");
precache_model ("progs/v_nail2.mdl"); precache_model ("progs/v_nail2.mdl");
precache_model ("progs/v_rock2.mdl"); precache_model ("progs/v_rock2.mdl");
precache_model ("progs/bolt.mdl"); // for lightning gun precache_model ("progs/bolt.mdl"); // for lightning gun
precache_model ("progs/bolt2.mdl"); // for lightning gun precache_model ("progs/bolt2.mdl"); // for lightning gun
precache_model ("progs/bolt3.mdl"); // for boss shock precache_model ("progs/bolt3.mdl"); // for boss shock
@ -311,13 +256,9 @@ void() worldspawn =
precache_model ("progs/grenade.mdl"); precache_model ("progs/grenade.mdl");
precache_model ("progs/spike.mdl"); precache_model ("progs/spike.mdl");
precache_model ("progs/s_spike.mdl"); precache_model ("progs/s_spike.mdl");
precache_model ("progs/backpack.mdl"); precache_model ("progs/backpack.mdl");
precache_model ("progs/zom_gib.mdl"); precache_model ("progs/zom_gib.mdl");
//precache_model ("progs/v_light.mdl"); //precache_model ("progs/v_light.mdl");
// + POX precaches // + POX precaches
precache_sound ("misc/owater2.wav"); // leaving water sound precache_sound ("misc/owater2.wav"); // leaving water sound
precache_sound ("misc/inh2ob.wav"); // renter water precache_sound ("misc/inh2ob.wav"); // renter water
@ -337,7 +278,6 @@ void() worldspawn =
precache_sound ("misc/foot2.wav"); precache_sound ("misc/foot2.wav");
precache_sound ("misc/foot3.wav"); precache_sound ("misc/foot3.wav");
precache_sound ("misc/foot4.wav"); precache_sound ("misc/foot4.wav");
//Narration //Narration
precache_sound ("nar/n_elim.wav"); precache_sound ("nar/n_elim.wav");
@ -350,11 +290,9 @@ void() worldspawn =
//Bounce pad sound //Bounce pad sound
precache_sound ("misc/menu2.wav"); precache_sound ("misc/menu2.wav");
// - POX // - POX
// //
// Setup light animation tables. 'a' is total darkness, 'z' is maxbright. // Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
// //
// 0 normal // 0 normal
lightstyle(0, "m"); lightstyle(0, "m");
@ -388,23 +326,18 @@ void() worldspawn =
// + POX lightstyles // + POX lightstyles
// 12 SLOW STROBE2 // 12 SLOW STROBE2
lightstyle(12, "ggggggzzzzzzgggggg"); lightstyle(12, "ggggggzzzzzzgggggg");
// 13 SLOW STROBE3 // 13 SLOW STROBE3
lightstyle(13, "ggggggggggggzzzzzz"); lightstyle(13, "ggggggggggggzzzzzz");
// 10 FLUORESCENT FLICKER // 10 FLUORESCENT FLICKER
lightstyle(10, "bbbbbmmmccmmamambbbmmbbbbmmaammmcccmamamm"); lightstyle(10, "bbbbbmmmccmmamambbbmmbbbbmmaammmcccmamamm");
// 11 SLOW PULSE NOT FADE TO BLACK // 11 SLOW PULSE NOT FADE TO BLACK
lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
// styles 32-62 are assigned by the light program for switchable lights // styles 32-62 are assigned by the light program for switchable lights
// 63 testing // 63 testing
lightstyle(63, "a"); lightstyle(63, "a");
}; };
void() StartFrame = void() StartFrame =
{ {
timelimit = cvar("timelimit") * 60; timelimit = cvar("timelimit") * 60;
@ -415,22 +348,16 @@ void() StartFrame =
framecount = framecount + 1; framecount = framecount + 1;
}; };
/* /*
============================================================================== ==============================================================================
BODY QUE BODY QUE
============================================================================== ==============================================================================
*/ */
entity bodyque_head; entity bodyque_head;
void() bodyque = void() bodyque =
{ // just here so spawn functions don't complain after the world { // just here so spawn functions don't complain after the world
// creates bodyques // creates bodyques
}; };
void() InitBodyQue = void() InitBodyQue =
{ {
bodyque_head = spawn(); bodyque_head = spawn();
@ -443,8 +370,6 @@ void() InitBodyQue =
bodyque_head.owner.owner.owner.classname = "bodyque"; bodyque_head.owner.owner.owner.classname = "bodyque";
bodyque_head.owner.owner.owner.owner = bodyque_head; bodyque_head.owner.owner.owner.owner = bodyque_head;
}; };
// make a body que entry for the given ent so the ent can be // make a body que entry for the given ent so the ent can be
// respawned elsewhere // respawned elsewhere
void(entity ent) CopyToBodyQue = void(entity ent) CopyToBodyQue =
@ -461,5 +386,3 @@ void(entity ent) CopyToBodyQue =
setsize (bodyque_head, ent.mins, ent.maxs); setsize (bodyque_head, ent.mins, ent.maxs);
bodyque_head = bodyque_head.owner; bodyque_head = bodyque_head.owner;
}; };