git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3429 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Magnus 2009-11-09 04:48:58 +00:00
parent 3554c9c9e8
commit 92fc87b9ff
13 changed files with 470 additions and 460 deletions

View file

@ -342,51 +342,19 @@ void() execute_changelevel =
local entity pos;
local float x;
intermission_running = 1;
// enforce a wait time before allowing changelevel
intermission_exittime = time + 15;
pos = FindIntermission ();
WriteByte (MSG_ALL, SVC_INTERMISSION);
WriteCoord (MSG_ALL, pos.origin_x);
WriteCoord (MSG_ALL, pos.origin_y);
WriteCoord (MSG_ALL, pos.origin_z);
WriteAngle (MSG_ALL, pos.mangle_x);
WriteAngle (MSG_ALL, pos.mangle_y);
WriteAngle (MSG_ALL, pos.mangle_z);
localcmd("map r_bunker\n");
x = ceil(random()*6);
if (x == 1)
savemap = "hostage";
if (x == 2)
savemap = "supplies";
if (x == 3)
savemap = "shadow";
if (x == 4)
savemap = "deadtown";
if (x == 5)
savemap = "destroy";
if (x == 6)
savemap = "defuse";
if (intermission_exittime < time)
localcmd("map r_bunker");
if (infokey(world, "objective") != "return" && infokey(world, "objective") != "start")
localcmd("serverinfo objective return\n");
self.nextthink = time + 1;
};
void() changelevel_touch =
{
if (coop == 0)
return;
if (other.classname != "player")
return;
@ -446,7 +414,7 @@ void() changelevel_touch =
// we can't move people right now, because touch functions are called
// in the middle of C movement code, so set a think time to do it
self.think = execute_changelevel;
self.nextthink = time + 0.1;
self.nextthink = time + 10;
};
/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
@ -519,6 +487,12 @@ entity() SelectSpawnPoint =
numspots = 0;
totalspots = 0;
if (infokey(world, "coop") == "0")
coop = 0;
if (infokey(world, "coop") == "1")
coop = 1;
// testinfo_player_start is only found in regioned levels
spot = find (world, classname, "testplayerstart");
@ -527,8 +501,8 @@ entity() SelectSpawnPoint =
spot = find (world, classname, "spawn3");
if (spot)
ent1 = "spawn3";
if (coop == 0)
ent1 = "info_player_deathmatch";
else
ent1 = "info_player_coop";
@ -709,6 +683,8 @@ void() PutClientInServer =
self.equipment_slot = 0;
spawn_dot(self);
self.health = self.max_health;
// oh, this is a hack!
@ -738,42 +714,6 @@ void() PutClientInServer =
self.view_ofs = '0 0 22';
self.view2 = world;
if (world.model == "maps/r_bunker.bsp")
{
if (infokey(world, "objective") != "return")
{
if (self.ammo_shells == 300)
self.popup = 1;
else
self.popup = 2;
}
}
if (world.model == "maps/r_bunker.bsp")
{
if (infokey(world, "objective") == "return")
{
if (self.score <= 0)
{
self.popup = 6;
}
if (self.score <= 400)
{
self.ammo_shells = self.ammo_shells + 25;
self.popup = 3;
}
else if (self.score <= 800)
{
self.ammo_shells = self.ammo_shells + 50;
self.popup = 4;
}
else
{
self.ammo_shells = self.ammo_shells + 75;
self.popup = 5;
}
}
}
// Mod - Xian (May.20.97)
// Bug where player would have velocity from their last kill
@ -840,6 +780,8 @@ void() PutClientInServer =
}
W_SetCurrentAmmo();
stuffcmd(self, "sizeup\n");
stuffcmd(self, "sizeup\n");
};
@ -873,7 +815,6 @@ void() info_player_start2 =
while (x > 0)
{
bprint(2, "hi\n");
start = spawn();
setsize(start, '-16 -16 -24', '16 16 32');
setorigin(start, self.origin + '0 0 4');
@ -905,7 +846,6 @@ potential spawning position for coop games
*/
void() info_player_coop =
{
coop = 1;
};
@ -1373,7 +1313,7 @@ void() SneakLevel =
//bulletproof shirt gives a 2% bonus to stealth
st = ToIID(self.islot3);
if (st == IID_ARM_SHIRT)
if (st == IID_ARM_LEATHER)
sn = sn + 2;
//metal armor gives a large penalty to stealth
@ -1386,10 +1326,6 @@ void() SneakLevel =
if (st == IID_ARM_LPOWER)
sn = sn - 10;
//body snatcher allows for an automatic disguise
st = ToIID(self.islot3);
if (st == IID_ARM_DESERT)
sn = 99;
//stealthboy allows for an automatic 10-second invisibility
st = ToIID(self.islot4);
@ -1431,17 +1367,17 @@ void() ArmorCheck =
//Armor
if (aid == IID_ARM_DESERT)
type = 0.10;
if (aid == IID_ARM_SHIRT)
type = 0.25;
if (aid == IID_ARM_LEATHER)
type = 0.25;
if (aid == IID_ARM_VANDAL)
type = 0.30;
if (aid == IID_ARM_KEVLAR)
type = 0.50;
if (aid == IID_ARM_METAL)
type = 0.50;
if (aid == IID_ARM_TESLA)
type = 0.25;
if (aid == IID_ARM_COMBAT)
type = 0.40;
if (aid == IID_ARM_BROTHERHOOD)
if (aid == IID_ARM_SEVA)
type = 0.45;
if (aid == IID_ARM_FORCE)
type = 0.15;
@ -1451,24 +1387,24 @@ void() ArmorCheck =
type += 0.20;
if (aid <= IID_ARM_KEVLAR)
if (aid <= IID_ARM_METAL)
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
else if (aid <= IID_ARM_BROTHERHOOD)
else if (aid <= IID_ARM_SEVA)
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
else
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
if (aid == IID_ARM_SHIRT)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_LEATHER)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_KEVLAR)
if (aid == IID_ARM_VANDAL)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_METAL)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_TESLA)
self.armornoise = "weapons/ric1.wav";
if (aid == IID_ARM_COMBAT)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_BROTHERHOOD)
if (aid == IID_ARM_SEVA)
self.armornoise = "misc/thud.wav";
if (aid == IID_ARM_FORCE)
self.armornoise = "misc/laserdef.wav";
@ -1541,10 +1477,6 @@ void () PositionControl =
else
self.maxspeed = 50;
if (self.health <= (self.max_health*0.20) && random()<0.05)
sound (self, CHAN_AUTO, "player/paina.wav", 1, ATTN_NORM);
else if (self.health <= (self.max_health*0.20) && random()<0.05)
sound (self, CHAN_AUTO, "player/painb.wav", 1, ATTN_NORM);
if (getperk(2))
self.maxspeed = self.maxspeed*1.10;
@ -1964,7 +1896,7 @@ void() CheckPowerups =
self.modelindex = modelindex_player;
if (self.position == 2)
self.modelindex = modelindex_prone;
if (self.sneak == 1 || self.sneak == 3 && coop == 0)
if (self.sneak > 0 && coop == 0)
self.modelindex = modelindex_gone;
if (self.sneak > 0 && coop == 1)
self.modelindex = modelindex_sneak;
@ -2778,7 +2710,7 @@ void() Identify =
tmp = ToIID(trace_ent.islot3);
if (tmp == 0)
c2 = "natural armor";
else if (tmp == IID_ARM_SHIRT)
else if (tmp == IID_ARM_LEATHER)
c2 = "lightly armored";
else
c2 = GetItemName(ToIID(trace_ent.islot3));

