Okay, before I break the whole thing, it's time to check in. About to start

rewriting it in full Ruamoko -- time to give qfcc something to choke on. :)
This commit is contained in:
Jeff Teunissen 2004-02-11 07:21:30 +00:00
parent 2c4f7410fd
commit 9ef1a2f337
5 changed files with 274 additions and 221 deletions

View file

@ -5,7 +5,7 @@ SRC= buttons.r builtins.r client.r combat.r defs.r doors.r dynlight.r \
HEADERS = client.rh paroxysm.rh config.rh HEADERS = client.rh paroxysm.rh config.rh
RFLAGS += -Wall -Werror -g RFLAGS += -DQUAKEWORLD -Wall -Werror -g
QFCC = qfcc QFCC = qfcc
INSTALLDIR = $(HOME)/.quake/paroxysm/ INSTALLDIR = $(HOME)/.quake/paroxysm/
@ -18,7 +18,6 @@ DEP = $(addprefix .deps/,$(addsuffix .d,$(basename $(SRC))))
@$(QFCC) -M -q $(RFLAGS) -c $< | sed -e 's/\(\.r\)\?\.o\>/.o/' > .deps/`basename $@ .o`.d @$(QFCC) -M -q $(RFLAGS) -c $< | sed -e 's/\(\.r\)\?\.o\>/.o/' > .deps/`basename $@ .o`.d
$(QFCC) $(RFLAGS) -q -c -o $@ $< $(QFCC) $(RFLAGS) -q -c -o $@ $<
all: qwprogs.dat all: qwprogs.dat
qwprogs.dat: $(OBJ) qwprogs.dat: $(OBJ)

View file

