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 =
{ // do nothing, just don't ome all the way back out
void() button_blocked = // do nothing, just don't come 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 =
{
if (self.sounds == 0)
{
if (self.sounds == 0) {
precache_sound ("buttons/airbut1.wav");
self.noise = "buttons/airbut1.wav";
}
if (self.sounds == 1)
{
if (self.sounds == 1) {
precache_sound ("buttons/switch21.wav");
self.noise = "buttons/switch21.wav";
}
if (self.sounds == 2)
{
if (self.sounds == 2) {
precache_sound ("buttons/switch02.wav");
self.noise = "buttons/switch02.wav";
}
if (self.sounds == 3)
{
if (self.sounds == 3) {
precache_sound ("buttons/switch04.wav");
self.noise = "buttons/switch04.wav";
}
@ -115,17 +111,13 @@ void() func_button =
self.blocked = button_blocked;
self.use = button_use;
if (self.health)
{
if (self.health) {
self.max_health = self.health;
self.th_die = button_killed;
self.takedamage = DAMAGE_YES;
// + POX
self.nobleed = TRUE;
// - POX
}
else
self.nobleed = TRUE; // + POX
} else
self.touch = button_touch;
if (!self.speed)

View File

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

View File

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

View File

@ -4,36 +4,26 @@ float DOOR_DONT_LINK = 4;
float DOOR_GOLD_KEY = 8;
float DOOR_SILVER_KEY = 16;
float DOOR_TOGGLE = 32;
/*
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
double/quad doors.
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.
Door.enemy chains from the master door through all doors linked in the chain.
*/
/*
=============================================================================
THINK FUNCTIONS
=============================================================================
*/
void() door_go_down;
void() door_go_up;
void() door_blocked =
{
other.deathtype = "squish";
T_Damage (other, self, self.goalentity, self.dmg);
// 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
if (self.wait >= 0)
@ -44,8 +34,6 @@ void() door_blocked =
door_go_down ();
}
};
void() door_hit_top =
{
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.nextthink = self.ltime + self.wait;
};
void() door_hit_bottom =
{
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_BOTTOM;
};
void() door_go_down =
{
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
@ -74,12 +60,10 @@ void() door_go_down =
self.state = STATE_DOWN;
SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
};
void() door_go_up =
{
if (self.state == STATE_UP)
return; // allready going up
if (self.state == STATE_TOP)
{ // reset top wait time
self.nextthink = self.ltime + self.wait;
@ -89,35 +73,24 @@ void() door_go_up =
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, door_hit_top);
SUB_UseTargets();
};
/*
=============================================================================
ACTIVATION FUNCTIONS
=============================================================================
*/
void() door_fire =
{
local entity oself;
local entity starte;
if (self.owner != self)
objerror ("door_fire: self.owner != self");
// play use key sound
if (self.items)
sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM);
self.message = string_null; // no more message
oself = self;
if (self.spawnflags & DOOR_TOGGLE)
{
if (self.state == STATE_UP || self.state == STATE_TOP)
@ -144,39 +117,28 @@ void() door_fire =
} while ( (self != starte) && (self != world) );
self = oself;
};
void() door_use =
{
local entity oself;
self.message = ""; // door message are for touch only
self.owner.message = "";
self.enemy.message = "";
oself = self;
self = self.owner;
door_fire ();
self = oself;
};
void() door_trigger_touch =
{
if (other.health <= 0)
return;
if (time < self.attack_finished)
return;
self.attack_finished = time + 1;
activator = other;
self = self.owner;
door_use ();
};
void() door_killed =
{
local entity oself;
@ -188,12 +150,9 @@ void() door_killed =
door_use ();
self = oself;
};
/*
================
door_touch
Prints messages and opens key doors
================
*/
@ -203,9 +162,7 @@ void() door_touch =
return;
if (self.owner.attack_finished > time)
return;
self.owner.attack_finished = time + 2;
if (self.owner.message != "")
{
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
@ -216,7 +173,6 @@ void() door_touch =
// key door stuff
if (!self.items)
return;
// FIXME: blink key on player's status bar
if ( (self.items & other.items) != self.items )
{
@ -260,41 +216,31 @@ void() door_touch =
}
return;
}
other.items = other.items - self.items;
self.touch = SUB_Null;
if (self.enemy)
self.enemy.touch = SUB_Null; // get paired door
door_use ();
};
/*
=============================================================================
SPAWNING FUNCTIONS
=============================================================================
*/
entity(vector fmins, vector fmaxs) spawn_field =
{
local entity trigger;
local vector t1, t2;
trigger = spawn();
trigger.movetype = MOVETYPE_NONE;
trigger.solid = SOLID_TRIGGER;
trigger.owner = self;
trigger.touch = door_trigger_touch;
t1 = fmins;
t2 = fmaxs;
setsize (trigger, t1 - '60 60 8', t2 + '60 60 8');
return (trigger);
};
float (entity e1, entity e2) EntitiesTouching =
{
if (e1.mins_x > e2.maxs_x)
@ -311,20 +257,15 @@ float (entity e1, entity e2) EntitiesTouching =
return FALSE;
return TRUE;
};
/*
=============
LinkDoors
=============
*/
void() LinkDoors =
{
local entity t, starte;
local vector cmins, cmaxs;
if (self.enemy)
return; // already linked by another door
if (self.spawnflags & 4)
@ -332,7 +273,6 @@ void() LinkDoors =
self.owner = self.enemy = self;
return; // don't want to link this door
}
cmins = self.mins;
cmaxs = self.maxs;
@ -342,36 +282,29 @@ void() LinkDoors =
do
{
self.owner = starte; // master door
if (self.health)
starte.health = self.health;
if (self.targetname)
starte.targetname = self.targetname;
if (self.message != "")
starte.message = self.message;
t = find (t, classname, self.classname);
if (!t)
{
self.enemy = starte; // make the chain a loop
// shootable, fired, or key doors just needed the owner/enemy links,
// they don't spawn a field
self = self.owner;
if (self.health)
return;
if (self.targetname)
return;
if (self.items)
return;
self.owner.trigger_field = spawn_field(cmins, cmaxs);
return;
}
if (EntitiesTouching(self,t))
{
if (t.enemy)
@ -379,7 +312,6 @@ void() LinkDoors =
self.enemy = t;
self = t;
if (t.mins_x < cmins_x)
cmins_x = t.mins_x;
if (t.mins_y < cmins_y)
@ -394,19 +326,12 @@ void() LinkDoors =
cmaxs_z = t.maxs_z;
}
} while (1 );
};
/*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.
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).
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
"angle" determines the opening direction
"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
4) screechy metal
*/
void() func_door =
{
if (world.worldtype == 0)
{
precache_sound ("doors/medtry.wav");
@ -487,17 +409,13 @@ void() func_door =
self.noise1 = "doors/ddoor2.wav";
self.noise2 = "doors/ddoor1.wav";
}
SetMovedir ();
self.max_health = self.health;
self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH;
setorigin (self, self.origin);
setmodel (self, self.model);
self.classname = "door";
self.blocked = door_blocked;
self.use = door_use;
@ -514,10 +432,8 @@ void() func_door =
self.lip = 8;
if (!self.dmg)
self.dmg = 2;
self.pos1 = self.origin;
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
// but spawn in the open position
if (self.spawnflags & DOOR_START_OPEN)
@ -526,9 +442,7 @@ void() func_door =
self.pos2 = self.pos1;
self.pos1 = self.origin;
}
self.state = STATE_BOTTOM;
if (self.health)
{
self.takedamage = DAMAGE_YES;
@ -539,21 +453,16 @@ void() func_door =
self.wait = -1;
self.touch = door_touch;
// LinkDoors can't be done until all of the doors have been spawned, so
// the sizes can be detected properly.
self.think = LinkDoors;
self.nextthink = self.ltime + 0.1;
};
/*
=============================================================================
SECRET DOORS
=============================================================================
*/
void() fd_secret_move1;
void() fd_secret_move2;
void() fd_secret_move3;
@ -561,26 +470,21 @@ void() fd_secret_move4;
void() fd_secret_move5;
void() fd_secret_move6;
void() fd_secret_done;
float SECRET_OPEN_ONCE = 1; // stays open
float SECRET_1ST_LEFT = 2; // 1st move is left of arrow
float SECRET_1ST_DOWN = 4; // 1st move is down from arrow
float SECRET_NO_SHOOT = 8; // only opened by trigger
float SECRET_YES_SHOOT = 16; // shootable even if targeted
void () fd_secret_use =
{
local float temp;
self.health = 10000;
// exit if still moving around...
if (self.origin != self.oldorigin)
return;
self.message = string_null; // no more message
SUB_UseTargets(); // fire all targets / killtargets
if (!(self.spawnflags & SECRET_NO_SHOOT))
@ -589,12 +493,10 @@ void () fd_secret_use =
self.takedamage = DAMAGE_NO;
}
self.velocity = '0 0 0';
// Make a sound, wait a little...
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.nextthink = self.ltime + 0.1;
temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
makevectors(self.mangle);
@ -608,7 +510,6 @@ void () fd_secret_use =
if (!self.t_length)
self. t_length = fabs(v_forward * self.size);
if (self.spawnflags & SECRET_1ST_DOWN)
self.dest1 = self.origin - v_up * self.t_width;
else
@ -618,12 +519,10 @@ void () fd_secret_use =
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
};
void (entity attacker, float damage) fd_secret_pain =
{
fd_secret_use ();
};
// Wait after first movement...
void () fd_secret_move1 =
{
@ -631,14 +530,12 @@ void () fd_secret_move1 =
self.think = fd_secret_move2;
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
};
// Start moving sideways w/sound...
void () fd_secret_move2 =
{
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
};
// Wait here until time to go back...
void () fd_secret_move3 =
{
@ -649,14 +546,12 @@ void () fd_secret_move3 =
self.think = fd_secret_move4;
}
};
// Move backward...
void () fd_secret_move4 =
{
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
};
// Wait 1 second...
void () fd_secret_move5 =
{
@ -664,13 +559,11 @@ void () fd_secret_move5 =
self.think = fd_secret_move6;
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
};
void () fd_secret_move6 =
{
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
};
void () fd_secret_done =
{
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);
};
void () secret_blocked =
{
if (time < self.attack_finished)
@ -691,11 +583,9 @@ void () secret_blocked =
other.deathtype = "squish";
T_Damage (other, self, self, self.dmg);
};
/*
================
secret_touch
Prints messages
================
*/
@ -705,7 +595,6 @@ void() secret_touch =
return;
if (self.attack_finished > time)
return;
self.attack_finished = time + 2;
if (self.message)
@ -716,8 +605,6 @@ void() secret_touch =
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
Basic secret door. Slides back, then to the side. Angle determines direction.
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_length = override LENGTH to move sideways
"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.
"sounds"
1) medieval
2) metal
3) base
*/
void () func_door_secret =
{
if (self.sounds == 0)
@ -764,7 +649,6 @@ void () func_door_secret =
self.noise1 = "doors/basesec2.wav";
self.noise3 = "doors/basesec2.wav";
}
if (!self.dmg)
self.dmg = 2;

