as released 1996-09-30

This commit is contained in:
archive 1996-09-30 00:00:00 +00:00
parent d9cdbbafad
commit 8537f176b2
4 changed files with 110 additions and 42 deletions

View file

@ -294,13 +294,17 @@ void() changelevel_touch =
if (other.classname != "player") if (other.classname != "player")
return; return;
if (cvar("noexit")) if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start")))
{ {
T_Damage (other, self, self, 50000); T_Damage (other, self, self, 50000);
return; return;
} }
if (coop || deathmatch)
{
bprint (other.netname); bprint (other.netname);
bprint (" exited the level\n"); bprint (" exited the level\n");
}
nextmap = self.map; nextmap = self.map;
@ -403,6 +407,8 @@ Returns the entity to spawn at
entity() SelectSpawnPoint = entity() SelectSpawnPoint =
{ {
local entity spot; local entity spot;
local entity thing;
local float pcount;
// testinfo_player_start is only found in regioned levels // testinfo_player_start is only found in regioned levels
spot = find (world, classname, "testplayerstart"); spot = find (world, classname, "testplayerstart");
@ -420,11 +426,29 @@ entity() SelectSpawnPoint =
} }
else if (deathmatch) else if (deathmatch)
{ {
lastspawn = find(lastspawn, classname, "info_player_deathmatch"); spot = lastspawn;
if (lastspawn == world) while (1)
lastspawn = find (lastspawn, classname, "info_player_deathmatch"); {
if (lastspawn != world) spot = find(spot, classname, "info_player_deathmatch");
if (spot != world)
{
if (spot == lastspawn)
return lastspawn; return lastspawn;
pcount = 0;
thing = findradius(spot.origin, 32);
while(thing)
{
if (thing.classname == "player")
pcount = pcount + 1;
thing = thing.chain;
}
if (pcount == 0)
{
lastspawn = spot;
return spot;
}
}
}
} }
if (serverflags) if (serverflags)
@ -456,6 +480,8 @@ void() PutClientInServer =
{ {
local entity spot; local entity spot;
spot = SelectSpawnPoint ();
self.classname = "player"; self.classname = "player";
self.health = 100; self.health = 100;
self.takedamage = DAMAGE_AIM; self.takedamage = DAMAGE_AIM;
@ -485,7 +511,7 @@ void() PutClientInServer =
// paustime is set by teleporters to keep the player from moving a while // paustime is set by teleporters to keep the player from moving a while
self.pausetime = 0; self.pausetime = 0;
spot = SelectSpawnPoint (); // spot = SelectSpawnPoint ();
self.origin = spot.origin + '0 0 1'; self.origin = spot.origin + '0 0 1';
self.angles = spot.angles; self.angles = spot.angles;
@ -585,27 +611,22 @@ void() NextLevel =
else if (!(serverflags & 1)) else if (!(serverflags & 1))
{ {
mapname = "e1m1"; mapname = "e1m1";
serverflags = serverflags + 1; serverflags = serverflags | 1;
} }
else if (!(serverflags & 2)) else if (!(serverflags & 2))
{ {
mapname = "e2m1"; mapname = "e2m1";
serverflags = serverflags + 2; serverflags = serverflags | 2;
} }
else if (!(serverflags & 4)) else if (!(serverflags & 4))
{ {
mapname = "e3m1"; mapname = "e3m1";
serverflags = serverflags + 4; serverflags = serverflags | 4;
} }
else if (!(serverflags & 8)) else if (!(serverflags & 8))
{ {
mapname = "e4m1"; mapname = "e4m1";
serverflags = serverflags + 8; serverflags = serverflags - 7;
}
else
{
mapname = "start";
serverflags = serverflags - 15;
} }
o = spawn(); o = spawn();
@ -916,6 +937,12 @@ void() PlayerPreThink =
// teleporters can force a non-moving pause time // teleporters can force a non-moving pause time
if (time < self.pausetime) if (time < self.pausetime)
self.velocity = '0 0 0'; self.velocity = '0 0 0';
if(time > self.attack_finished && self.currentammo == 0 && self.weapon != IT_AXE)
{
self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
}
}; };
/* /*

8
flag.qc Normal file
View file

@ -0,0 +1,8 @@
/*QUAKED item_deathball (.3 .3 1) (0 0 0) (32 32 32)
*/
void() deathball_touch;
void() item_deathball =
{
self.touch = deathball_touch;
};

View file