View file

@ -355,13 +355,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
}
}
if (damage <= 0)
if (damage <= 0 && (attacker.classname == "monster" || attacker.classname == "player"))
{
damage = 0;
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
return;
}
if (attacker.classname == "monster" || attacker.classname == "player")
sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM);
@ -449,25 +450,25 @@ take = damage;
switch(ToIID(targ.islot3))
{
case IID_ARM_DESERT:
take -= 1;
break;
case IID_ARM_SHIRT:
take -= 1;
take -= 2;
break;
case IID_ARM_LEATHER:
take -= 5;
break;
case IID_ARM_KEVLAR:
take -= 3;
break;
case IID_ARM_VANDAL:
take -= 4;
break;
case IID_ARM_METAL:
take -= 5;
break;
case IID_ARM_TESLA:
take -= 9;
break;
case IID_ARM_COMBAT:
take -= 7;
take -= 6;
break;
case IID_ARM_BROTHERHOOD:
take -= 10;
case IID_ARM_SEVA:
take -= 8;
break;
case IID_ARM_FORCE:
take -= 13;
@ -481,22 +482,22 @@ take = damage;
switch(ToIID(targ.islot3))
{
case IID_ARM_SHIRT:
case IID_ARM_LEATHER:
take = take * 0.80;
break;
case IID_ARM_LEATHER:
case IID_ARM_VANDAL:
take = take * 0.70;
break;
case IID_ARM_KEVLAR:
case IID_ARM_METAL:
take = take * 0.50;
break;
case IID_ARM_METAL:
case IID_ARM_TESLA:
take = take * 0.65;
break;
case IID_ARM_COMBAT:
take = take * 0.60;
break;
case IID_ARM_BROTHERHOOD:
case IID_ARM_SEVA:
take = take * 0.55;
break;
case IID_ARM_FORCE:
@ -782,22 +783,22 @@ take = damage;
case IID_ARM_DESERT:
take -= 1;
break;
case IID_ARM_SHIRT:
case IID_ARM_LEATHER:
take -= 1;
break;
case IID_ARM_LEATHER:
take -= 10;
break;
case IID_ARM_KEVLAR:
take -= 5;
case IID_ARM_VANDAL:
take -= 15;
break;
case IID_ARM_METAL:
take -= 10;
break;
case IID_ARM_TESLA:
take -= 25;
break;
case IID_ARM_COMBAT:
take -= 20;
break;
case IID_ARM_BROTHERHOOD:
case IID_ARM_SEVA:
take -= 20;
break;
case IID_ARM_FORCE:
@ -812,22 +813,22 @@ take = damage;
switch(ToIID(targ.islot3))
{
case IID_ARM_SHIRT:
case IID_ARM_LEATHER:
take = take * 0.70;
break;
case IID_ARM_LEATHER:
case IID_ARM_VANDAL:
take = take * 0.60;
break;
case IID_ARM_KEVLAR:
case IID_ARM_METAL:
take = take * 0.40;
break;
case IID_ARM_METAL:
case IID_ARM_TESLA:
take = take * 0.55;
break;
case IID_ARM_COMBAT:
take = take * 0.50;
break;
case IID_ARM_BROTHERHOOD:
case IID_ARM_SEVA:
take = take * 0.45;
break;
case IID_ARM_FORCE:
@ -1062,7 +1063,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
case IID_ARM_METAL:
take -= 1;
break;
case IID_ARM_BROTHERHOOD:
case IID_ARM_SEVA:
take -= 1;
break;
case IID_ARM_FORCE:
@ -1080,7 +1081,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
case IID_ARM_LEATHER:
take = take * 0.90;
break;
case IID_ARM_KEVLAR:
case IID_ARM_VANDAL:
take = take * 0.75;
break;
case IID_ARM_METAL:
@ -1089,7 +1090,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
case IID_ARM_COMBAT:
take = take * 0.90;
break;
case IID_ARM_BROTHERHOOD:
case IID_ARM_SEVA:
take = take * 0.80;
break;
case IID_ARM_LPOWER:

View file

@ -440,10 +440,9 @@ void() Trader_Draw =
if (showcontextmenu && show_trader)
{
drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9);
drawfill(contextpos - '8 8 0', '48 48 0', '0 0 0', 1.0);
op = floor((mousepos_y - contextpos_y)/8);
drawstring(contextpos + (0 * '0 8 0'), "buy", '8 8 0', '1 1 0' + (op!=0)*'0 0 1',
drawstring(contextpos + '0 8 0', "buy?", '8 8 0', '1 1 0' + (op!=0)*'0 0 1',
1);
}
@ -522,7 +521,7 @@ void() Pipboy_Draw =
void() Invent_Draw =
{
local float i;
local float i, check;
local float it;
local string itname, s1, s2, s3, s4, s5, s6, s7, s8, s9, perki, perk2i, p1, p2, pn, pd;
local float op;
@ -552,9 +551,24 @@ void() Invent_Draw =
SlotImage('3 5 0'*IMGSIZEF, 15);
SlotImage('3 6 0'*IMGSIZEF, 16);
SlotImage('5.5 1 0'*IMGSIZEF, 1);
SlotImage('5.5 2 0'*IMGSIZEF, 2);
SlotImage('5.5 3 0'*IMGSIZEF, 3);
check = getstati(32);
if (check > 0)
SlotImage('5.5 1 0'*IMGSIZEF, 1);
else
drawpic('5.5 1 0'*IMGSIZEF, "gui/pipboy/weapon1.png", IMGSIZEV, '1 1 1', 1);
check = getstati(33);
if (check > 0)
SlotImage('5.5 2 0'*IMGSIZEF, 2);
else
drawpic('5.5 2 0'*IMGSIZEF, "gui/pipboy/weapon2.png", IMGSIZEV, '1 1 1', 1);
check = getstati(34);
if (check > 0)
SlotImage('5.5 3 0'*IMGSIZEF, 3);
else
drawpic('5.5 3 0'*IMGSIZEF, "gui/pipboy/armor.png", IMGSIZEV, '1 1 1', 1);
SlotImageSmall('1 3 0'*IMGSIZEK, 17);
SlotImageSmall('1 4 0'*IMGSIZEK, 18);

View file

@ -40,7 +40,6 @@ float total_monsters;
float found_secrets; // number of secrets found
float killed_monsters; // number of monsters killed
// spawnparms are used to encode information about clients across server
// level changes
float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;

View file

@ -409,27 +409,6 @@ void() enf_die =
DropMoney();
if (self.weapon == 3)
{
DropFromChest(self, IID_WP_MP7_S, self.mag1);
DropFromChest(self, IID_AM_5MMHIGHVEL, 30+random()*30);
}
else if (self.weapon == 4)
{
DropFromChest(self, IID_WP_AK112, self.mag1);
DropFromChest(self, IID_AM_5MMHIGHVEL, 24+random()*24);
}
else if (self.weapon == 5)
{
DropFromChest(self, IID_WP_AK74, self.mag1);
DropFromChest(self, IID_AM_WARSAW, 30+random()*30);
}
else if (self.weapon == 6)
{
DropFromChest(self, IID_WP_MOONLIGHT, self.mag1);
DropFromChest(self, IID_AM_556MM, 30+random()*30);
}
self.solid = SOLID_NOT;
spawn_live_enforcer(self.origin, self.angles);
remove(self);

View file

@ -11,7 +11,7 @@ float IID_NONE = 0;
//the ammoless weapons
float IID_WP_WRENCH = 399;
float IID_WP_KNIFE = 400;
float IID_WP_AXE = 401;
float IID_WP_SLEDGE = 401;
float IID_WP_SPEAR = 402;
float IID_WP_POWERAXE = 403;
@ -24,8 +24,8 @@ float IID_WP_ALIENBLASTER = 408;
float IID_WP_WINCHESTER = 409;
float IID_WP_MOSSBERG = 410;
float IID_WP_JACKHAMMER = 411;
float IID_WP_MP9 = 412;
float IID_WP_MP7 = 413;
float IID_WP_GREASEGUN = 412;
float IID_WP_MP9 = 413;
float IID_WP_RANGEMASTER = 414;
float IID_WP_AK112 = 415;
float IID_WP_AK74 = 416;
@ -34,8 +34,8 @@ float IID_WP_MOONLIGHT = 418;
float IID_WP_G11 = 419;
float IID_WP_GLOCK_S = 420;
float IID_WP_USP_S = 421;
float IID_WP_MP9_S = 422;
float IID_WP_MP7_S = 423;
float IID_WP_GREASEGUN_S = 422;
float IID_WP_MP9_S = 423;
float IID_WP_PIPERIFLE = 424;
float IID_WP_PIPERIFLE_R = 425;
float IID_WP_PIPERIFLE_S = 426;
@ -85,12 +85,12 @@ float IID_GREN_FLARE = 106;
//armour
#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER)
float IID_ARM_DESERT = 200;
float IID_ARM_SHIRT = 201;
float IID_ARM_LEATHER = 202;
float IID_ARM_KEVLAR = 203;
float IID_ARM_METAL = 204;
float IID_ARM_LEATHER = 201;
float IID_ARM_VANDAL = 202;
float IID_ARM_METAL = 203;
float IID_ARM_TESLA = 204;
float IID_ARM_COMBAT = 205;
float IID_ARM_BROTHERHOOD = 206;
float IID_ARM_SEVA = 206;
float IID_ARM_FORCE = 207;
float IID_ARM_LPOWER = 208;
@ -651,7 +651,7 @@ string(float iid) GetItemVModel =
return "progs/v_span.mdl";
if (iid == IID_WP_KNIFE)
return "progs/v_knife.mdl";
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return "progs/v_axe.mdl";
if (iid == IID_WP_SPEAR)
return "progs/v_spear.mdl";
@ -680,13 +680,13 @@ string(float iid) GetItemVModel =
if (iid == IID_WP_JACKHAMMER)
return "progs/v_jackhammer.mdl";
if (iid == IID_WP_GREASEGUN)
return "progs/v_mp9.mdl";
if (iid == IID_WP_MP9)
return "progs/v_mp9.mdl";
if (iid == IID_WP_MP7)
return "progs/v_smg.mdl";
if (iid == IID_WP_MP9_S)
if (iid == IID_WP_GREASEGUN_S)
return "progs/v_mp9.mdl";
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return "progs/v_smg.mdl";
if (iid == IID_WP_RANGEMASTER)
return "progs/v_rangem.mdl";
@ -745,7 +745,7 @@ string(float iid) GetItemWModel =
return "progs/w_knife.mdl";
if (iid == IID_WP_WRENCH)
return "progs/w_span.mdl";
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return "progs/w_knife.mdl";
if (iid == IID_WP_SPEAR)
return "progs/w_spear.mdl";
@ -777,13 +777,13 @@ string(float iid) GetItemWModel =
if (iid == IID_WP_JACKHAMMER)
return "progs/w_jackhammer.mdl";
if (iid == IID_WP_GREASEGUN)
return "progs/w_mp9.mdl";
if (iid == IID_WP_MP9)
return "progs/w_mp9.mdl";
if (iid == IID_WP_MP7)
return "progs/w_mp5.mdl";
if (iid == IID_WP_MP9_S)
if (iid == IID_WP_GREASEGUN_S)
return "progs/w_mp9.mdl";
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return "progs/w_mp7.mdl";
if (iid == IID_WP_RANGEMASTER)
return "progs/w_rangem.mdl";
@ -899,13 +899,13 @@ float(float iid) WeaponAmmoType =
return IID_AM_12GAUGESHELLS;
if (iid == IID_WP_JACKHAMMER)
return IID_AM_12GAUGESHELLS;
if (iid == IID_WP_GREASEGUN)
return IID_AM_45ACP;
if (iid == IID_WP_MP9)
return IID_AM_45ACP;
if (iid == IID_WP_MP7)
return IID_AM_10MM;
if (iid == IID_WP_MP9_S)
if (iid == IID_WP_GREASEGUN_S)
return IID_AM_45ACP;
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return IID_AM_10MM;
if (iid == IID_WP_RANGEMASTER)
return IID_AM_556MM;
@ -976,13 +976,13 @@ float(float iid) WeaponMagQuant =
return 12;
if (iid == IID_WP_JACKHAMMER)
return 20;
if (iid == IID_WP_GREASEGUN)
return 25;
if (iid == IID_WP_MP9)
return 25;
if (iid == IID_WP_MP7)
return 30;
if (iid == IID_WP_MP9_S)
if (iid == IID_WP_GREASEGUN_S)
return 25;
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return 30;
if (iid == IID_WP_RANGEMASTER)
return 10;
@ -1030,7 +1030,7 @@ float(float iid) GetItemWeight =
return 0;
if (iid == IID_WP_KNIFE)
return 1;
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return 8;
if (iid == IID_WP_SPEAR)
return 8;
@ -1060,14 +1060,14 @@ float(float iid) GetItemWeight =
return 5;
if (iid == IID_WP_JACKHAMMER)
return 6;
if (iid == IID_WP_GREASEGUN)
return 3;
if (iid == IID_WP_GREASEGUN_S)
return 3;
if (iid == IID_WP_MP9)
return 3;
if (iid == IID_WP_MP9_S)
return 3;
if (iid == IID_WP_MP7)
return 3;
if (iid == IID_WP_MP7_S)
return 3;
if (iid == IID_WP_RANGEMASTER)
return 5;
if (iid == IID_WP_RANGEMASTER_SCOPE)
@ -1106,20 +1106,20 @@ float(float iid) GetItemWeight =
return 25;
if (iid == IID_ARM_SHIRT)
return 3;
if (iid == IID_ARM_LEATHER)
return 5;
if (iid == IID_ARM_KEVLAR)
return 9;
if (iid == IID_ARM_VANDAL)
return 10;
if (iid == IID_ARM_METAL)
return 15;
if (iid == IID_ARM_COMBAT)
return 20;
if (iid == IID_ARM_TESLA)
return 12;
if (iid == IID_ARM_BROTHERHOOD)
return 17;
if (iid == IID_ARM_COMBAT)
return 14;
if (iid == IID_ARM_SEVA)
return 16;
if (iid == IID_ARM_FORCE)
return 6;
return 9;
if (iid == IID_ARM_LPOWER)
return 20;
@ -1164,7 +1164,7 @@ string(float iid) GetItemName =
return "WRENCH";
if (iid == IID_WP_KNIFE)
return "knife";
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return "axe";
if (iid == IID_WP_SPEAR)
return "spear";
@ -1209,14 +1209,10 @@ string(float iid) GetItemName =
return "mossberg (12g)";
if (iid == IID_WP_JACKHAMMER)
return "jackhammer (12g)";
if (iid == IID_WP_MP9)
return "h&k ump (.45 acp)";
if (iid == IID_WP_MP9_S)
return "h&k ump (silenced)";
if (iid == IID_WP_MP7)
return "h&k mp10 (10mm)";
if (iid == IID_WP_MP7_S)
return "h&k mp10 (silenced)";
if (iid == IID_WP_GREASEGUN)
return "grease gun (.45 acp)";
if (iid == IID_WP_GREASEGUN)
return "mp9 (10mm)";
if (iid == IID_WP_RANGEMASTER)
return "rangemaster (5.56mm)";
if (iid == IID_WP_RANGEMASTER_SCOPE)
@ -1298,18 +1294,18 @@ string(float iid) GetItemName =
if (iid == IID_ARM_DESERT)
return "desert armor";
if (iid == IID_ARM_SHIRT)
return "kevlar shirt";
if (iid == IID_ARM_LEATHER)
return "leather armor";
if (iid == IID_ARM_KEVLAR)
return "double kevlar";
if (iid == IID_ARM_VANDAL)
return "vandal armor";
if (iid == IID_ARM_METAL)
return "ceramic armor";
return "metal armor";
if (iid == IID_ARM_TESLA)
return "tesla armor";
if (iid == IID_ARM_COMBAT)
return "combat armor";
if (iid == IID_ARM_BROTHERHOOD)
return "brotherhood armor";
if (iid == IID_ARM_SEVA)
return "seva suit";
if (iid == IID_ARM_FORCE)
return "force armor";
if (iid == IID_ARM_LPOWER)
@ -1416,7 +1412,7 @@ float(float iid) GetBaseValue =
return 5;
if (iid == IID_WP_KNIFE)
return 5;
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return 15;
if (iid == IID_WP_SPEAR)
return 25;
@ -1460,13 +1456,13 @@ float(float iid) GetBaseValue =
return 150;
if (iid == IID_WP_JACKHAMMER)
return 250;
if (iid == IID_WP_MP9)
if (iid == IID_WP_GREASEGUN)
return 100;
if (iid == IID_WP_MP9_S)
if (iid == IID_WP_GREASEGUN_S)
return 125;
if (iid == IID_WP_MP7)
if (iid == IID_WP_MP9)
return 110;
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return 125;
if (iid == IID_WP_RANGEMASTER)
return 80;
@ -1536,30 +1532,30 @@ float(float iid) GetBaseValue =
if (iid == IID_GREN_STUN)
return 1;
return 5;
if (iid == IID_GREN_FRAG)
return 1;
return 10;
if (iid == IID_GREN_EMP)
return 1;
return 15;
if (iid == IID_GREN_SMOKE)
return 1;
return 5;
if (iid == IID_GREN_FLASH)
return 1;
return 5;
if (iid == IID_ARM_DESERT)
return 45;
if (iid == IID_ARM_SHIRT)
return 50;
if (iid == IID_ARM_LEATHER)
return 50;
if (iid == IID_ARM_VANDAL)
return 90;
if (iid == IID_ARM_KEVLAR)
return 125;
if (iid == IID_ARM_METAL)
return 100;
if (iid == IID_ARM_TESLA)
return 175;
if (iid == IID_ARM_COMBAT)
return 300;
if (iid == IID_ARM_BROTHERHOOD)
if (iid == IID_ARM_SEVA)
return 350;
if (iid == IID_ARM_FORCE)
return 500;
@ -1610,31 +1606,31 @@ float(float iid) GetBaseValue =
return 10;
if (iid == IID_MISC_JUNK)
return 0;
return 1;
if (iid == IID_MISC_NUKACOLA)
return 0;
return 1;
if (iid == IID_MISC_CHEMICALS)
return 0;
return 2;
if (iid == IID_MISC_AEROSOL)
return 0;
return 2;
if (iid == IID_MISC_RDXCRYSTAL)
return 0;
return 3;
if (iid == IID_MISC_STEELPIPE)
return 0;
return 1;
if (iid == IID_MISC_DUCKTAPE)
return 0;
return 1;
if (iid == IID_MISC_LCD)
return 0;
return 2;
if (iid == IID_MISC_CIRCUITBOARD)
return 0;
return 2;
if (iid == IID_MISC_COPPERWIRE)
return 0;
return 1;
if (iid == IID_MISC_HMXCOMPOUND)
return 0;
return 1;
if (iid == IID_MISC_GUM)
return 0;
return 2;
if (iid == IID_MISC_XRAYTUBE)
return 0;
return 5;
bprint(PRINT_MEDIUM, ftos(iid), " without a sell price!\n");
@ -1651,7 +1647,7 @@ string(float iid) GetItemDesc =
return "a heavy multi-function wrench";
if (iid == IID_WP_KNIFE)
return "great for stealth attacks";
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return "a futuristic battle axe";
if (iid == IID_WP_SPEAR)
return "a long, sharp polearm";
@ -1696,13 +1692,13 @@ string(float iid) GetItemDesc =
return "semi-auto combat shotgun, magazine fed";
if (iid == IID_WP_JACKHAMMER)
return "the ultimate for close range battles";
if (iid == IID_WP_GREASEGUN)
return "higher recoil due to larger .45 acp round";
if (iid == IID_WP_GREASEGUN_S)
return "higher recoil due to larger .45 acp round";
if (iid == IID_WP_MP9)
return "higher recoil due to larger .45 acp round";
if (iid == IID_WP_MP9_S)
return "higher recoil due to larger .45 acp round";
if (iid == IID_WP_MP7)
return "great all-around weapon; good burst fire";
if (iid == IID_WP_MP7_S)
if (iid == IID_WP_MP9_S)
return "silenced 10mm smg; less recoil";
if (iid == IID_WP_RANGEMASTER)
return "civilian battle rifle. sturdy and effective";
@ -1782,22 +1778,22 @@ string(float iid) GetItemDesc =
if (iid == IID_ARM_DESERT)
return "the light armor of a raider; makes a great disguise";
if (iid == IID_ARM_SHIRT)
return "featherweight body armor with good stealth and mobility";
if (iid == IID_ARM_LEATHER)
return "made of thick, tanned brahmin hide";
if (iid == IID_ARM_KEVLAR)
return "a suit of dragon skin(tm), reduces all damage to blunt trauma";
return "lightweight leather armor. provides great mobility.";
if (iid == IID_ARM_VANDAL)
return "enhanced leather armor for extra protection.";
if (iid == IID_ARM_METAL)
return "metal plates deflect smaller attacks easily";
return "gives great protection at a sacrifice to speed.";
if (iid == IID_ARM_TESLA)
return "experimental armor with high deflection but low absorb.";
if (iid == IID_ARM_COMBAT)
return "made from defensive polymers, the yardstick of armors";
if (iid == IID_ARM_BROTHERHOOD)
return "enhanced combat armor with anti-explosive plating";
return "this all-purpose armor is designed for combat missions.";
if (iid == IID_ARM_SEVA)
return "high-tech suit provides more environmental defense";
if (iid == IID_ARM_FORCE)
return "experimental energy-field armor, very low absorb";
if (iid == IID_ARM_LPOWER)
return "this heavy armor contains servos that assist with movement";
return "the heaviest armor with great protection";
if (iid == IID_CHEM_STIMPACK)
@ -1896,7 +1892,7 @@ string(float iid) GetItemImage =
return "wrench.jpg";
if (iid == IID_WP_KNIFE)
return "knife.jpg";
if (iid == IID_WP_AXE)
if (iid == IID_WP_SLEDGE)
return "disruptor.jpg";
if (iid == IID_WP_SPEAR)
return "spear.jpg";
@ -1927,30 +1923,26 @@ string(float iid) GetItemImage =
return "citykiller.jpg";
if (iid == IID_WP_JACKHAMMER)
return "jackhammer.jpg";
if (iid == IID_WP_GREASEGUN)
return "ggun2.jpg";
if (iid == IID_WP_MP9)
return "mp9.jpg";
if (iid == IID_WP_MP7)
return "ggun.jpg";
if (iid == IID_WP_MP9_S)
return "mp9.jpg";
if (iid == IID_WP_MP7_S)
return "ggun.jpg";
if (iid == IID_WP_RANGEMASTER)
return "rangem.jpg";
return "rangem.png";
if (iid == IID_WP_RANGEMASTER_SCOPE)
return "rangem_s.jpg";
if (iid == IID_WP_AK47)
return "ak47.jpg";
if (iid == IID_WP_AK112)
return "ak112.jpg";
return "ak112.png";
if (iid == IID_WP_AK112_M)
return "ak112.jpg";
return "ak112.png";
if (iid == IID_WP_AK74)
return "ak47.jpg";
if (iid == IID_WP_ACR)
return "acr.jpg";
if (iid == IID_WP_DKS1)
return "dks1.jpg";
return "dks1.png";
if (iid == IID_WP_DKS1_S)
return "dks1_s.jpg";
if (iid == IID_WP_MOONLIGHT)
@ -1960,15 +1952,15 @@ string(float iid) GetItemImage =
if (iid == IID_WP_GAUSERIFLE)
return "grifle.jpg";
if (iid == IID_WP_PULSERIFLE)
return "plasmar.jpg";
return "plasma.jpg";
if (iid == IID_WP_TURBOPLASMA)
return "turbo.jpg";
return "plasma.jpg";
if (iid == IID_WP_PULSERIFLE)
return "carbine.jpg";
if (iid == IID_WP_FNFAL)
return "fnfal.jpg";
if (iid == IID_WP_ROCKETLAUNCHER)
return "rpg.jpg";
return "rocket.jpg";
if (iid == IID_WP_LASERGATLING)
return "gatling.jpg";
@ -1980,7 +1972,7 @@ string(float iid) GetItemImage =
if (iid == IID_AM_10MM)
return "10mm.jpg";
if (iid == IID_AM_556MM)
return "556mm.jpg";
return "556mm.png";
if (iid == IID_AM_5MMHIGHVEL)
return "5mmhv.jpg";
if (iid == IID_AM_12GAUGESHELLS)
@ -1988,7 +1980,7 @@ string(float iid) GetItemImage =
if (iid == IID_AM_ENERGYCELL)
return "cell.jpg";
if (iid == IID_AM_762MM)
return "762mm.jpg";
return "762mm.png";
if (iid == IID_AM_44MAGNUM)
return "44mag.jpg";
if (iid == IID_AM_WARSAW)
@ -2013,18 +2005,18 @@ string(float iid) GetItemImage =
if (iid == IID_ARM_DESERT)
return "desert.jpg";
if (iid == IID_ARM_SHIRT)
return "shirt.jpg";
if (iid == IID_ARM_LEATHER)
return "leather.jpg";
if (iid == IID_ARM_KEVLAR)
return "doublek.jpg";
if (iid == IID_ARM_VANDAL)
return "vandal.jpg";
if (iid == IID_ARM_METAL)
return "ceramic.jpg";
return "metal.jpg";
if (iid == IID_ARM_TESLA)
return "tesla.jpg";
if (iid == IID_ARM_COMBAT)
return "combat.jpg";
if (iid == IID_ARM_BROTHERHOOD)
return "brotherhood.jpg";
if (iid == IID_ARM_SEVA)
return "seva.jpg";
if (iid == IID_ARM_FORCE)
return "force.jpg";
if (iid == IID_ARM_LPOWER)
@ -2127,7 +2119,7 @@ float(string itname) ItemIDOfName =
if (itname == "knife")
return IID_WP_KNIFE;
if (itname == "hand-axe")
return IID_WP_AXE;
return IID_WP_SLEDGE;
if (itname == "spear")
return IID_WP_SPEAR;
if (itname == "poweraxe")
@ -2154,10 +2146,10 @@ float(string itname) ItemIDOfName =
return IID_WP_MOSSBERG;
if (itname == "jackhammer")
return IID_WP_JACKHAMMER;
if (itname == "grease gun")
return IID_WP_GREASEGUN;
if (itname == "mp9")
return IID_WP_MP9;
if (itname == "grease gun")
return IID_WP_MP7;
if (itname == "rangemaster")
return IID_WP_RANGEMASTER;
if (itname == "rangemaster (scope)")
@ -2204,18 +2196,18 @@ float(string itname) ItemIDOfName =
return IID_GREN_SMOKE;
if (itname == "flash grenade")
return IID_GREN_FLASH;
if (itname == "bulletproof shirt")
return IID_ARM_SHIRT;
if (itname == "leather armor")
return IID_ARM_LEATHER;
if (itname == "kevlar armor")
return IID_ARM_KEVLAR;
if (itname == "vandal armor")
return IID_ARM_VANDAL;
if (itname == "metal armor")
return IID_ARM_METAL;
if (itname == "tesla armor")
return IID_ARM_TESLA;
if (itname == "combat armor")
return IID_ARM_COMBAT;
if (itname == "brotherhood armor")
return IID_ARM_BROTHERHOOD;
if (itname == "seva suit")
return IID_ARM_SEVA;
if (itname == "force armor")
return IID_ARM_FORCE;
if (itname == "light power armor")

View file

@ -257,6 +257,90 @@ void() Explosive =
droptofloor();
};
float (entity to, float iid, float quant) TryGiveStackable;
void() junk_touch =
{
local float junktype;
if (other.skill_science <= 0)
return;
if (other.classname != "player")
return;
if (other.health <= 0)
return;
if (!TryGiveStackable(other, ToIID(self.islot1), self.flash))
{
sprint(other, PRINT_MEDIUM, "inventory full.\n");
return;
}
sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
sprint(other, PRINT_MEDIUM, "found ");
sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1)));
sprint(other, PRINT_MEDIUM, ".\n");
remove (self);
};
void() SpawnJunk =
{
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_x = crandom()*600;
self.velocity_y = crandom()*600;
self.velocity_z = -100;
self.avelocity_y = crandom()*600;
if (random()*100 < 50)
setmodel (self, "progs/junk1.mdl");
else
setmodel (self, "progs/junk2.mdl");
self.touch = junk_touch;
self.solid = SOLID_BBOX;
setsize (self, '-12 -12 0', '12 12 12');
self.takedamage = DAMAGE_NO;
self.classname = "random_junk";
if (random()*100 <= 10)
self.islot1 = IID_MISC_JUNK;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_NUKACOLA;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_CHEMICALS;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_AEROSOL;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_RDXCRYSTAL;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_STEELPIPE;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_DUCKTAPE;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_LCD;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_CIRCUITBOARD;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_COPPERWIRE;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_HMXCOMPOUND;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_GUM;
else if (random()*100 <= 10)
self.islot1 = IID_MISC_XRAYTUBE;
if (random()*100 <= 10)
self.flash = 2;
else
self.flash = 1;
};
void() TreasureChest =
{
setorigin(self, self.origin + '0 0 64');
@ -273,8 +357,16 @@ void() TreasureChest =
setsize (self, '-12 -12 0', '12 12 12');
self.takedamage = DAMAGE_NO;
self.classname = "treasure_chest";
SpawnJunk();
SpawnJunk();
SpawnJunk();
};
void() car_rock =
{
self.frame = self.frame + 1;
@ -2167,6 +2259,7 @@ void() DropMoney =
};
/*
===============
DropBackpack

View file

@ -927,8 +927,8 @@ void() brotherhood_merchant =
if (random()*100 < 33)
{
self.xslot1 = SlotVal(IID_WP_MP9, 1);
self.xslot6 = SlotVal(IID_AM_10MM, 30);
self.xslot1 = SlotVal(IID_WP_GREASEGUN, 1);
self.xslot6 = SlotVal(IID_AM_45ACP, 30);
}
else if (random()*100 < 33)
{
@ -992,7 +992,7 @@ void() brotherhood_merchant =
if (random()*100 < 33)
{
self.xslot5 = SlotVal(IID_WP_AK112, 1);
self.xslot10 = SlotVal(IID_AM_556MM, 30);
self.xslot10 = SlotVal(IID_AM_5MMHIGHVEL, 30);
}
else if (random()*100 < 33)
{
@ -1001,36 +1001,32 @@ void() brotherhood_merchant =
}
else
{
self.xslot5 = SlotVal(IID_WP_MP7, 1);
self.xslot10 = SlotVal(IID_AM_45ACP, 30);
self.xslot5 = SlotVal(IID_WP_MP9, 1);
self.xslot10 = SlotVal(IID_AM_10MM, 30);
}
if (random()*100 < 50)
self.xslot11 = SlotVal(IID_ARM_SHIRT, 1);
else
self.xslot11 = SlotVal(IID_ARM_LEATHER, 1);
else
self.xslot11 = SlotVal(IID_ARM_VANDAL, 1);
if (random()*100 < 50)
self.xslot12 = SlotVal(IID_ARM_KEVLAR, 1);
else
self.xslot12 = SlotVal(IID_ARM_METAL, 1);
else
self.xslot12 = SlotVal(IID_ARM_TESLA, 1);
if (random()*100 < 75)
self.xslot13 = SlotVal(IID_ARM_COMBAT, 1);
else
self.xslot13 = SlotVal(IID_ARM_BROTHERHOOD, 1);
self.xslot13 = SlotVal(IID_ARM_SEVA, 1);
if (random()*100 < 75)
self.xslot14 = SlotVal(IID_GREN_FRAG, 1);
else
self.xslot14 = SlotVal(IID_GREN_FLASH, 1);
if (random()*100 < 75)
self.xslot15 = SlotVal(IID_GREN_SMOKE, 1);
else
self.xslot15 = SlotVal(IID_GREN_STUN, 1);
self.xslot14 = SlotVal(IID_CHEM_STIMPACK, 1);
self.xslot15 = SlotVal(IID_CHEM_MEDICALBAG, 25);
if (random()*100 < 80)
self.xslot16 = SlotVal(IID_WP_AK112, 1);
@ -1152,11 +1148,11 @@ void() brotherhood_doctor =
self.xslot1 = SlotVal(IID_WP_KNIFE, 1);
self.xslot2 = SlotVal(IID_WP_NEEDLER, 1);
self.xslot3 = SlotVal(IID_ARM_LEATHER, 1);
self.xslot16 = SlotVal(IID_CHEM_STIMPACK, 5);
self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 4);
self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 3);
self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 3);
self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 3);
self.xslot16 = SlotVal(IID_CHEM_STIMPACK, 1);
self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 25);
self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1);
self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1);
self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 1);
};

View file

@ -561,27 +561,7 @@ void() W_PlayerMenu =
return;
}
else if (self.currentmenu == "shop_armor")
{
if (self.impulse == 1)
BuyArmor(3, 50, IID_ARM_SHIRT); //weight, cost, item
if (self.impulse == 2)
BuyArmor(7, 100, IID_ARM_LEATHER); //weight, cost, item
if (self.impulse == 3)
BuyArmor(9, 125, IID_ARM_KEVLAR); //weight, cost, item
if (self.impulse == 4)
BuyArmor(15, 150, IID_ARM_METAL); //weight, cost, item
if (self.impulse == 5)
BuyArmor(12, 200, IID_ARM_COMBAT); //weight, cost, item
if (self.impulse == 6)
BuyArmor(17, 250, IID_ARM_BROTHERHOOD); //weight, cost, item
if (self.impulse == 7)
BuyArmor(5, 300, IID_ARM_FORCE); //weight, cost, item
if (self.impulse == 8)
BuyArmor(20, 400, IID_ARM_LPOWER); //weight, cost, item
return;
}
else if (self.currentmenu == "shop_ammo" && world.map_obj != 4)
{
if (self.impulse == 1)
@ -667,7 +647,7 @@ void() W_PlayerMenu =
if (self.impulse == 2)
BuyWeapon(3, 8, IID_WP_WRENCH); //weight, cost, item
if (self.impulse == 3)
BuyWeapon(8, 9, IID_WP_AXE); //weight, cost, item
BuyWeapon(8, 9, IID_WP_SLEDGE); //weight, cost, item
if (self.impulse == 4)
BuyWeapon(4, 12, IID_WP_SPEAR); //weight, cost, item
@ -701,9 +681,9 @@ void() W_PlayerMenu =
if (self.impulse == 4)
BuyWeapon(2, 120, IID_WP_NEEDLER); //weight, cost, item
if (self.impulse == 5)
BuyWeapon(3, 170, IID_WP_MP7); //weight, cost, item
BuyWeapon(3, 170, IID_WP_MP9); //weight, cost, item
if (self.impulse == 6)
BuyWeapon(3, 150, IID_WP_MP9); //weight, cost, item
BuyWeapon(3, 150, IID_WP_GREASEGUN); //weight, cost, item
return;
}

View file

@ -1128,7 +1128,7 @@ void () monster_ogre =
setsize (self, '-16 -16 -24', '16 16 48');
self.health = 200;
self.team = 3;
self.islot3 = SlotVal(IID_ARM_SHIRT, 1);
self.islot3 = SlotVal(IID_ARM_LEATHER, 1);
self.armornoise = "misc/thud.wav";
self.th_stand = ogre_stand1;
self.th_walk = ogre_walk1;

View file

@ -292,7 +292,7 @@ float (entity guy) holding_melee =
if (iid == IID_NONE ||
iid == IID_WP_KNIFE ||
iid == IID_WP_AXE ||
iid == IID_WP_SLEDGE ||
iid == IID_WP_SPEAR ||
iid == IID_WP_WRENCH)
return true;
@ -433,7 +433,7 @@ void () player_run = [ 137, player_run ]
self.walkframe = self.walkframe + 1;
if (self.walkframe == 6)
if (self.walkframe >= 6)
self.walkframe = 0;
};
@ -492,7 +492,7 @@ void () player_walk = [ 170, player_walk ]
self.frame = (170 + self.walkframe);
if (self.walkframe == 11)
if (self.walkframe >= 11)
self.walkframe = 0;
self.walkframe = (self.walkframe + 1);
@ -553,7 +553,7 @@ void () player_slow = [ 170, player_slow ]
self.frame = (170 + floor(self.walkframe/2));
if (self.walkframe == 22)
if (self.walkframe >= 22)
self.walkframe = 0;
self.walkframe = (self.walkframe + 1);

View file

@ -125,7 +125,7 @@ float (entity healer, entity saved) RevivePlayer =
// saved.materialize = 200;
saved.ghost = 0;
saved.health = 1;
saved.health = 40;
saved.air_finished = time + 10;
saved.view_ofs = '0 0 22';
self = saved;
@ -172,7 +172,7 @@ void(float damage, float dist, float rate) FireMelee =
weap = ToIID(self.(SlotField(self.current_slot)));
//large and in charge! adds a small burst of adrenalnie
if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_AXE || weap == IID_WP_WRENCH)))
if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH)))
{
if (self.ragetime <= 0)
{
@ -272,10 +272,10 @@ void(float damage, float dist, float rate) FireMelee =
if (self.class == 2 || self.class == 3)
damage = damage * 1.25;
if (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE)
if (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE)
SpawnBlood (org, 1);
if ((getperk(8)) && (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH))
if ((getperk(8)) && (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH))
{
sprint(self, 2, "!LARGE AND IN CHARGE\n");
dir = normalize(trace_ent.origin - self.origin);
@ -306,7 +306,7 @@ void(float damage, float dist, float rate) FireMelee =
else
sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM);
}
else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH)
else if (weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH)
{
if (random()<0.5)
sound (self, CHAN_BODY, "effects/axe_hit1.wav", 1, ATTN_NORM);
@ -334,7 +334,7 @@ void() W_FireMelee =
FireMelee(5+random()*30, 64, 1.2);
else if (iid == IID_WP_KNIFE)
FireMelee(5+random()*20, 64, 0.4);
else if (iid == IID_WP_AXE)
else if (iid == IID_WP_SLEDGE)
FireMelee(5+random()*80, 96, 1);
else if (iid == IID_WP_SPEAR)
FireMelee(5+random()*60, 160, 0.8);
@ -1573,7 +1573,7 @@ void() W_Attack =
sound (self, CHAN_WEAPON, "effects/miss.wav", TRUE, ATTN_NORM);
}
else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH)
else if (weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH)
{
if (random()<0.75)
{
@ -1626,13 +1626,13 @@ void() W_Attack =
W_FireShotgun (2, 5, 7, 20, 2000, 1, "weapons/citykiller.wav");
else if (weap == IID_WP_JACKHAMMER)
W_FireShotgun (1, 5, 7, 30, 1750, 2, "weapons/citykiller.wav");
else if (weap == IID_WP_MP9)
else if (weap == IID_WP_GREASEGUN)
FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10);
else if (weap == IID_WP_MP7)
else if (weap == IID_WP_MP9)
FireSMG(12, 0, "weapons/mp5.wav", 1500, 0.08);
else if (weap == IID_WP_MP9_S)
else if (weap == IID_WP_GREASEGUN_S)
FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10);
else if (weap == IID_WP_MP7_S)
else if (weap == IID_WP_MP9_S)
FireSMG(10, 0, "weapons/smg_s.wav", 1500, 0.08);
else if (weap == IID_WP_RANGEMASTER)
FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1);
@ -2480,7 +2480,7 @@ void () Explosion =
void () FragExplode =
{
local float r;
local float r, d;
local entity te;
local vector dir;
@ -2507,7 +2507,10 @@ void () FragExplode =
te = te.chain;
}
T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 400);
r = 400 + self.skill_science*2;
d = 65+random()*65 + self.skill_science;
T_RadiusDamage2 (self, self.owner, 65+random()*65, other, r);
remove (self);
};
@ -2530,7 +2533,7 @@ void () PlasmaExplode =
void () FlashExplode =
{
local entity te;
local float dot;
local float dot, effect;
local vector vec;
self.velocity = VEC_ORIGIN;
@ -2542,6 +2545,8 @@ void () FlashExplode =
WriteCoord (0, self.origin_z);
sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM);
effect = 5 + (self.skill_science/3);
te = findradius (self.origin, 200);
while (te)
{
@ -2549,8 +2554,8 @@ void () FlashExplode =
{
if (CanDamage (self, te))
{
te.flash = 12;
te.attack_finished = time + 12;
te.flash = effect;
te.attack_finished = time + effect;
spawn_excla(te, 12);
}
@ -2562,9 +2567,9 @@ void () FlashExplode =
te.missionbrief = 5;
stuffcmd (te, "v_cshift 255 255 255 255\n");
stuffcmd (te, "v_idlescale 3\n");
te.flash = time + 12;
te.flash = time + effect;
spawn_excla(te, 12);
spawn_excla(te, effect);
}
}
te = te.chain;
@ -2581,9 +2586,9 @@ void () FlashExplode =
if (dot > 0.3 && CanDamage (self, te))
{
te.flash = 12;
te.attack_finished = time + 12;
spawn_excla(te, 12);
te.flash = effect;
te.attack_finished = time + effect;
spawn_excla(te, effect);
}
}
@ -2597,9 +2602,9 @@ void () FlashExplode =
{
stuffcmd (te, "v_cshift 255 255 255 255\n");
stuffcmd (te, "v_idlescale 3\n");
te.flash = time + 4;
te.flash = time + effect;
spawn_excla(te, 4);
spawn_excla(te, effect);
}
}
te = te.chain;
@ -2607,37 +2612,38 @@ void () FlashExplode =
remove (self);
};
void () FlashThink =
{
local entity te;
te = findradius(self.origin, 600);
while (te)
{
if (te.classname == "player" && te.sneak > 0)
te.sneak = 0;
te = te.chain;
}
self.nextthink = time + 1;
self.score = self.score + 1;
if (self.score == 120)
remove(self);
};
void () StunExplode =
{
local entity te;
local float dot;
local float dot, effect;
local vector vec;
self.effects = EF_BLUE;
self.think = FlashThink;
self.nextthink = time + 1;
self.velocity = VEC_ORIGIN;
WriteByte (0, SVC_TEMPENTITY);
WriteByte (0, WEAPON_SPIKES);
WriteCoord (0, self.origin_x);
WriteCoord (0, self.origin_y);
WriteCoord (0, self.origin_z);
te = findradius(self.origin, 400);
while (te)
{
if (te.flags & FL_MONSTER)
{
te.hold = effect;
}
if (te.classname == "player")
te.hold = effect;
te = te.chain;
}
sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM);
remove(self);
};
/*
@ -2963,17 +2969,17 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG =
}
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
if (weap == IID_WP_MP9)
if (weap == IID_WP_GREASEGUN)
loud_noise(50);
else if (weap == IID_WP_MP7)
else if (weap == IID_WP_MP9)
loud_noise(40);
else if (weap == IID_WP_MP9_S)
else if (weap == IID_WP_GREASEGUN_S)
loud_noise(5);
else if (weap == IID_WP_MP7_S)
else if (weap == IID_WP_MP9_S)
loud_noise(5);
//only silenced weapons do not break stealth
if (weap != IID_WP_MP9_S && weap != IID_WP_MP7_S && self.sneak > 0)
if (weap != IID_WP_GREASEGUN_S && weap != IID_WP_MP9_S && self.sneak > 0)
{
self.equipment_slot = 0;
sprint(self, PRINT_HIGH, "<EFBFBD> Uncloaked <20>\n");
@ -3066,13 +3072,13 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG =
dam = dam + random()*dam;
if (weap == IID_WP_MP9)
if (weap == IID_WP_GREASEGUN)
J_Damage (trace_ent, self, self, dam);
else if (weap == IID_WP_MP7)
else if (weap == IID_WP_MP9)
T_Damage (trace_ent, self, self, dam);
else if (weap == IID_WP_MP9_S)
else if (weap == IID_WP_GREASEGUN_S)
J_Damage (trace_ent, self, self, dam);
else if (weap == IID_WP_MP7_S)
else if (weap == IID_WP_MP9_S)
T_Damage (trace_ent, self, self, dam);
T_Damage (trace_ent, self, self, dam);
@ -3287,14 +3293,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
}
}
if (self.extender == weap && self.silencer != weap)
dam = dam * 1.10;
if (self.silencer == weap)
{
sound (self, CHAN_WEAPON, "weapons/needler.wav", 1, ATTN_NORM);
loud_noise(20);
}
else
{
if (weap == IID_WP_MOONLIGHT)
@ -3399,6 +3398,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
if (tmp > 500)
tmp = 500;
tmp = tmp * 0.75;
source = self.origin + '0 0 22';
targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp;
@ -3935,7 +3936,7 @@ void (entity chest, float iid, float num) DropFromChest =
newmis.flash = num;
newmis.touch = MultiTouch;
}
else if (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER)
else if (iid >= IID_ARM_LEATHER && iid <= IID_ARM_LPOWER)
{
newmis.flash = num;
newmis.touch = MultiTouch;
@ -4147,19 +4148,45 @@ float(entity x, float slotno) DecreaseDestroySlotOther;
void () UseStimpack =
{
local float x;
local float x, found;
local vector source;
local entity thing;
local entity thing, te;
if (self.attack_finished > time)
return;
te = findradius (self.origin, 100);
while (te)
{
if (found == 0 && te.classname == "player" && te.deadflag)
{
x = SlotOfItem(self, IID_CHEM_STIMPACK);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n");
return;
}
DecreaseDestroySlot(x);//take away a stimpack
sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM);
RevivePlayer(self, te);
found = 1;
}
te = te.chain;
}
if (found == 1)
return;
self.attack_finished = time + 1;
self.rtime = time + 1;
makevectors (self.v_angle);
source = self.origin + '0 0 16';
source = self.origin + '0 0 0';
traceline (source, source + v_forward*64, FALSE, self);
if (trace_fraction == 1.0)//nobody in front of user, so heal self
@ -4390,7 +4417,7 @@ void () UseMedicalBag =
self.rtime = time + 1;
makevectors (self.v_angle);
source = self.origin + '0 0 16';
source = self.origin + '0 0 0';
traceline (source, source + v_forward*64, FALSE, self);
if (trace_fraction == 1.0)//nobody in front of user, so heal self
@ -4421,9 +4448,8 @@ void () UseMedicalBag =
}
sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM);
sprint(self, PRINT_MEDIUM, "you heal yourself with your medkit\n");
self.health = self.health + 5;
self.regen = self.regen + 5;
sprint(self, PRINT_MEDIUM, "you start to bandage yourself\n");
self.regen = self.regen + self.skill_doctor;
}
}
else if (trace_ent.classname == "player")//healing another team-mate
@ -4474,13 +4500,12 @@ void () UseMedicalBag =
sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM);
self.score = self.score + 10;
sprint(trace_ent, PRINT_MEDIUM, self.netname);
sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n");
sprint(trace_ent, PRINT_MEDIUM, " bandages your wounds\n");
sprint(self, PRINT_MEDIUM, "you heal ");
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " with a stimpack\n");
trace_ent.health = trace_ent.health + 10;
trace_ent.regen = trace_ent.regen + 10;
trace_ent.regen = trace_ent.regen + self.skill_doctor;
}
}
}
@ -5358,33 +5383,26 @@ void () Bar_Think =
{
local float dot1;
if ((self.owner.health < WEAPON_SHOTGUN))
if (self.owner.health >= self.owner.max_health)
{
remove (self);
return;
}
if ((self.owner.health >= self.owner.max_health))
{
remove (self);
self.frame = 0;
setmodel (self, "");
self.nextthink = time + 0.01;
return;
}
self.flags = self.flags;
if ((self.owner.position == WEAPON_SHOTGUN))
{
dot1 = WEAPON_SHOTGUN;
}
if ((dot1 == WEAPON_SHOTGUN))
{
self.frame = MULTICAST_ALL;
setmodel (self, "");
self.nextthink = (time + 0.01);
return;
}
if (((self.owner.health >= WEAPON_SHOTGUN) && (dot1 == MULTICAST_ALL)))
if (self.owner.health >= 1)
{
self.frame = floor (((self.owner.health / self.owner.max_health) * TE_WIZSPIKE));
setorigin (self, (self.owner.origin + '0 0 48'));
if (self.owner.position == 0)
setorigin (self, (self.owner.origin + '0 0 40'));
else if (self.owner.position == 1)
setorigin (self, (self.owner.origin + '0 0 32'));
else
setorigin (self, (self.owner.origin + '0 0 24'));
self.nextthink = (time + 0.01);
setmodel (self, "progs/hbar.spr");
}
@ -5407,6 +5425,7 @@ void (entity guy) spawn_dot =
hologram.cnt = MULTICAST_ALL;
hologram.think = Bar_Think;
hologram.nextthink = (time + 0.01);
hologram.scale = 0.5;
};
void() FinishTurret;
@ -6467,26 +6486,6 @@ void() AttachSilencer =
return;
}
}
else if (weap == IID_WP_MP7)
{
sprint(self, 2, "silencer attached.\n");
DecreaseDestroySlot(y);
if (self.current_slot == 1)
{
x = ToStatus(self.islot1);
self.islot1 = 0;
SetItemSlot(self, 1, SlotVal(IID_WP_MP7_S, x));
return;
}
if (self.current_slot == 2)
{
x = ToStatus(self.islot2);
self.islot2 = 0;
SetItemSlot(self, 2, SlotVal(IID_WP_MP7_S, x));
return;
}
}
else if (weap == IID_WP_MP9)
{
sprint(self, 2, "silencer attached.\n");
@ -6507,6 +6506,26 @@ void() AttachSilencer =
return;
}
}
else if (weap == IID_WP_GREASEGUN)
{
sprint(self, 2, "silencer attached.\n");
DecreaseDestroySlot(y);
if (self.current_slot == 1)
{
x = ToStatus(self.islot1);
self.islot1 = 0;
SetItemSlot(self, 1, SlotVal(IID_WP_GREASEGUN_S, x));
return;
}
if (self.current_slot == 2)
{
x = ToStatus(self.islot2);
self.islot2 = 0;
SetItemSlot(self, 2, SlotVal(IID_WP_GREASEGUN_S, x));
return;
}
}
else if (weap == IID_WP_PIPERIFLE)
{
sprint(self, 2, "silencer attached.\n");
@ -6881,7 +6900,7 @@ void() SpawnGModel =
setmodel (hologram, "progs/g_knife.mdl");
if (weap == IID_WP_WRENCH)
setmodel (hologram, "progs/g_wrench.mdl");
if (weap == IID_WP_AXE)
if (weap == IID_WP_SLEDGE)
setmodel (hologram, "progs/g_axe.mdl");
if (weap == IID_WP_SPEAR)
setmodel (hologram, "progs/g_spear.mdl");
@ -6903,7 +6922,7 @@ void() SpawnGModel =
setmodel (hologram, "progs/g_knife.mdl");
if (weap == IID_WP_WRENCH)
setmodel (hologram, "progs/g_wrench.mdl");
if (weap == IID_WP_AXE)
if (weap == IID_WP_SLEDGE)
setmodel (hologram, "progs/g_axe.mdl");
if (weap == IID_WP_SPEAR)
setmodel (hologram, "progs/g_spear.mdl");

View file

@ -2240,6 +2240,11 @@ void() worldspawn =
// 63 testing
lightstyle(63, "a");
if (infokey(world, "coop") == "0")
coop = 0;
if (infokey(world, "coop") == "1")
coop = 1;
};
void() StartFrame =