View File

@ -1,7 +1,6 @@
/*
Frank Condello 09.28.98 - originally for the M.A.H.E.M. MacQuake Mod.
Now used in paroxysm
EMAIL: pox@planetquake.com
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;
void() dynlight_next;
void() dynlight_find;
void() start_dynlight =
{
//POX v1.1 - changed this for QW support
@ -39,7 +37,6 @@ void() start_dynlight =
dynlight_next();
};
void() dynlight_wait =
{
if (self.wait)
@ -49,11 +46,9 @@ void() dynlight_wait =
self.think = dynlight_next;
};
void() dynlight_next =
{
local entity targ;
targ = find (world, targetname, self.target);
self.target = targ.target;
if (!self.target)
@ -64,12 +59,9 @@ void() dynlight_next =
self.wait = 0;
SUB_CalcMove (targ.origin - self.mins, self.speed, dynlight_wait);
};
void() dynlight_find =
{
local entity targ;
targ = find (world, targetname, self.target);
self.target = targ.target;
setorigin (self, targ.origin - self.mins);
@ -79,20 +71,15 @@ void() dynlight_find =
self.think = start_dynlight;
}
};
void() dynlight_use =
{
if (self.think != dynlight_find)
return; // already activated
start_dynlight();
};
void() dyn_light =
{
precache_model ("progs/null.spr");
if (!self.speed)
self.speed = 100;
@ -107,7 +94,6 @@ void() dyn_light =
setmodel (self, "progs/null.spr");
setsize (self, '0 0 0', '0 0 0');
setorigin (self, self.origin);
// start trains on the second frame, to make sure their targets have had
// a chance to spawn
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>
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)
*/
void() flash_update =
{
// The Player is dead so turn the Flashlight off
if (self.owner.deadflag != DEAD_NO)
self.effects = 0;
// The Player is alive so turn On the Flashlight
else
self.effects = EF_DIMLIGHT;
// Find out which direction player facing
makevectors (self.owner.v_angle);
// Check if there is any things infront of the flashlight
traceline (self.owner.origin , (self.owner.origin+(v_forward * 500)) , FALSE , self);
// Set the Flashlight's position
setorigin (self, trace_endpos+(v_forward * -5));
// Repeat it in 0.02 seconds...
self.nextthink = time + 0.02;
};
void(entity me) flash_on =
{
// Make a new entity to hold the Flashlight
local entity myflash;
// spawn flash
myflash = spawn ();
myflash.movetype = MOVETYPE_NONE;
@ -45,7 +35,6 @@ void(entity me) flash_on =
//POX - changed it to a null sprite
setmodel (myflash, "progs/null.spr");
setsize (myflash, '0 0 0', '0 0 0');
// Wire Player And Flashlight Together
myflash.owner = me;
me.flash = myflash;
@ -58,14 +47,13 @@ void(entity me) flash_on =
makevectors (self.v_angle);
traceline (self.origin , (self.origin+(v_forward * 500)) , FALSE , self);
setorigin (myflash, trace_endpos);
// Start Flashlight Update
myflash.think = flash_update;
myflash.nextthink = time + 0.02;
};
//POX - the user toggle is not implemented (auto light for Darkmode only)
/*
void () flash_toggle =
{
// If Off, Turn On
@ -74,7 +62,6 @@ void () flash_toggle =
self.flash_flag = TRUE;
flash_on();
}
// If On, Turn Off
else
{
@ -84,5 +71,5 @@ void () flash_toggle =
self.flash.nextthink = time + 0.1;
}
};
*/
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,48 +1,36 @@
// POX - bunch of new variable declarations and prototypes for POXworld
//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 st_tshotload; //used to time out the tSot's trigger during reload
.float st_sshotgun; //next attack for ComboGun
.float st_pball; //next attack for Impact grenade
.float which_ammo; //used to clean up ammo switching for ComboGun
.float st_mplasma; //next attack for MegaPlasma Burst
.float st_plasma; //next attack for PlasmaGun
.float LorR; //sets which barrel to use for next PlasmaGun shot
.float st_mine; //next attack for PhaseMine
.float st_grenade; //next attack for Grenades
.float no_obj; //fixes a problem with 'hanging' mines on breakable objects destroyed be something else
.entity spawnmaster;
.entity lastowner;
.float st_nailgun; //next attack for Nailgun
.float st_shrapnel; //next attack for 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 reload_rocket; //keeps count of rockets fired
.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 nobleed; //set to TRUE for triggers, breakable objects, buttons, etc...
// Footsteps
.float spawnsilent;
.vector old_velocity;
//POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM)
void() func_earthquake = {remove(self);};
//Water Movement
.float uwmuffle; //underwater muffle sound timeout
.float onwsound; //on water sound timeout
.float outwsound; //head out of water sound flag
.float inwsound; //head in water sound flag
//New DM option constants
float DM_PREDATOR = 2;
float DM_DARK = 4;
@ -50,7 +38,6 @@ float DM_LMS = 8;
float DM_FFA = 16;
float DM_GIB = 32;
float DM_AUTOSWITCH = 128;
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_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_zoom; // 1 = zoom in, 2 = zoom out, 0 = stop
.float LMS_observer_time; // times the display of observer instructions
//Dark Mode stuff...
.float flash_flag; // flashlight toggle (no user toggle)
.entity flash; // flash entity
// Moved here for use in weapons.qc
float intermission_running;
.float gl_fix; //a hack for toggling gl_flashblend
//Used by Target ID impulse
.float target_id_finished;
.float target_id_toggle;
.float target_id_same;
.entity last_target_id;
void(entity client, string s1, string s2, string s3, string s4) centerprint4 = #73;
//POX v1.2 - improved reseting of colour_light
.float cshift_finished;
.float cshift_off;
//POX 1.2 - allows idtarget state to be saved across levelchanges
.float target_id_temp;

