Compare commits

...

1 Commits

Author SHA1 Message Date
archive 8537f176b2 as released 1996-09-30 1996-09-30 00:00:00 +00:00
4 changed files with 110 additions and 42 deletions

View File

@ -294,13 +294,17 @@ void() changelevel_touch =
if (other.classname != "player")
return;
if (cvar("noexit"))
if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start")))
{
T_Damage (other, self, self, 50000);
return;
}
bprint (other.netname);
bprint (" exited the level\n");
if (coop || deathmatch)
{
bprint (other.netname);
bprint (" exited the level\n");
}
nextmap = self.map;
@ -403,6 +407,8 @@ Returns the entity to spawn at
entity() SelectSpawnPoint =
{
local entity spot;
local entity thing;
local float pcount;
// testinfo_player_start is only found in regioned levels
spot = find (world, classname, "testplayerstart");
@ -420,11 +426,29 @@ entity() SelectSpawnPoint =
}
else if (deathmatch)
{
lastspawn = find(lastspawn, classname, "info_player_deathmatch");
if (lastspawn == world)
lastspawn = find (lastspawn, classname, "info_player_deathmatch");
if (lastspawn != world)
return lastspawn;
spot = lastspawn;
while (1)
{
spot = find(spot, classname, "info_player_deathmatch");
if (spot != world)
{
if (spot == 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)
@ -456,6 +480,8 @@ void() PutClientInServer =
{
local entity spot;
spot = SelectSpawnPoint ();
self.classname = "player";
self.health = 100;
self.takedamage = DAMAGE_AIM;
@ -485,7 +511,7 @@ void() PutClientInServer =
// paustime is set by teleporters to keep the player from moving a while
self.pausetime = 0;
spot = SelectSpawnPoint ();
// spot = SelectSpawnPoint ();
self.origin = spot.origin + '0 0 1';
self.angles = spot.angles;
@ -585,27 +611,22 @@ void() NextLevel =
else if (!(serverflags & 1))
{
mapname = "e1m1";
serverflags = serverflags + 1;
serverflags = serverflags | 1;
}
else if (!(serverflags & 2))
{
mapname = "e2m1";
serverflags = serverflags + 2;
serverflags = serverflags | 2;
}
else if (!(serverflags & 4))
{
mapname = "e3m1";
serverflags = serverflags + 4;
serverflags = serverflags | 4;
}
else if (!(serverflags & 8))
{
mapname = "e4m1";
serverflags = serverflags + 8;
}
else
{
mapname = "start";
serverflags = serverflags - 15;
serverflags = serverflags - 7;
}
o = spawn();
@ -916,6 +937,12 @@ void() PlayerPreThink =
// teleporters can force a non-moving pause time
if (time < self.pausetime)
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 float best, old, new;
local entity stemp;
local float acount;
if (other.classname != "player")
return;
if (other.health <= 0)
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
stemp = self;
self = other;
@ -1249,37 +1261,49 @@ void() BackpackTouch =
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells;
old = other.items;
new = self.items;
if (!new)
new = other.weapon;
old = other.items;
other.items = other.items | new;
bound_other_ammo ();
sprint (other, "You get ");
if (self.ammo_shells)
{
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_shells);
sprint (other, s);
sprint (other, " shells ");
sprint (other, " shells");
}
if (self.ammo_nails)
{
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_nails);
sprint (other, s);
sprint (other, " nails ");
sprint (other, " nails");
}
if (self.ammo_rockets)
{
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_rockets);
sprint (other, s);
sprint (other, " rockets ");
sprint (other, " rockets");
}
if (self.ammo_cells)
{
if (acount)
sprint(other, ", ");
acount = 1;
s = ftos(self.ammo_cells);
sprint (other, s);
sprint (other, " cells ");
sprint (other, " cells");
}
sprint (other, "\n");
@ -1316,6 +1340,24 @@ void() DropBackpack =
item.origin = self.origin - '0 0 24';
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_nails = self.ammo_nails;

View File

@ -479,8 +479,8 @@ void() W_FireLightning =
{
cells = self.ammo_cells;
self.ammo_cells = 0;
T_RadiusDamage (self, self, 35*cells, world);
W_SetCurrentAmmo ();
T_RadiusDamage (self, self, 35*cells, world);
return;
}
@ -830,25 +830,16 @@ float() W_BestWeapon =
it = self.items;
if(self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
return IT_LIGHTNING;
else if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) )
if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
return IT_LIGHTNING;
if(self.ammo_nails >= 2 && (it & 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;
else if(self.ammo_nails >= 1 && (it & IT_NAILGUN) )
if(self.ammo_nails >= 1 && (it & 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;
/*
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;
};