@ -1231,12 +1231,24 @@ void() BackpackTouch =
local string s; local string s;
local float best, old, new; local float best, old, new;
local entity stemp; local entity stemp;
local float acount;
if (other.classname != "player") if (other.classname != "player")
return; return;
if (other.health <= 0) if (other.health <= 0)
return; return;
acount = 0;
sprint (other, "You get ");
if (self.items)
if ((other.items & self.items) == 0)
{
acount = 1;
sprint (other, "the ");
sprint (other, self.netname);
}
// if the player was using his best weapon, change up to the new one if better // if the player was using his best weapon, change up to the new one if better
stemp = self; stemp = self;
self = other; self = other;
@ -1249,34 +1261,46 @@ void() BackpackTouch =
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells; other.ammo_cells = other.ammo_cells + self.ammo_cells;
old = other.items;
new = self.items; new = self.items;
if (!new)
new = other.weapon;
old = other.items;
other.items = other.items | new; other.items = other.items | new;
bound_other_ammo (); bound_other_ammo ();
sprint (other, "You get ");
if (self.ammo_shells) if (self.ammo_shells)
{ {
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_shells); s = ftos(self.ammo_shells);
sprint (other, s); sprint (other, s);
sprint (other, " shells"); sprint (other, " shells");
} }
if (self.ammo_nails) if (self.ammo_nails)
{ {
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_nails); s = ftos(self.ammo_nails);
sprint (other, s); sprint (other, s);
sprint (other, " nails"); sprint (other, " nails");
} }
if (self.ammo_rockets) if (self.ammo_rockets)
{ {
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_rockets); s = ftos(self.ammo_rockets);
sprint (other, s); sprint (other, s);
sprint (other, " rockets"); sprint (other, " rockets");
} }
if (self.ammo_cells) if (self.ammo_cells)
{ {
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_cells); s = ftos(self.ammo_cells);
sprint (other, s); sprint (other, s);
sprint (other, " cells"); sprint (other, " cells");
@ -1316,6 +1340,24 @@ void() DropBackpack =
item.origin = self.origin - '0 0 24'; item.origin = self.origin - '0 0 24';
item.items = self.weapon; item.items = self.weapon;
if (item.items == IT_AXE)
item.netname = "Axe";
else if (item.items == IT_SHOTGUN)
item.netname = "Shotgun";
else if (item.items == IT_SUPER_SHOTGUN)
item.netname = "Double-barrelled Shotgun";
else if (item.items == IT_NAILGUN)
item.netname = "Nailgun";
else if (item.items == IT_SUPER_NAILGUN)
item.netname = "Super Nailgun";
else if (item.items == IT_GRENADE_LAUNCHER)
item.netname = "Grenade Launcher";
else if (item.items == IT_ROCKET_LAUNCHER)
item.netname = "Rocket Launcher";
else if (item.items == IT_LIGHTNING)
item.netname = "Thunderbolt";
else
item.netname = "";
item.ammo_shells = self.ammo_shells; item.ammo_shells = self.ammo_shells;
item.ammo_nails = self.ammo_nails; item.ammo_nails = self.ammo_nails;

View file

@ -479,8 +479,8 @@ void() W_FireLightning =
{ {
cells = self.ammo_cells; cells = self.ammo_cells;
self.ammo_cells = 0; self.ammo_cells = 0;
T_RadiusDamage (self, self, 35*cells, world);
W_SetCurrentAmmo (); W_SetCurrentAmmo ();
T_RadiusDamage (self, self, 35*cells, world);
return; return;
} }
@ -830,25 +830,16 @@ float() W_BestWeapon =
it = self.items; it = self.items;
if(self.ammo_cells >= 1 && (it & IT_LIGHTNING) ) if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
return IT_LIGHTNING; return IT_LIGHTNING;
else if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) ) if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) )
return IT_SUPER_NAILGUN; return IT_SUPER_NAILGUN;
else if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) ) if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) )
return IT_SUPER_SHOTGUN; return IT_SUPER_SHOTGUN;
else if(self.ammo_nails >= 1 && (it & IT_NAILGUN) ) if(self.ammo_nails >= 1 && (it & IT_NAILGUN) )
return IT_NAILGUN; return IT_NAILGUN;
else if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) ) if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) )
return IT_SHOTGUN; return IT_SHOTGUN;
/*
if(self.ammo_rockets >= 1 && (it & IT_ROCKET_LAUNCHER) )
return IT_ROCKET_LAUNCHER;
else if(self.ammo_rockets >= 1 && (it & IT_GRENADE_LAUNCHER) )
return IT_GRENADE_LAUNCHER;
*/
return IT_AXE; return IT_AXE;
}; };