diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 0375c1e66..93ed82b41 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -805,39 +805,39 @@ void () LocateSpectatorTarget = if (self.ghost == 1) { ke = find (world, classname, "player"); - de = find (world, classname, "player"); - total = CONTENT_EMPTY; - player = MULTICAST_ALL; - playercnt = MULTICAST_ALL; + de = ke; + total = -1; + player = 0; + playercnt = 0; while (ke) { - if (((ke.classname == "player") && (ke.ghost == MULTICAST_ALL))) + if (ke.classname == "player" && ke.ghost == 0 && ke.health > 0) { - total = (total + 1); + total = total + 1; } ke = find (ke, classname, "player"); } while (de) { - if (((de.classname == "player") && (de.ghost == MULTICAST_ALL))) + if (de.classname == "player" && de.ghost == 0 && ke.health > 0) { - if ((player == self.ghostcnt)) + if (player == self.ghostcnt) { makevectors (de.angles); self.view2 = de; - self.ghostcnt = (self.ghostcnt + 1); + self.ghostcnt = self.ghostcnt + 1; self.cnt = 0; sprint(self, 2, "now following "); sprint(self, 2, de.netname); sprint(self, 2, ".\n"); - if ((self.ghostcnt > total)) + if (self.ghostcnt > total) self.ghostcnt = 0; return; } - player = (player + 1); - if ((self.ghostcnt > total)) + player = player + 1; + if (self.ghostcnt > total) { self.ghostcnt = 0; } @@ -848,6 +848,8 @@ void () LocateSpectatorTarget = { self.view2 = world; centerprint (self, "No players found...\n"); + if (!deathmatch) + localcmd("restart\n"); return; } } @@ -1304,7 +1306,7 @@ void() PlayerPreThink = } } - if (self.regen > 0) + if (self.regen > 0 && !self.deadflag) //don't come back to life. { self.health = self.health + 3; self.regen = self.regen - 1; @@ -1323,7 +1325,7 @@ void() PlayerPreThink = PlayerDeathThink (); return; } - + if (self.deadflag == DEAD_DYING) return; // dying, so do nothing diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 69751e551..10a4a40c5 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -17,6 +17,10 @@ float(string desc) itemtoslot = } else { + slot = SlotOfItem(self, slot); + if (slot) + return slot; + sprint(self, PRINT_HIGH, "You don't have one of those\n"); return 0; } diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index e00aa460a..595c5da6f 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -4,9 +4,7 @@ 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; -*/ //============================================================================ @@ -88,15 +86,17 @@ void(entity targ, entity attacker) Killed = ClientObituary(self, attacker); if (self.classname == "player") //so dead players can spectate + { self.ghost = 1; + self.flags = self.flags | FL_FINDABLE_NONSOLID; //so tracelines can find them + } self.takedamage = DAMAGE_NO; self.touch = SUB_Null; self.effects = 0; -/*SERVER monster_death_use(); -*/ + self.th_die (); self = oself; diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 6122d761f..38a65f1a0 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -451,6 +451,7 @@ float MULTICAST_PHS_R = 4; // within hearing, reliable float MULTICAST_PVS_R = 5; // within sight, reliable +#define FL_FINDABLE_NONSOLID 16384 //a cpqwsv feature //================================================ diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index b17703f37..9d68a7af1 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -2495,6 +2495,7 @@ void (entity healer, entity saved) RevivePlayer = saved.deadflag = DEAD_NO; saved.takedamage = DAMAGE_AIM; saved.movetype = MOVETYPE_WALK; + saved.solid = SOLID_SLIDEBOX; self.materialize = 200; saved.ghost = 0; saved.health = 2; @@ -2505,12 +2506,17 @@ void (entity healer, entity saved) RevivePlayer = player_run(); self = oself; stuffcmd(saved, "impulse 1\n"); - sprint (healer, PRINT_HIGH, "you revive "); - sprint (healer, PRINT_HIGH, trace_ent.netname); - sprint (healer, PRINT_HIGH, ".\n "); + if (healer.classname == "player") + { + sprint (healer, PRINT_HIGH, "you revive "); + sprint (healer, PRINT_HIGH, trace_ent.netname); + sprint (healer, PRINT_HIGH, ".\n "); + } sprint (saved, PRINT_HIGH, healer.netname); sprint (saved, PRINT_HIGH, " saves you from death.\n"); saved.view2 = world; + + saved.flags (-) FL_FINDABLE_NONSOLID; }; float(float iid) UseBoostingChem = @@ -2560,15 +2566,12 @@ float(float iid) UseBoostingChem = trace_ent.ragetime = duration; return true; } - if (trace_fraction == 1.0) + if (self.health < self.max_health && self.rage == 0) { - if (self.health < self.max_health && self.rage == 0) - { - sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); - self.rage = iid; - self.ragetime = duration; - return true; - } + sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + self.rage = iid; + self.ragetime = duration; + return true; } return false; }; @@ -2604,13 +2607,13 @@ float(float iid) UseHealingChem = makevectors (self.v_angle); source = self.origin + '0 0 0'; - traceline (source, source + v_forward*64, FALSE, self); + traceline (source, source + v_forward*64, 32, self); if (trace_ent.classname == "player" && trace_ent.team == self.team) { if (trace_ent.health <= 0 && coop == 1) { RevivePlayer(self, trace_ent); - return false; + return true; } if (trace_ent.health <= 0 && coop == 0) return false; @@ -2638,15 +2641,12 @@ float(float iid) UseHealingChem = sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); return true; } - if (trace_fraction == 1.0) + if (self.health < self.max_health && self.regen == 0) { - if (self.health < self.max_health && self.regen == 0) - { - sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - self.health = self.health + heal; - self.regen = heal; - return true; - } + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + self.health = self.health + heal; + self.regen = heal; + return true; } return false; }; @@ -2984,6 +2984,7 @@ void () station_think = { #define chemcount attack_finished local entity te; + local float r; self.nextthink = time + 2; self.frame = self.buildtype; @@ -3007,7 +3008,7 @@ void () station_think = te = findradius (self.origin, 256); while (te) { - if (te.classname == "player" && te.team == self.team) + if (te.classname == "player" && te.team == self.team && !te.deadflag) { if (self.chemcount <= 0) { @@ -3030,7 +3031,7 @@ void () station_think = te = findradius (self.origin, 70); while (te) { - if (te.classname == "player" && te.team == self.team) + if (te.classname == "player" && te.team == self.team && !te.deadflag) { if (self.chemcount <= 0) { @@ -3038,15 +3039,33 @@ void () station_think = sprint (te, 2, "the autodoc is out of medical supplies.\n"); return; } - if (te.health < te.max_health) + if (te.deadflag) + RevivePlayer(self, te); + else if (te.health < te.max_health) { sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - sprint (te, 2, "the auto-doc heals you for 3 health.\n"); + sprint (te, PRINT_MEDIUM, "the auto-doc heals you for 3 health.\n"); te.health = te.health + 3; self.chemcount = self.chemcount - 1; if (te.health > te.max_health) te.health = te.max_health; } + if (random() < 0.001) + { + r = random()*6; + if (r < 1) + sprint(te, PRINT_HIGH, "the auto-doc heals you of AIDS\n"); + else if (r < 2) + sprint(te, PRINT_HIGH, "the auto-doc heals you of Genital Herpes\n"); + else if (r < 3) + sprint(te, PRINT_HIGH, "the auto-doc heals you of Gonorrhea\n"); + else if (r < 4) + sprint(te, PRINT_HIGH, "the auto-doc heals you of Syphillis\n"); + else if (r < 5) + sprint(te, PRINT_HIGH, "the auto-doc rids you of Crabs\n"); + else if (r < 6) + sprint(te, PRINT_HIGH, "the auto-doc heals you of Chlamydia\n"); + } } te = te.chain; } @@ -3057,7 +3076,7 @@ void () station_think = te = findradius (self.origin, 60); while (te) { - if (te.classname == "player" && te.team == self.team) + if (te.classname == "player" && te.team == self.team && !te.deadflag) { if (self.chemcount <= 0) {