@ -50,11 +50,20 @@ void() SetNewParms =
void() DecodeLevelParms = void() DecodeLevelParms =
{ {
#ifdef QUAKEWORLD
localcmd ("serverinfo playerfly 1"); localcmd ("serverinfo playerfly 1");
#endif
//POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session //POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session
if(!@self.target_id_toggle && !@self.target_id_temp) if(!@self.target_id_toggle && !@self.target_id_temp)
@self.target_id_toggle = parm1; @self.target_id_toggle = parm1;
#ifdef QUAKEWORLD
@self.configed = parm2;
if(!@self.target_id_toggle && !@self.target_id_temp)
@self.target_id_toggle = parm1;
@self.configed = parm2; @self.configed = parm2;
//POX v1.2 - run autoexec.cfg ONCE when first joining server only! //POX v1.2 - run autoexec.cfg ONCE when first joining server only!
@ -62,10 +71,13 @@ void() DecodeLevelParms =
@self.configed = TRUE; @self.configed = TRUE;
stuffcmd (@self, "exec autoexec.cfg\n"); stuffcmd (@self, "exec autoexec.cfg\n");
} }
#endif
}; };
/* /*
============ ============
FindIntermission FindIntermission
Returns the entity to view from Returns the entity to view from
============ ============
*/ */
@ -73,10 +85,9 @@ entity() FindIntermission =
{ {
local entity spot; local entity spot;
local float cyc; local float cyc;
// look for info_intermission first // look for info_intermission first
spot = find (world, classname, "info_intermission"); if (spot = find (world, classname, "info_intermission")) { // pick a random one
if (spot)
{ // pick a random one
cyc = random() * 4; cyc = random() * 4;
while (cyc > 1) { while (cyc > 1) {
spot = find (spot, classname, "info_intermission"); spot = find (spot, classname, "info_intermission");
@ -86,9 +97,9 @@ entity() FindIntermission =
} }
return spot; return spot;
} }
// then look for the start position // then look for the start position
spot = find (world, classname, "info_player_start"); if (spot = find (world, classname, "info_player_start"))
if (spot)
return spot; return spot;
objerror ("FindIntermission: no spot"); objerror ("FindIntermission: no spot");
@ -96,15 +107,16 @@ entity() FindIntermission =
void() GotoNextMap = void() GotoNextMap =
{ {
local string newmap; /*
configurable map lists, see if the current map exists as a
serverinfo/localinfo var
*/
local string newmap = INFOKEY (world, mapname);
//ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level //ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level
if (cvar ("samelevel") == 1) // if samelevel is set, stay on same level if (cvar ("samelevel") == 1) { // if samelevel is set, stay on same level
changelevel (mapname); changelevel (mapname);
else { } else {
// configurable map lists, see if the current map exists as a
// serverinfo/localinfo var
newmap = infokey(world, mapname);
if (newmap != "") if (newmap != "")
changelevel (newmap); changelevel (newmap);
else else
@ -481,9 +493,7 @@ void() PutClientInServer =
spawn_tdeath (@self.origin, @self); spawn_tdeath (@self.origin, @self);
// Set Rocket Jump Modifiers // Set Rocket Jump Modifiers
if (stof (infokey (world, "rj"))) { if (!(rj = stof (INFOKEY (world, "rj")))) {
rj = stof (infokey (world, "rj"));
} else {
rj = 1; rj = 1;
} }
@ -1260,13 +1270,16 @@ called when a player connects to a server
*/ */
void() ClientConnect = 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) Hard-code some environmental changes to prevent tampering a little...
NOTE: autoexec.cfg is called at DecodeLevelParms (QW ignores it when
called from quake.rc - which is also ignored)
*/
// POX v1.12 added 'fov 90' (mostly for lms_observer additions) // POX v1.12 added 'fov 90' (mostly for lms_observer additions)
stuffcmd (@self, "alias rules impulse 253; alias secondtrigger impulse 15; alias idtarget impulse 16; alias gllight impulse 17; wait; fov 90; v_idlescale 0.54; v_ipitch_cycle 3.5; v_ipitch_level 0.4; v_iroll_level 0.1; v_iyaw_level 0; v_kickpitch 0.8; v_kickroll 0.8; scr_conspeed 900; cl_bobcycle 0.8; cl_bobup 0; cl_bob 0.015\n"); stuffcmd (@self, "alias rules impulse 253; alias secondtrigger impulse 15; alias idtarget impulse 16; alias gllight impulse 17; wait; fov 90; v_idlescale 0.54; v_ipitch_cycle 3.5; v_ipitch_level 0.4; v_iroll_level 0.1; v_iyaw_level 0; v_kickpitch 0.8; v_kickroll 0.8; scr_conspeed 900; cl_bobcycle 0.8; cl_bobup 0; cl_bob 0.015\n");
// - POX
// + POX LMS late joiners get booted to spectate // LMS late-joiners get booted to spectate
if (!(deathmatch & DM_LMS)) { if (!(deathmatch & DM_LMS)) {
BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, @self.netname);
BPRINT (PRINT_HIGH, " entered the game\n"); BPRINT (PRINT_HIGH, " entered the game\n");
@ -1294,18 +1307,17 @@ void() ClientConnect =
// LMS reconnect as spectator // LMS reconnect as spectator
@self.LMS_observer = 1; @self.LMS_observer = 1;
} }
} }
// a client connecting during an intermission can cause problems // a client connecting during an intermission can cause problems
if (intermission_running) if (intermission_running)
GotoNextMap (); GotoNextMap ();
}; };
/* /*
===========
ClientDisconnect ClientDisconnect
called when a player disconnects from a server called when a player disconnects from a server
============
*/ */
void() ClientDisconnect = void() ClientDisconnect =
{ {
@ -1315,15 +1327,13 @@ void() ClientDisconnect =
BPRINT (PRINT_HIGH, ftos (@self.frags)); BPRINT (PRINT_HIGH, ftos (@self.frags));
BPRINT (PRINT_HIGH, " frags\n"); BPRINT (PRINT_HIGH, " frags\n");
sound (@self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); sound (@self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
// + POX
if ((deathmatch & DM_LMS) && (@self.LMS_registered))
{
lms_plrcount = lms_plrcount - 1;
if (lms_plrcount <= 1) //One or no players left so end the game if ((deathmatch & DM_LMS) && (@self.LMS_registered)) {
lms_plrcount--;
if (lms_plrcount <= 1) // 1 or 0 players left, end the game
NextLevel (); NextLevel ();
} }
// - POX
set_suicide_frame (); set_suicide_frame ();
}; };
@ -1341,24 +1351,29 @@ void(entity targ, entity attacker) ClientObituary =
local string attackerteam; local string attackerteam;
local string targteam; local string targteam;
#else #else
local entity nar; local float attackerteam;
local float targteam;
#endif #endif
local integer gibbed = (targ.health < -40);
#ifdef QUAKEWORLD #ifdef QUAKEWORLD
attackerteam = infokey (attacker, "team"); attackerteam = INFOKEY (attacker, "team");
targteam = infokey (targ, "team"); targteam = INFOKEY (targ, "team");
#else
attackerteam = attacker.team;
targteam = targ.team;
#endif #endif
rnum = random (); rnum = random ();
if (targ.classname == "player") { if (targ.classname == "player") {
if (deathmatch & DM_LMS) { // Last Man Standing frag stuff... if (deathmatch & DM_LMS) { // Last Man Standing frag stuff...
targ.frags = targ.frags - 1; targ.frags--;
//LOGFRAG (attacker, targ); // we don't log frags until the end //LOGFRAG (attacker, targ); // we don't log frags until the end
if (targ.frags <= 0) { if (targ.frags <= 0) {
BPRINT (PRINT_HIGH, targ.netname); BPRINT (PRINT_HIGH, targ.netname + " is eliminated!\n");
BPRINT (PRINT_HIGH, " is eliminated!\n"); lms_plrcount--;
lms_plrcount = lms_plrcount - 1;
sound (targ, CHAN_BODY, "nar/n_elim.wav", 1, ATTN_NONE); sound (targ, CHAN_BODY, "nar/n_elim.wav", 1, ATTN_NONE);
@ -1378,12 +1393,12 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (attacker.owner, targ); LOGFRAG (attacker.owner, targ);
if (!(deathmatch & DM_LMS)) // don't add frags in Last Man Standing if (!(deathmatch & DM_LMS)) // don't add frags in Last Man Standing
attacker.owner.frags = attacker.owner.frags + 1; attacker.owner.frags++;
BPRINT (PRINT_MEDIUM, targ.netname); BPRINT (PRINT_MEDIUM, targ.netname
BPRINT (PRINT_MEDIUM, " was telefragged by "); + " was telefragged by "
BPRINT (PRINT_MEDIUM, attacker.owner.netname); + attacker.owner.netname
BPRINT (PRINT_MEDIUM, "\n"); + "\n");
return; return;
} }
@ -1391,11 +1406,11 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (targ, targ); LOGFRAG (targ, targ);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
targ.frags = targ.frags - 1; targ.frags--;
BPRINT (PRINT_MEDIUM, "MegaShields deflect "); BPRINT (PRINT_MEDIUM, "MegaShields deflect "
BPRINT (PRINT_MEDIUM, targ.netname); + targ.netname
BPRINT (PRINT_MEDIUM, "'s telefrag\n"); + "'s telefrag!\n");
return; return;
} }
@ -1404,13 +1419,12 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (targ, targ); LOGFRAG (targ, targ);
if (!(deathmatch & DM_LMS)) // do regular obituary taunts in LMS if (!(deathmatch & DM_LMS)) // do regular obituary taunts in LMS
targ.frags = targ.frags - 1; targ.frags--;
BPRINT (PRINT_MEDIUM, targ.netname);
BPRINT (PRINT_MEDIUM, " was telefragged by ");
BPRINT (PRINT_MEDIUM, attacker.owner.netname);
BPRINT (PRINT_MEDIUM, "'s MegaShield's power\n");
BPRINT (PRINT_MEDIUM, targ.netname
+ " was telefragged by "
+ attacker.owner.netname
+ "'s MegaShield's power\n");
return; return;
} }
@ -1421,11 +1435,9 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (attacker, attacker); LOGFRAG (attacker, attacker);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
attacker.frags = attacker.frags - 1; attacker.frags--;
BPRINT (PRINT_MEDIUM, attacker.netname);
BPRINT (PRINT_MEDIUM, " squished a teammate\n");
BPRINT (PRINT_MEDIUM, attacker.netname + " squished a teammate\n");
return; return;
} }
} }
@ -1434,66 +1446,80 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (attacker, targ); LOGFRAG (attacker, targ);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
attacker.frags = attacker.frags + 1; attacker.frags++;
BPRINT (PRINT_MEDIUM, attacker.netname);
BPRINT (PRINT_MEDIUM, " squishes ");
BPRINT (PRINT_MEDIUM, targ.netname);
BPRINT (PRINT_MEDIUM, "\n");
BPRINT (PRINT_MEDIUM, attacker.netname + " squishes "
+ targ.netname + "\n");
return; return;
} }
} else { } else {
LOGFRAG (targ, targ); LOGFRAG (targ, targ);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
targ.frags = targ.frags - 1; targ.frags--;
BPRINT (PRINT_MEDIUM, targ.netname);
BPRINT (PRINT_MEDIUM, " was squished\n");
BPRINT (PRINT_MEDIUM, targ.netname + " was squished\n");
return; return;
} }
} }
if (attacker.classname == "player") { if (attacker.classname == "player") {
if (targ == attacker) { // killed @self (dumbass!) if (targ == attacker) { // killed self (dumbass!)
LOGFRAG (attacker, attacker); LOGFRAG (attacker, attacker);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
attacker.frags = attacker.frags - 1; attacker.frags--;
deathstring2 = "\n"; deathstring2 = "\n";
if (targ.deathtype == "grenade") { switch (targ.deathtype) {
case "grenade":
if (rnum < 0.5) if (rnum < 0.5)
deathstring = " tries to put the pin back in"; deathstring = " tries to put the pin back in";
else else
deathstring = " throws the pin"; deathstring = " throws the pin";
} else if (targ.deathtype == "impactgrenade") { break;
case "impactgrenade":
deathstring = " eats his own impact grenade"; deathstring = " eats his own impact grenade";
} else if (targ.deathtype == "megaplasma") { break;
case "megaplasma":
deathstring = " plays with the plasma"; deathstring = " plays with the plasma";
} else if (targ.deathtype == "mine") { break;
case "mine":
if (rnum < 0.67) if (rnum < 0.67)
deathstring = " forgot where his phase mine was"; deathstring = " forgot where his phase mine was";
else else
deathstring = " found his phase mine"; deathstring = " found his phase mine";
} else if (targ.deathtype == "nail") { break;
case "nail":
deathstring = " nails himself to the wall"; deathstring = " nails himself to the wall";
} else if (targ.deathtype == "rocket") { break;
case "rocket":
if (rnum < 0.5) if (rnum < 0.5)
deathstring = " finds his rocket tasty"; deathstring = " finds his rocket tasty";
else else
deathstring = " plays \"Doctor Strangelove\""; deathstring = " plays \"Doctor Strangelove\"";
} else if (targ.deathtype == "shrapnel") { break;
case "shrapnel":
if (rnum < 0.9) if (rnum < 0.9)
deathstring = " finds out what a shrapnel bomb does"; deathstring = " finds out what a shrapnel bomb does";
else else
deathstring = " give us up the bomb"; deathstring = " give us up the bomb";
} else if (targ.deathtype == "supernail") { break;
case "supernail":
deathstring = " decides to use himself for a pin cushion"; deathstring = " decides to use himself for a pin cushion";
} else if (targ.weapon == IT_PLASMAGUN && targ.waterlevel > 1) { break;
default:
if (targ.weapon == IT_PLASMAGUN
&& targ.waterlevel > 1) {
deathstring = " discharges into the "; deathstring = " discharges into the ";
if (targ.watertype == CONTENT_SLIME) if (targ.watertype == CONTENT_SLIME)
deathstring2 = "slime\n"; deathstring2 = "slime\n";
@ -1504,16 +1530,21 @@ void(entity targ, entity attacker) ClientObituary =
} else { } else {
deathstring = " becomes bored with life"; deathstring = " becomes bored with life";
} }
}
BPRINT (PRINT_MEDIUM, targ.netname); BPRINT (PRINT_MEDIUM, targ.netname);
BPRINT (PRINT_MEDIUM, deathstring); BPRINT (PRINT_MEDIUM, deathstring);
BPRINT (PRINT_MEDIUM, deathstring2); BPRINT (PRINT_MEDIUM, deathstring2);
return; return;
} else if ((teamplay == 2) && (targteam == attackerteam) && (attackerteam != "")) { } else if ((teamplay & 2)
&& (targteam == attackerteam)
&& (attackerteam != "")) {
LOGFRAG (attacker, attacker); LOGFRAG (attacker, attacker);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
attacker.frags = attacker.frags - 1; attacker.frags--;
if (rnum < 0.25) if (rnum < 0.25)
deathstring = " mows down a teammate\n"; deathstring = " mows down a teammate\n";
@ -1532,70 +1563,87 @@ void(entity targ, entity attacker) ClientObituary =
LOGFRAG (attacker, targ); LOGFRAG (attacker, targ);
if (!(deathmatch & DM_LMS)) if (!(deathmatch & DM_LMS))
attacker.frags = attacker.frags + 1; attacker.frags++;
deathstring2 = "\n"; deathstring2 = "\n";
if (targ.deathtype == "nail") { switch (targ.deathtype) {
case "nail":
deathstring = " was nailed by "; deathstring = " was nailed by ";
} else if (targ.deathtype == "supernail") { break;
case "supernail":
deathstring = " was punctured by "; deathstring = " was punctured by ";
} else if (targ.deathtype == "grenade") { break;
deathstring = " eats ";
deathstring2 = "'s pineapple\n"; case "grenade":
if (targ.health < -40) { if (gibbed) {
deathstring = " was gibbed by "; deathstring = " was gibbed by ";
deathstring2 = "'s grenade\n"; deathstring2 = "'s grenade\n";
break;
} }
} else if (targ.deathtype == "rocket") { deathstring = " eats ";
if (attacker.super_damage_finished > 0 && targ.health < -40) { deathstring2 = "'s pineapple\n";
break;
case "rocket":
if (attacker.super_damage_finished > 0)
deathstring2 = "'s quad rocket\n";
else
deathstring2 = "'s rocket\n";
if (gibbed) {
if (rnum < 0.3) { if (rnum < 0.3) {
deathstring = " was brutalized by "; deathstring = " was brutalized by ";
} else if (rnum < 0.6) { } else if (rnum < 0.6) {
deathstring = " was smeared by "; deathstring = " was smeared by ";
} else { } else {
BPRINT (PRINT_MEDIUM, attacker.netname); BPRINT (PRINT_MEDIUM, attacker.netname
BPRINT (PRINT_MEDIUM, " rips "); + " rips " + targ.netname
BPRINT (PRINT_MEDIUM, targ.netname); + " a new one!\n");
BPRINT (PRINT_MEDIUM, " a new one\n");
return; return;
} }
deathstring2 = "'s quad rocket\n";
} else { } else {
if (targ.health < -40)
deathstring = " was gibbed by ";
else
deathstring = " rides "; deathstring = " rides ";
deathstring2 = "'s rocket\n";
} }
} else if (targ.deathtype == "megaplasma") { break;
if (targ.health < -40)
case "megaplasma":
if (gibbed)
deathstring = " was discombobulated by "; deathstring = " was discombobulated by ";
else else
deathstring = " bites "; deathstring = " bites ";
deathstring2 = "'s plasma burst\n"; deathstring2 = "'s plasma burst\n";
} else if (targ.deathtype == "impactgrenade") { break;
if (targ.health < -40)
case "impactgrenade":
if (gibbed)
deathstring = " was gibbed by "; deathstring = " was gibbed by ";
else else
deathstring = " swallows "; deathstring = " swallows ";
deathstring2 = "'s impact grenade\n"; deathstring2 = "'s impact grenade\n";
} else if (targ.deathtype == "mine") { break;
if (targ.health < -40)
case "mine":
if (gibbed)
deathstring = " is chum thanks to "; deathstring = " is chum thanks to ";
else else
deathstring = " stepped on "; deathstring = " stepped on ";
deathstring2 = "'s phase mine\n"; deathstring2 = "'s phase mine\n";
} else if (targ.deathtype == "shrapnel") { break;
if (targ.health < -40)
case "shrapnel":
if (gibbed)
deathstring = " gets a face full of "; deathstring = " gets a face full of ";
else else
deathstring = " got too close to "; deathstring = " got too close to ";
deathstring2 = "'s shrapnel bomb\n"; deathstring2 = "'s shrapnel bomb\n";
break;
default:
#ifdef QUAKEWORLD #ifdef QUAKEWORLD
} else if (attacker.weapon == IT_AXE) { if (attacker.weapon == IT_AXE) {
#else #else
} else if (attacker.weapon == IT_BONESAW) { if (attacker.weapon == IT_BONESAW) {
#endif #endif
deathstring = " was butchered by "; deathstring = " was butchered by ";
deathstring2 = "\n"; deathstring2 = "\n";
@ -1609,17 +1657,17 @@ void(entity targ, entity attacker) ClientObituary =
deathstring = " got burned by "; deathstring = " got burned by ";
deathstring2 = "'s plasma\n"; deathstring2 = "'s plasma\n";
} }
BPRINT (PRINT_MEDIUM, targ.netname); break;
BPRINT (PRINT_MEDIUM, deathstring); }
BPRINT (PRINT_MEDIUM, attacker.netname); BPRINT (PRINT_MEDIUM, targ.netname + deathstring
BPRINT (PRINT_MEDIUM, deathstring2); + attacker.netname + deathstring2);
} }
return; return;
} else { // traps, world stuff } else { // traps, world stuff
LOGFRAG (targ, targ); LOGFRAG (targ, targ);
if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode
targ.frags = targ.frags - 1; // killed @self targ.frags--;
if (attacker.classname == "explo_box" || attacker.classname == "explo_bsp") { if (attacker.classname == "explo_box" || attacker.classname == "explo_bsp") {
deathstring = " blew up\n"; deathstring = " blew up\n";
@ -1658,8 +1706,7 @@ void(entity targ, entity attacker) ClientObituary =
deathstring = " died\n"; deathstring = " died\n";
} }
BPRINT (PRINT_MEDIUM, targ.netname); BPRINT (PRINT_MEDIUM, targ.netname + deathstring);
BPRINT (PRINT_MEDIUM, deathstring);
return; return;
} }
} }