View File

@ -2,17 +2,13 @@
void(float shotcount, vector dir, vector spread) FireBullets2;
void(float damage) spawn_touchblood;
void() muzzleflash;
void (entity targ, entity inflictor, entity attacker, float damage) T_Damage;
void () player_run;
void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage;
void(vector org, float damage) SpawnBlood;
void() SuperDamageSound;
float SECOND_TRIGGER = 15; // Impulse constant for second trigger (more readable than 15)
void(vector org) launch_shrapnel; //Predeclare
void() player_shot1;
void() player_gshot1;
void() player_plasma1;
@ -30,9 +26,7 @@ void() player_axeb1;
void() player_axec1;
void() player_axed1;
//Some nitty-gritty from weapons.qc ...
float() crandom =
{
return 2 * (random() - 0.5);
@ -50,7 +44,6 @@ vector() wall_velocity =
return vel;
};
/*
================
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!
};
//=================================================================================
//Start MegaPlasmaBurst - Used by PlasmaGun's Second Trigger
//=================================================================================
@ -95,12 +87,10 @@ void() T_MplasmaTouch =
self.voided = 1;
if (pointcontents(self.origin) == CONTENT_SKY)
{
if (pointcontents(self.origin) == CONTENT_SKY) {
remove(self);
return;
}
damg = 120 + random()*20;
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_z);
multicast (self.origin, MULTICAST_PHS);
remove(self);
};
//launch_megaplasma
void() launch_megaplasma =
{
local vector dir;
@ -129,7 +115,6 @@ void() launch_megaplasma =
self.currentammo = self.ammo_cells = self.ammo_cells - 9;
sound (self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM);
msg_entity = self;
WriteByte (MSG_ONE, SVC_BIGKICK);
@ -162,21 +147,16 @@ void() launch_megaplasma =
setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin + v_forward*12 + '0 0 12');
};
//End MegaPlasmaBurst
//=================================================================================
//=============================================================================
//
// START PumkinBall CODE - Used by SuperShotgun's Second Trigger (Impact Grenades)
//
//=============================================================================
void() T_PballTouch =
{
local float damg;
if (other == self.owner)
return; // don't explode on owner
@ -193,7 +173,6 @@ void() T_PballTouch =
}
damg = 100 + random()*20;
T_RadiusDamage (self, self.owner, damg, world, "impactgrenade");
// 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_z);
multicast (self.origin, MULTICAST_PHS);
remove(self);
};
/*
================
W_FirePball
@ -216,11 +193,9 @@ W_FirePball
*/
void() W_FirePball =
{
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;
WriteByte (MSG_ONE, SVC_BIGKICK);
@ -236,28 +211,23 @@ void() W_FirePball =
newmis.classname = "impactgrenade";
// set newmis speed
makevectors (self.v_angle);
newmis.velocity = v_forward*700 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
newmis.angles = vectoangles(newmis.velocity);
newmis.touch = T_PballTouch;
// set newmis duration
newmis.nextthink = time + 2.5;
newmis.think = SUB_Remove;
newmis.nextthink = time + 5;
setmodel (newmis, "progs/grenade.mdl");
setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin + v_forward*4);
};
// END PumkinBall CODE
//=============================================================================
//=============================================================================
//
// START MINE CODE (based on hipnotic's proximity mine - uh... hacked to death)
@ -266,12 +236,11 @@ void() W_FirePball =
// But it works.
//
//=============================================================================
void() M_DamExplode =
{
if (self.voided) {
if (self.voided)
return;
}
self.voided = 1;
T_RadiusDamage (self, self.owner, 95, world, "mine");
@ -284,13 +253,11 @@ void() M_DamExplode =
remove (self);
};
/*
================
MineExplode
================
*/
//explode immediately! (for doors, plats and breakable objects
void() MineImExplode =
{
@ -316,57 +283,47 @@ MineTouch
*/
void() MineTouch =
{
if (other == self)
{
return;
}
if (other.solid == SOLID_TRIGGER)
{
if (other.solid == SOLID_TRIGGER) {
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
return;
}
if (other.classname == "grenade")
{
if (other.classname == "grenade") {
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1;
return;
}
if (other.classname == "mine")
{
if (other.classname == "mine") {
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1;
return;
}
if (other.classname == "minearm")
{
if (other.classname == "minearm") {
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
self.nextthink = time + 1;
return;
}
if (other.classname == "minearmed")
{
if (other.classname == "minearmed") {
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
self.classname = "minearm";
self.nextthink = time + 1;
return;
}
if (other.classname == "player")
{
if (other.classname == "player") {
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
MineExplode();
self.nextthink = time + 0.4;
return;
}
if (other.takedamage == DAMAGE_AIM)
{
if (other.takedamage == DAMAGE_AIM) {
MineExplode();
self.think();
return;
@ -377,7 +334,6 @@ void() MineTouch =
self.spawnmaster = other;
self.nextthink = time + 0.1;
};
/*
================
MineArm
@ -388,8 +344,7 @@ void() MineArm =
local entity head;
local float detonate;
if (self.classname == "minearm")
{
if (self.classname == "minearm") {
sound (self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM);
setsize (self, '-3 -3 -3', '3 3 3');
self.owner = world;
@ -398,7 +353,6 @@ void() MineArm =
self.classname = "minearmed";
muzzleflash(); //Will this work?
}
if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE))
{
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
@ -424,17 +378,14 @@ void() MineArm =
if (self.health < 0)
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))
detonate = 1;
traceline(self.origin, head.origin, TRUE, self);
if (trace_fraction != 1.0)
detonate = 0;
if (detonate==1)
{
if (detonate==1) {
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
MineExplode();
self.nextthink = time + 0.25;
@ -453,8 +404,7 @@ W_FireMine
void() W_FireMine =
{
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_AUTO, "weapons/ssgrnde.wav", 1, ATTN_NORM);
sound (self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM);
msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -477,39 +427,32 @@ void() W_FireMine =
newmis.nobleed = TRUE;
// set missile speed
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;
else
{
} else {
newmis.velocity = aim(self, 10000);
newmis.velocity = newmis.velocity * 600;
newmis.velocity_z = 200;
}
newmis.avelocity = '100 600 100';
newmis.angles = vectoangles(newmis.velocity);
newmis.touch = MineTouch;
// set missile duration
newmis.nextthink = time + 0.2;
newmis.delay = time + 15;
newmis.delay = time + 60;
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
//=============================================================================
//=============================================================================
//=============================================================================
//
@ -519,9 +462,13 @@ void() W_FireMine =
//----------------------------------------------------------
//These functions launch a single spike in a random direction
void() spikenal_touch =
{
if (pointcontents(self.origin) == CONTENT_SKY) {
remove(self);
return;
}
if (self.voided) {
return;
}
@ -530,23 +477,15 @@ void() spikenal_touch =
if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
// hit something that bleeds
if (other.takedamage)
{
if (other.takedamage) {
spawn_touchblood (12);
other.deathtype = "shrapnel";
T_Damage (other, self, self.owner, 12);
remove(self);
}
else if (random() > 0.9)
{
else if (random() > 0.9) {
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_SPIKE);
WriteCoord (MSG_MULTICAST, self.origin_x);
@ -555,14 +494,12 @@ void() spikenal_touch =
multicast (self.origin, MULTICAST_PHS);
remove(self);
}
};
//POX - Get a random vector for Shrapnel
vector() VelocityForShrapnel =
{
local vector v;
v_x = 200 * crandom();
v_y = 200 * crandom();
v_z = 200 * crandom();
@ -571,7 +508,6 @@ vector() VelocityForShrapnel =
v_z = v_z - (v_z*2);
v = v * 6;
return v;
};
@ -579,6 +515,7 @@ vector() VelocityForShrapnel =
void(vector org) launch_shrapnel =
{
newmis = spawn ();
newmis.voided = 0;
newmis.owner = self.owner;
newmis.movetype = MOVETYPE_BOUNCE;
@ -598,12 +535,9 @@ void(vector org) launch_shrapnel =
setmodel (newmis, "progs/mwrub1.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, org);
};
//----------------------------------------------------------
//and now the bomb code...
void() ShrapnelExplode =
{
if (self.voided) {
@ -611,14 +545,12 @@ void() ShrapnelExplode =
}
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);
T_RadiusDamage (self, self.owner, 160, world, "shrapnel");
if (self.owner != world)
@ -630,7 +562,6 @@ void() ShrapnelExplode =
WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS);
remove (self);
};
@ -651,8 +582,7 @@ void() ShrapnelThink =
return;
// 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 = world;
self.nextthink = self.shrap_time;
@ -666,6 +596,7 @@ void() ShrapnelThink =
self.nextthink = time + 0.1;
};
void() ShrapnelTouch =
{
local float r;
@ -690,10 +621,9 @@ void() ShrapnelTouch =
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
// End shrapnel bomb
//=============================================================================
//=============================================================================
/*
================
@ -704,8 +634,7 @@ void() W_FireShrapnel =
{
self.ammo_rockets = self.ammo_rockets - 1;
self.currentammo = self.ammo_nails = self.ammo_nails - 30;
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
sound (self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM);
msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -713,11 +642,9 @@ void() W_FireShrapnel =
//Added weapon kickback (as long as you're not in mid air)
if (self.flags & FL_ONGROUND)
self.velocity = self.velocity + v_forward* -115;
newmis = spawn ();
newmis.voided = 0;
newmis.owner = self;
newmis.movetype = MOVETYPE_BOUNCE;
newmis.solid = SOLID_BBOX;
newmis.classname = "shrapnel";
@ -726,38 +653,29 @@ void() W_FireShrapnel =
// set newmis speed
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;
else
{
} else {
newmis.velocity = aim(self, 10000);
newmis.velocity = newmis.velocity * 600;
newmis.velocity_z = 200;
}
newmis.avelocity = '300 300 300';
newmis.angles = vectoangles(newmis.velocity);
newmis.touch = ShrapnelTouch;
// set newmis duration
newmis.nextthink = time + 0.1;
newmis.think = ShrapnelThink;
setmodel (newmis, "progs/grenade.mdl");
newmis.skin = 2;
setsize (newmis, '0 0 0', '0 0 0');
setorigin (newmis, self.origin);
};
/*
============
W_SecondTrigger
Second Trigger Impulses
POX v1.1 - seperated this from weapons.qc - cleaned it up a bit
============
*/
@ -768,18 +686,15 @@ void() W_SecondTrigger =
return;
// check for NailGun's second Trigger
if (self.weapon == IT_SUPER_NAILGUN)
{
if (!self.shrap_detonate) // Check if a bomb is already set
{
if (self.weapon == IT_SUPER_NAILGUN) {
if (!self.shrap_detonate) { // Check if a bomb is already set
// 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);
sprint (self, PRINT_HIGH, "Not enough ammo...\n");
}
else if (self.st_shrapnel < time)
{
} else if (self.st_shrapnel < time) {
self.weaponframe = 0;
SuperDamageSound();
self.st_shrapnel = time + 0.1; // Allow a fast detonate
@ -787,12 +702,10 @@ void() W_SecondTrigger =
W_FireShrapnel();
self.shrap_detonate = TRUE;
}
else
} else {
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
}
else
{
} else {
sound (self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM);
SuperDamageSound();
self.st_shrapnel = time + 0.7; // Time out before next launch
@ -800,21 +713,17 @@ void() W_SecondTrigger =
}
}
// check for t-shot prime
if (self.weapon == IT_TSHOT)
{
//already primed
if (self.prime_tshot == TRUE)
if (self.weapon == IT_TSHOT) {
if (self.prime_tshot == TRUE) { // already primed
SUB_Null ();
//not enough ammo
else if (self.ammo_shells < 3)
{
} else if (self.ammo_shells < 3) { // not enough ammo
SUB_Null ();
}
else
{
} else {
self.st_tshotload = time + 0.9; //give the reload a chance to happen
//make a reload sound!
@ -827,19 +736,16 @@ void() W_SecondTrigger =
}
// check for rhino reload
if (self.weapon == IT_ROCKET_LAUNCHER)
{
//already reloaded
if (self.reload_rocket == 0)
if (self.weapon == IT_ROCKET_LAUNCHER) {
if (self.reload_rocket == 0) { // already reloaded
SUB_Null ();
//if no rockets go away
else if (self.ammo_rockets < 1)
{
} else if (self.ammo_rockets < 1) { // if no rockets go away
SUB_Null ();
}
else
{
} else {
self.st_rocketload = time + 0.6; //give the reload a chance to happen
sound (self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM);
@ -850,22 +756,16 @@ void() W_SecondTrigger =
}
}
// check for Plasmagun second Trigger
if (self.weapon == IT_PLASMAGUN)
{
// check for cells
if (self.ammo_cells < 9)
{
if (self.weapon == IT_PLASMAGUN) {
if (self.ammo_cells < 9) { // check for cells
sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM);
}
else
if (self.st_mplasma < time)
{
if (self.waterlevel > 1) //explode under water
{
} else {
if (self.st_mplasma < time) {
if (self.waterlevel > 1) { // explode under water
sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
self.ammo_cells = 0;
W_SetCurrentAmmo ();
@ -878,30 +778,23 @@ void() W_SecondTrigger =
self.st_mplasma = time + 1.9;
player_mplasma1();
launch_megaplasma();
}
else
} else {
SUB_Null ();
}
}
}
// check for Super Shotgun second Trigger
if (self.weapon == IT_COMBOGUN)
{
if (self.weapon == IT_COMBOGUN) {
// check for rockets
if (self.ammo_rockets < 1)
{
if (self.ammo_rockets < 1) { // check for rockets
self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS;
self.currentammo = self.ammo_rockets;
self.which_ammo = 1;
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
}
else
if (self.st_pball < time)
{
} 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;
@ -910,33 +803,29 @@ void() W_SecondTrigger =
SuperDamageSound();
W_FirePball();
self.st_pball = time + 0.9;
}
else
} 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);
}
if (self.weapon == IT_GRENADE_LAUNCHER) {
else
if (self.st_mine < time)
{
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
} else {
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
}
}
}
self.impulse = 0;
};

View File

@ -15,30 +15,21 @@ void() monster_shalrath = {remove(self);};
void() monster_enforcer = {remove(self);};
void() monster_oldone = {remove(self);};
void() event_lightning = {remove(self);};
/*
==============================================================================
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.
targetname
must be present. The name of this movetarget.
target
the next spot to move to. If not present, stop here for good.
pausetime
The number of seconds to spend standing or bowing for path_stand or path_bow
==============================================================================
*/
/*
=============
t_movetarget
Something has bumped into a movetarget. If it is a monster
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 =
{
local entity temp;
if (other.movetarget != self)
return;
if (other.enemy)
return; // fighting, not following a path
temp = self;
self = other;
other = temp;
if (self.classname == "monster_ogre")
sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
//dprint ("t_movetarget\n");
self.goalentity = self.movetarget = find (world, targetname, other.target);
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
@ -70,9 +57,6 @@ local entity temp;
return;
}
};
void() movetarget_f =
{
if (!self.targetname)
@ -83,7 +67,6 @@ void() movetarget_f =
setsize (self, '-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.
*/
@ -91,7 +74,4 @@ void() path_corner =
{
movetarget_f ();
};
//============================================================================

View File

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

View File

@ -2,65 +2,44 @@
EMAIL: pox@planetquake.com
WEB: http://www.planetquake.com/paroxysm
=========================================================================
Custom Paroxysm visual and audio effects
These are simple little ambient effects that are customizable within Quiver.
Feel free to use this code in anyway.
=========================================================================
*/
//NOT USED IN POXworld
.float spark_freq; // To avoid 'not a feild' server errors
void() e_spark =
{remove(self);};
void() a_drip =
{remove(self);};
/*
=================================================================================================
Custom Sound Entity (cust_sound)
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.
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
strt_onoff - 0 = initially on, 1 = initially off
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_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
targetname - sounds can be triggered by using a targetname.
TOGGLE_SND - spawn flag, determines if sounds can be toggled on and off.
BUGS
1. Quake won't start playing these sounds on the first frame - (Unless you precache every possible sound
at world_spawn)
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
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
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
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)
=================================================================================================
*/
//NOTE: some of these .floats are used in ambient_sound as well (see below)
float TOGGLE_SND = 1;
.float snd_attn;
@ -71,17 +50,14 @@ float TOGGLE_SND = 1;
.float snd_loop;
.float snd_strt;
.string the_snd;
void() sound_think;
void() play_sound;
void() sound_wait =
{
// hang around until next use
self.nextthink = time + 60*10;
self.think = sound_wait;
};
void() stop_sound =
{
// if sound is set to toggle, silence it and set use to play
@ -99,7 +75,6 @@ void() stop_sound =
remove (self);
}
};
void() play_sound =
{
//infinite repeat
@ -122,7 +97,6 @@ void() play_sound =
}
};
void() sound_think =
{
// 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.think = play_sound;
};
void() cust_sound =
{
precache_sound (self.the_snd);
@ -168,7 +141,6 @@ void() cust_sound =
};
//Made this so custom ambient sounds could be called with a single function
//ONLY WORKS WITH LOOPED .WAV FILES
//Added a targetname attribute so ambient sounds can be triggered.
@ -176,12 +148,10 @@ void() cust_sound =
//To my knowledge you can't make these with existing Mac sound editors
//(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)
void() ambientsound_go =
{
ambientsound (self.origin, self.the_snd, self.snd_volume, self.snd_attn);
};
void() ambient_sound =
{
precache_sound (self.the_snd);
@ -208,36 +178,26 @@ void() ambient_sound =
else
self.use = ambientsound_go;
};
/*
colour_light is a small hack to try and simulate coloured lighting.
It does this by calling the built-in v_cshift function
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
The GL Quake command 'gl_polyblend 0' also negates this entity.
colourvalue - this is the only parameter, must be in this format;
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)
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
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)
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
at the end) I could have used multiple stuffcmd statements to make it more user friendly but.. eh.
*/
void() colourlight_wait;
.string colourvalue;
float CLSTART_OFF = 1;
void() colourlight_off =
{
if(other.classname != "player")
@ -249,7 +209,6 @@ void() colourlight_off =
self.touch = SUB_Null;
};
void() colourlight_toggle =
{
//called after light is triggered a second time
@ -276,14 +235,11 @@ void() colourlight_use =
self.use = colourlight_toggle;
};
void() colourlight_wait =
{
//activated by a trigger so wait for touch
self.touch = colourlight_use;
};
void() colour_light =
{
InitTrigger ();
@ -298,23 +254,16 @@ void() colour_light =
self.use = colourlight_wait;
self.touch = SUB_Null;
}
};
/*
particle_stream
Changed for Paroxysm v1.11's new regen stations
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
clr = skin# (0 = blue, 1 = yellow, 2 = red)
*/
.float clr;
void() regen_ambientsound;
void() particle_stream =
{
precache_sound("ambience/regen1.wav");
@ -336,15 +285,12 @@ void() particle_stream =
makestatic (self);
};
/*
POX v1.2
misc_explobox
BSP based explo_box'es
Try to use rectangular objects, since entites use bounding box collision detection
*/
void() bsp_explode =
{
self.takedamage = DAMAGE_NO;
@ -352,6 +298,7 @@ void() bsp_explode =
// did say self.owner
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, TE_EXPLOSION);
@ -362,9 +309,7 @@ void() bsp_explode =
remove (self);
remove (self.trigger_field);
};
void() misc_explobsp =
{
local entity spot;
@ -374,7 +319,6 @@ void() misc_explobsp =
setmodel (self, self.model);
setsize( self, self.mins, self.maxs );
precache_sound ("weapons/r_exp3.wav");
if (!self.health)

View File

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

View File

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

View File

@ -1,6 +1,5 @@
// 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
/* POX - from original Quake ai.qc
=============
visible
@ -17,14 +16,11 @@ float (entity targ) visible =
if (trace_inopen && trace_inwater)
return FALSE; // sight line crossed contents
if (trace_fraction == 1)
return TRUE;
return FALSE;
};
// Short and sweet....
void() ID_CheckTarget =
{
@ -37,11 +33,9 @@ void() ID_CheckTarget =
self.last_target_id = world;
traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self);
org = trace_endpos;
spot = findradius(org, 200);
while (spot)
{
if ((spot.classname == "player") && spot.takedamage)
@ -75,5 +69,4 @@ void() ID_CheckTarget =
spot = spot.chain;
}
};

View File

@ -1,17 +1,12 @@
entity stemp, otemp, s, old;
void() trigger_reactivate =
{
self.solid = SOLID_TRIGGER;
};
//=============================================================================
float SPAWNFLAG_NOMESSAGE = 1;
float SPAWNFLAG_NOTOUCH = 1;
// the wait time has passed, so set back up for another activation
void() multi_wait =
{
@ -22,8 +17,6 @@ void() multi_wait =
self.solid = SOLID_BBOX;
}
};
// the trigger was just touched/killed/used
// self.enemy should be set to the activator so it can be held through a delay
// so wait for the delay time before firing
@ -33,7 +26,6 @@ void() multi_trigger =
{
return; // allready been triggered
}
if (self.classname == "trigger_secret")
{
if (self.enemy.classname != "player")
@ -41,17 +33,13 @@ void() multi_trigger =
found_secrets = found_secrets + 1;
WriteByte (MSG_ALL, SVC_FOUNDSECRET);
}
if (self.noise)
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
// don't trigger again until reset
self.takedamage = DAMAGE_NO;
activator = self.enemy;
SUB_UseTargets();
if (self.wait > 0)
{
self.think = multi_wait;
@ -65,19 +53,16 @@ void() multi_trigger =
self.think = SUB_Remove;
}
};
void() multi_killed =
{
self.enemy = damage_attacker;
multi_trigger();
};
void() multi_use =
{
self.enemy = activator;
multi_trigger();
};
void() multi_touch =
{
if (other.classname != "player")
@ -94,7 +79,6 @@ void() multi_touch =
self.enemy = other;
multi_trigger ();
};
/*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.
If "delay" is set, the trigger waits some time after activating before firing.
@ -129,9 +113,7 @@ void() trigger_multiple =
if (!self.wait)
self.wait = 0.2;
self.use = multi_use;
InitTrigger ();
if (self.health)
{
if (self.spawnflags & SPAWNFLAG_NOTOUCH)
@ -155,8 +137,6 @@ void() trigger_multiple =
}
}
};
/*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
"targetname". If "health" is set, the trigger must be killed to activate.
@ -175,9 +155,7 @@ void() trigger_once =
self.wait = -1;
trigger_multiple();
};
//=============================================================================
/*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.
*/
@ -185,10 +163,7 @@ void() trigger_relay =
{
self.use = SUB_UseTargets;
};
//=============================================================================
/*QUAKED trigger_secret (.5 .5 .5) ?
secret counter trigger
sounds
@ -217,13 +192,9 @@ void() trigger_secret =
precache_sound ("misc/talk.wav");
self.noise = "misc/talk.wav";
}
trigger_multiple ();
};
//=============================================================================
void() counter_use =
{
self.count = self.count - 1;
@ -258,12 +229,9 @@ void() counter_use =
self.enemy = activator;
multi_trigger ();
};
/*QUAKED trigger_counter (.5 .5 .5) ? nomessage
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.
After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself.
*/
void() trigger_counter =
@ -271,22 +239,15 @@ void() trigger_counter =
self.wait = -1;
if (!self.count)
self.count = 2;
self.use = counter_use;
};
/*
==============================================================================
TELEPORT TRIGGERS
==============================================================================
*/
float PLAYER_ONLY = 1;
float SILENT = 2;
void() play_teleport =
{
local string tmpstr;
@ -295,18 +256,15 @@ void() play_teleport =
tmpstr = "misc/r_tele1.wav";
else
tmpstr = "misc/r_tele2.wav";
sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM);
remove (self);
};
void(vector org) spawn_tfog =
{
s = spawn ();
s.origin = org;
s.nextthink = time + 0.1;// + POX - quicker
s.think = play_teleport;
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_TELEPORT);
WriteCoord (MSG_MULTICAST, org_x);
@ -314,15 +272,11 @@ void(vector org) spawn_tfog =
WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PHS);
};
void() tdeath_touch =
{
local entity other2;
if (other == self.owner)
return;
// frag anyone who teleports in on top of an invincible player
if (other.classname == "player")
{
@ -345,18 +299,14 @@ void() tdeath_touch =
}
}
if (other.health)
{
T_Damage (other, self, self, 50000);
}
};
void(vector org, entity death_owner) spawn_tdeath =
{
local entity death;
death = spawn();
death.classname = "teledeath";
death.movetype = MOVETYPE_NONE;
@ -371,12 +321,10 @@ local entity death;
force_retouch = 2; // make sure even still objects get hit
};
void() teleport_touch =
{
local entity t;
local vector org;
if (self.targetname)
{
if (self.nextthink < time)
@ -390,16 +338,12 @@ local vector org;
if (other.classname != "player")
return;
}
// only teleport living creatures
if (other.health <= 0 || other.solid != SOLID_SLIDEBOX)
return;
SUB_UseTargets ();
// put a tfog where the player was
spawn_tfog (other.origin);
t = find (world, targetname, self.target);
if (!t)
objerror ("couldn't find target");
@ -407,10 +351,8 @@ local vector org;
// spawn a tfog flash in front of the destination
makevectors (t.mangle);
org = t.origin + 32 * v_forward;
spawn_tfog (org);
spawn_tdeath(t.origin, other);
// move the player and lock him down for a little while
if (!other.health)
{
@ -418,7 +360,6 @@ local vector org;
other.velocity = (v_forward * other.velocity_x) + (v_forward * other.velocity_y);
return;
}
setorigin (other, t.origin);
other.angles = t.mangle;
if (other.classname == "player")
@ -434,7 +375,6 @@ local vector org;
}
other.flags = other.flags - other.flags & FL_ONGROUND;
};
/*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.
*/
@ -448,30 +388,25 @@ void() info_teleport_destination =
if (!self.targetname)
objerror ("no targetname");
};
void() teleport_use =
{
self.nextthink = time + 0.2;
force_retouch = 2; // make sure even still objects get hit
self.think = SUB_Null;
};
/*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.
If the trigger_teleport has a targetname, it will only teleport entities when it has been fired.
*/
void() trigger_teleport =
{
local vector o;
InitTrigger ();
self.touch = teleport_touch;
// find the destination
if (!self.target)
objerror ("no target");
self.use = teleport_use;
if (!(self.spawnflags & SILENT))
{
precache_sound ("ambience/hum1.wav");
@ -479,15 +414,11 @@ void() trigger_teleport =
ambientsound (o, "ambience/hum1.wav",0.5 , ATTN_STATIC);
}
};
/*
==============================================================================
trigger_setskill
==============================================================================
*/
/*QUAKED trigger_setskill (.5 .5 .5) ?
sets skill level to the value of "message".
Only used on start map.
@ -496,23 +427,17 @@ void() trigger_setskill =
{
remove (self);
};
/*
==============================================================================
ONLY REGISTERED TRIGGERS
==============================================================================
*/
void() trigger_onlyregistered_touch =
{
if (other.classname != "player")
return;
if (self.attack_finished > time)
return;
self.attack_finished = time + 2;
if (cvar("registered"))
{
@ -531,7 +456,6 @@ void() trigger_onlyregistered_touch =
}
}
};
/*QUAKED trigger_onlyregistered (.5 .5 .5) ?
Only fires if playing the registered version, otherwise prints the message
*/
@ -541,15 +465,12 @@ void() trigger_onlyregistered =
InitTrigger ();
self.touch = trigger_onlyregistered_touch;
};
//============================================================================
void() hurt_on =
{
self.solid = SOLID_TRIGGER;
self.nextthink = -1;
};
void() hurt_touch =
{
if (other.takedamage)
@ -559,10 +480,8 @@ void() hurt_touch =
self.think = hurt_on;
self.nextthink = time + 1;
}
return;
};
/*QUAKED trigger_hurt (.5 .5 .5) ?
Any object touching this will be hurt
set dmg to damage amount
@ -575,11 +494,8 @@ void() trigger_hurt =
if (!self.dmg)
self.dmg = 5;
};
//============================================================================
float PUSH_ONCE = 1;
void() trigger_push_touch =
{
if (other.classname == "grenade")
@ -599,8 +515,6 @@ void() trigger_push_touch =
if (self.spawnflags & PUSH_ONCE)
remove(self);
};
/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE
Pushes the player
*/
@ -612,24 +526,18 @@ void() trigger_push =
if (!self.speed)
self.speed = 1000;
};
/*--------------------
trigger_bouncepad
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
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,
(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
(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)
---------------------*/
.float bounce_time;
void() trigger_bounce_touch =
{
if (other.bounce_time > time)
@ -643,8 +551,6 @@ void() trigger_bounce_touch =
sound (other, CHAN_AUTO, "misc/menu2.wav", 1, ATTN_NORM);
}
};
void() trigger_bouncepad =
{
self.solid = SOLID_TRIGGER;
@ -652,18 +558,13 @@ void() trigger_bouncepad =
self.movetype = MOVETYPE_NONE;
self.modelindex = 0;
self.model = "";
self.touch = trigger_bounce_touch;
};
//============================================================================
void() trigger_monsterjump_touch =
{
if ( other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER )
return;
// set XY even if not on ground, so the jump will clear lips
other.velocity_x = self.movedir_x * self.speed;
other.velocity_y = self.movedir_y * self.speed;
@ -672,10 +573,8 @@ void() trigger_monsterjump_touch =
return;
other.flags = other.flags - FL_ONGROUND;
other.velocity_z = self.height;
};
/*QUAKED trigger_monsterjump (.5 .5 .5) ?
Walking monsters that touch this will jump in the direction of the trigger's angle
"speed" default to 200, the speed thrown forward
@ -692,4 +591,3 @@ void() trigger_monsterjump =
InitTrigger ();
self.touch = trigger_monsterjump_touch;
};

View File

@ -7,6 +7,7 @@ void() W_Precache =
{
precache_model ("progs/plasma.mdl");
precache_model ("progs/laser.mdl");
precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
precache_sound ("weapons/rocket1i.wav"); // spike gun
precache_sound ("weapons/sgun1.wav");
@ -14,20 +15,21 @@ void() W_Precache =
precache_sound ("weapons/ric2.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/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/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/bounce2.wav"); // grenade bounce alt
precache_sound ("weapons/shotgn2.wav"); // super shotgun
precache_sound ("weapons/mfire1.wav"); // missfire
precache_sound ("weapons/mfire2.wav"); // megaplasma burst missfire
precache_sound ("weapons/mfire1.wav"); // misfire
precache_sound ("weapons/mfire2.wav"); // megaplasma burst misfire
precache_sound ("weapons/plasma.wav"); // plasmagun fire
precache_sound ("weapons/mplasma.wav"); // megaplasmagun fire
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/minedet.wav"); //mine detonate click
@ -41,8 +43,34 @@ void() W_Precache =
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;
if (trace_ent.takedamage)
{
if (trace_ent.takedamage) {
trace_ent.axhitme = 1;
SpawnBlood (org, 20);
//if (deathmatch > 3)
// T_Damage (trace_ent, self, self, 75);
//else
T_Damage (trace_ent, self, self, 20);
}
else
{ // hit wall
} else { // hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
@ -119,43 +144,26 @@ void(vector org, vector vel) SpawnMeatSpray =
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
================
*/
void(vector org, float damage) SpawnBlood =
{
// + POX - check for a bleeder
if (trace_ent.nobleed)
SpawnNoBleed (org, damage);
else
// - POX
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
if (trace_ent.nobleed) {
WriteByte (MSG_MULTICAST, TE_GUNSHOT);
WriteByte (MSG_MULTICAST, 5);
} else {
WriteByte (MSG_MULTICAST, TE_BLOOD);
WriteByte (MSG_MULTICAST, 1);
}
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (org, MULTICAST_PVS);
}
};
@ -170,11 +178,6 @@ void(float damage) spawn_touchblood =
vel = wall_velocity () * 0.2;
// + POX - check for a bleeder
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;
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
sound (self, CHAN_WEAPON, "weapons/gren.wav", 1, ATTN_NORM);
msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK);
@ -828,7 +831,7 @@ void(float ox) W_FireNails =
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;

View File

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