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,22 +50,34 @@ 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!
if (!@self.configed) { if (!@self.configed) {
@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
spot = find (world, classname, "info_intermission"); // look for info_intermission first
if (spot) if (spot = find (world, classname, "info_intermission")) { // pick a random one
{ // pick a random one
cyc = random() * 4; cyc = random() * 4;
while (cyc > 1) { while (cyc > 1) {
spot = find (spot, classname, "info_intermission"); spot = find (spot, classname, "info_intermission");
@ -86,25 +97,26 @@ entity() FindIntermission =
} }
return spot; return spot;
} }
// then look for the start position
spot = find (world, classname, "info_player_start"); // then look for the start position
if (spot) if (spot = find (world, classname, "info_player_start"))
return spot; return spot;
objerror ("FindIntermission: no spot"); objerror ("FindIntermission: no spot");
}; };
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...
// 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");
// - POX
// + POX LMS late joiners get booted to spectate 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)
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");
// 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");
@ -1276,14 +1289,14 @@ void() ClientConnect =
BPRINT (PRINT_HIGH, " entered the game\n"); BPRINT (PRINT_HIGH, " entered the game\n");
if (!lms_plrcount) if (!lms_plrcount)
centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); centerprint (@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players...");
else else
centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply."); centerprint (@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.");
} else { //After 40 secs, If there are two or more players, go into observer mode } else { // After 40 secs, If there are two or more players, go into observer mode
if (!lms_plrcount) { //First player arrived, let him wait around if (!lms_plrcount) { //First player arrived, let him wait around
BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, @self.netname);
BPRINT (PRINT_HIGH, " entered the game\n"); BPRINT (PRINT_HIGH, " entered the game\n");
centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); centerprint (@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players...");
} else if (lms_plrcount == 1) { // second player arrived, so go to the next map (for a fair start) } else if (lms_plrcount == 1) { // second player arrived, so go to the next map (for a fair start)
BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, @self.netname);
BPRINT (PRINT_HIGH, " entered the game\n"); BPRINT (PRINT_HIGH, " entered the game\n");
@ -1291,21 +1304,20 @@ void() ClientConnect =
} else { // LMS Game allready started so boot to observe } else { // LMS Game allready started so boot to observe
BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, @self.netname);
BPRINT (PRINT_HIGH, " entered the game late!"); BPRINT (PRINT_HIGH, " entered the game late!");
//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)) if ((deathmatch & DM_LMS) && (@self.LMS_registered)) {
{ lms_plrcount--;
lms_plrcount = lms_plrcount - 1;
if (lms_plrcount <= 1) //One or no players left so end the game 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,86 +1446,105 @@ 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) {
if (rnum < 0.5) case "grenade":
deathstring = " tries to put the pin back in"; if (rnum < 0.5)
else deathstring = " tries to put the pin back in";
deathstring = " throws the pin"; else
} else if (targ.deathtype == "impactgrenade") { deathstring = " throws the pin";
deathstring = " eats his own impact grenade"; break;
} else if (targ.deathtype == "megaplasma") {
deathstring = " plays with the plasma"; case "impactgrenade":
} else if (targ.deathtype == "mine") { deathstring = " eats his own impact grenade";
if (rnum < 0.67) break;
deathstring = " forgot where his phase mine was";
else case "megaplasma":
deathstring = " found his phase mine"; deathstring = " plays with the plasma";
} else if (targ.deathtype == "nail") { break;
deathstring = " nails himself to the wall";
} else if (targ.deathtype == "rocket") { case "mine":
if (rnum < 0.5) if (rnum < 0.67)
deathstring = " finds his rocket tasty"; deathstring = " forgot where his phase mine was";
else else
deathstring = " plays \"Doctor Strangelove\""; deathstring = " found his phase mine";
} else if (targ.deathtype == "shrapnel") { break;
if (rnum < 0.9)
deathstring = " finds out what a shrapnel bomb does"; case "nail":
else deathstring = " nails himself to the wall";
deathstring = " give us up the bomb"; break;
} else if (targ.deathtype == "supernail") {
deathstring = " decides to use himself for a pin cushion"; case "rocket":
} else if (targ.weapon == IT_PLASMAGUN && targ.waterlevel > 1) { if (rnum < 0.5)
deathstring = " discharges into the "; deathstring = " finds his rocket tasty";
if (targ.watertype == CONTENT_SLIME) else
deathstring2 = "slime\n"; deathstring = " plays \"Doctor Strangelove\"";
else if (targ.watertype == CONTENT_LAVA) break;
deathstring2 = "lava\n";
else case "shrapnel":
deathstring2 = "water\n"; if (rnum < 0.9)
} else { deathstring = " finds out what a shrapnel bomb does";
deathstring = " becomes bored with life"; else
deathstring = " give us up the bomb";
break;
case "supernail":
deathstring = " decides to use himself for a pin cushion";
break;
default:
if (targ.weapon == IT_PLASMAGUN
&& targ.waterlevel > 1) {
deathstring = " discharges into the ";
if (targ.watertype == CONTENT_SLIME)
deathstring2 = "slime\n";
else if (targ.watertype == CONTENT_LAVA)
deathstring2 = "lava\n";
else
deathstring2 = "water\n";
} else {
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,94 +1563,111 @@ 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) {
deathstring = " was nailed by "; case "nail":
} else if (targ.deathtype == "supernail") { deathstring = " was nailed by ";
deathstring = " was punctured by "; break;
} else if (targ.deathtype == "grenade") {
deathstring = " eats "; case "supernail":
deathstring2 = "'s pineapple\n"; deathstring = " was punctured by ";
if (targ.health < -40) { break;
deathstring = " was gibbed by ";
deathstring2 = "'s grenade\n"; case "grenade":
} if (gibbed) {
} else if (targ.deathtype == "rocket") { deathstring = " was gibbed by ";
if (attacker.super_damage_finished > 0 && targ.health < -40) { deathstring2 = "'s grenade\n";
if (rnum < 0.3) { break;
deathstring = " was brutalized by ";
} else if (rnum < 0.6) {
deathstring = " was smeared by ";
} else {
BPRINT (PRINT_MEDIUM, attacker.netname);
BPRINT (PRINT_MEDIUM, " rips ");
BPRINT (PRINT_MEDIUM, targ.netname);
BPRINT (PRINT_MEDIUM, " a new one\n");
return;
} }
deathstring2 = "'s quad rocket\n"; deathstring = " eats ";
} else { deathstring2 = "'s pineapple\n";
if (targ.health < -40) 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) {
deathstring = " was brutalized by ";
} else if (rnum < 0.6) {
deathstring = " was smeared by ";
} else {
BPRINT (PRINT_MEDIUM, attacker.netname
+ " rips " + targ.netname
+ " a new one!\n");
return;
}
} else {
deathstring = " rides ";
}
break;
case "megaplasma":
if (gibbed)
deathstring = " was discombobulated by ";
else
deathstring = " bites ";
deathstring2 = "'s plasma burst\n";
break;
case "impactgrenade":
if (gibbed)
deathstring = " was gibbed by "; deathstring = " was gibbed by ";
else else
deathstring = " rides "; deathstring = " swallows ";
deathstring2 = "'s rocket\n"; deathstring2 = "'s impact grenade\n";
} break;
} else if (targ.deathtype == "megaplasma") {
if (targ.health < -40) case "mine":
deathstring = " was discombobulated by "; if (gibbed)
else deathstring = " is chum thanks to ";
deathstring = " bites "; else
deathstring2 = "'s plasma burst\n"; deathstring = " stepped on ";
} else if (targ.deathtype == "impactgrenade") { deathstring2 = "'s phase mine\n";
if (targ.health < -40) break;
deathstring = " was gibbed by ";
else case "shrapnel":
deathstring = " swallows "; if (gibbed)
deathstring2 = "'s impact grenade\n"; deathstring = " gets a face full of ";
} else if (targ.deathtype == "mine") { else
if (targ.health < -40) deathstring = " got too close to ";
deathstring = " is chum thanks to "; deathstring2 = "'s shrapnel bomb\n";
else break;
deathstring = " stepped on "; default:
deathstring2 = "'s phase mine\n";
} else if (targ.deathtype == "shrapnel") {
if (targ.health < -40)
deathstring = " gets a face full of ";
else
deathstring = " got too close to ";
deathstring2 = "'s shrapnel bomb\n";
#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";
} else if (attacker.weapon == IT_TSHOT) { } else if (attacker.weapon == IT_TSHOT) {
deathstring = " chewed on "; deathstring = " chewed on ";
deathstring2 = "'s boomstick\n"; deathstring2 = "'s boomstick\n";
} else if (attacker.weapon == IT_COMBOGUN) { } else if (attacker.weapon == IT_COMBOGUN) {
deathstring = " ate 2 loads of "; deathstring = " ate 2 loads of ";
deathstring2 = "'s buckshot\n"; deathstring2 = "'s buckshot\n";
} else if (attacker.weapon == IT_PLASMAGUN) { } else if (attacker.weapon == IT_PLASMAGUN) {
deathstring = " got burned by "; deathstring = " got burned by ";
deathstring2 = "'s plasma\n"; deathstring2 = "'s plasma\n";
}
break;
} }
BPRINT (PRINT_MEDIUM, targ.netname); BPRINT (PRINT_MEDIUM, targ.netname + deathstring
BPRINT (PRINT_MEDIUM, deathstring); + attacker.netname + deathstring2);
BPRINT (PRINT_MEDIUM, attacker.netname);
BPRINT (PRINT_MEDIUM, 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);
@ -157,10 +159,10 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
take = ceil (damage - save); take = ceil (damage - save);
/* /*
Add to the damage total for clients, which will be sent as a single Add to the damage total for clients, which will be sent as a single
message at the end of the frame message at the end of the frame
*/ */
// FIXME: remove after combining shotgun blasts? // FIXME: remove after combining shotgun blasts?
if (targ.flags & FL_CLIENT) { if (targ.flags & FL_CLIENT) {
targ.dmg_take += take; targ.dmg_take += take;
@ -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_