View file

@ -96,11 +96,10 @@ void (entity targ, entity attacker) Killed =
/* /*
============
T_Damage T_Damage
The damage is coming from inflictor, but get mad at attacker The damage is coming from inflictor, but get mad at attacker
This should be the only function that ever reduces health. This should be the only function that ever reduces health.
============
*/ */
void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
{ {
@ -108,29 +107,32 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
local entity oldself; local entity oldself;
local float save; local float save;
local float take; local float take;
#ifdef QUAKEWORLD
local string attackerteam, targteam; local string attackerteam, targteam;
#else
local float attackerteam, targteam;
#endif
if (!targ.takedamage) if (!targ.takedamage)
return; return;
if (targ.flags & FL_GODMODE) // godmode completely unaffected by damage
return;
// check for invincibility
if (targ.invincible_finished >= time && @self.invincible_sound < time) {
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
@self.invincible_sound = time + 2;
return;
}
// used by buttons and triggers to set activator for target firing // used by buttons and triggers to set activator for target firing
damage_attacker = attacker; damage_attacker = attacker;
// check for quad damage powerup on the attacker // check for quad damage powerup on the attacker
if (attacker.super_damage_finished > time && inflictor.classname != "door") if (attacker.super_damage_finished > time && inflictor.classname != "door")
damage = damage * 4; 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)
return;
if (targ.invincible_finished >= time && @self.invincible_sound < time) {
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
@self.invincible_sound = time + 2;
return;
}
// save damage based on the target's armor level // save damage based on the target's armor level
save = ceil (targ.armortype * damage); save = ceil (targ.armortype * damage);
@ -188,9 +190,14 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
} }
// team play damage avoidance // team play damage avoidance
//ZOID 12-13-96: @self.team doesn't work in QW. Use keys // ZOID 12-13-96: self.team doesn't work in QW. Use keys
#ifdef QUAKEWORLD
attackerteam = infokey (attacker, "team"); attackerteam = infokey (attacker, "team");
targteam = infokey (targ, "team"); targteam = infokey (targ, "team");
#else
attackerteam = attacker.team;
targteam = targ.team;
#endif
if (((teamplay == 1) || (teamplay == 3)) if (((teamplay == 1) || (teamplay == 3))
&& (attacker.classname == "player") && (attacker.classname == "player")

View file

@ -33,5 +33,6 @@
#define BPRINT(a,b) bprint ((b)) #define BPRINT(a,b) bprint ((b))
#define LOGFRAG(a,b) #define LOGFRAG(a,b)
#define INFOKEY(a,b) ""
#endif // __config_nq_ #endif // __config_nq_

View file

@ -29,9 +29,8 @@
#ifndef __config_qw_ #ifndef __config_qw_
#define __config_qw_ #define __config_qw_
#define QUAKEWORLD 1
#define BPRINT(a,b) bprint ((a), (b)) #define BPRINT(a,b) bprint ((a), (b))
#define LOGFRAG(a,b) logfrag ((a), (b)) #define LOGFRAG(a,b) logfrag ((a), (b))
#define INFOKEY(a,b) infokey ((a), (b))
#endif // __config_qw_ #endif // __config_qw_