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

This commit is contained in:
Magnus 2009-11-24 14:10:10 +00:00
parent 5f7d753be1
commit 2b8b589b26
11 changed files with 108 additions and 108 deletions

View File

@ -1328,7 +1328,7 @@ void() SneakLevel =
te = findradius(self.origin, q);
while (te)
{
if (visible(te) && te.classname == "monster" && (check_fov_num(te) > 0.5) && te.health > 3)
if ((te.enemy.classname != "player" || te.enemy != self) && visible(te) && te.classname == "monster" && (check_fov_num(te) > 0.5) && te.health > 3)
{
if (c == 0)
{
@ -1340,14 +1340,7 @@ void() SneakLevel =
y = r / t;
ze = te;
c = 1;
/*
bprint(2, "test1: ");
bprint(2, ftos(r));
bprint(2, " ");
bprint(2, ftos(q));
bprint(2, " ");
bprint(2, ftos(t));
bprint(2, "\n");*/
}
else
{
@ -1357,14 +1350,7 @@ void() SneakLevel =
t = t * (check_fov_num(te));
t = t * (check_fov_num(te));
z = r / t;
/*
bprint(2, "test2: ");
bprint(2, ftos(r));
bprint(2, " ");
bprint(2, ftos(q));
bprint(2, " ");
bprint(2, ftos(t));
bprint(2, "\n");*/
if (z < y)
{
@ -2412,12 +2398,12 @@ void(entity targ, entity attacker) ClientObituary =
if (attacker.critical == 778) //wall headshot
{
bprint (PRINT_MEDIUM, "& ");
attacker.score = attacker.score + 75;
attacker.score = attacker.score + 10;
}
if (attacker.velocity_z != 0)
{
bprint (PRINT_MEDIUM, "@ ");
attacker.score = attacker.score - 2;
attacker.score = attacker.score + 2;
}
// if (attacker.current_slot == 1 && attacker.mag1 == 0)
// bprint (PRINT_MEDIUM, "! ");

View File

@ -424,7 +424,8 @@ void(string arg1) Cmd_InvBuy =
sprint(self, 2, "full inventory.\n");
sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM);
m = SlotOfItem(self, IID_MONEY);
SetItemSlot(self, m, n);
SetItemSlot(self, m, 0);
TryGiveStackable(self, IID_MONEY, n);
return;
}
sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM);
@ -743,16 +744,15 @@ void(string arg1) Cmd_InvMix =
sprint(self, PRINT_MEDIUM, "silencer created\n");
sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
}
else if ((iid1 == IID_WP_NEEDLER && iid2 == IID_WP_NEEDLER) ||
(iid2 == IID_WP_NEEDLER && iid1 == IID_WP_NEEDLER))
else if ((iid1 == IID_ARM_VANDAL && iid2 == IID_MISC_JUNK) ||
(iid2 == IID_ARM_VANDAL && iid1 == IID_MISC_JUNK))
{
if (random()*100 > (self.skill_science*10))
if (random()*100 > (self.skill_science*20))
{
sprint(self, PRINT_MEDIUM, "your concoction exploded!\n");
Explosion();
sprint(self, PRINT_MEDIUM, "your concoction failed.\n");
return;
}
@ -768,8 +768,8 @@ void(string arg1) Cmd_InvMix =
DecreaseDestroySlot(23);
DecreaseDestroySlot(24);
SetItemSlot(self, x, SlotVal(IID_WP_ACR, 1));
sprint(self, PRINT_MEDIUM, "Steyr ACR created\n");
SetItemSlot(self, x, SlotVal(IID_ARM_WASTELAND, 1));
sprint(self, PRINT_MEDIUM, "Wasteland Jacket created\n");
sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
}
else

View File

@ -180,10 +180,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
if (targ.classname == "player" && attacker.classname == "monster")
targ.superenemy = attacker;
//getting hurt is slightly painful to the score, play cautiously!
if (attacker.classname == "monster" && targ.classname == "player")
targ.score = targ.score - 1;
//flanking monsters awards points
if (attacker.classname == "player" && targ.classname == "monster" && targ.enemy != attacker)
attacker.score = attacker.score + 1;
@ -216,14 +212,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
//attacking a team-mate is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "player")
{
attacker.score = attacker.score - 5;
attacker.score = attacker.score - 2;
sprint(attacker, 2, "you just shot a teammate! be careful!\n");
}
//attacking a hostage is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "hostage")
{
attacker.score = attacker.score - 5;
attacker.score = attacker.score - 2;
sprint(attacker, 2, "you just shot a hostage! be careful!\n");
}

View File

@ -503,30 +503,32 @@ void() Trader_Draw =
TraderImage('5 4 0'*IMGSIZEF*(scrwidth/640), 20);
slotnum = 0;
if (!showcontextmenu)
{
slotnum = 0;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15;
}
if (showcontextmenu && show_trader)
{
drawfill(contextpos*(scrwidth/640) - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0);
op = floor((mousepos_y*(scrwidth/640) - contextpos_y*(scrwidth/640))/8*(scrwidth/640));
drawstring(contextpos*(scrwidth/640) + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0' + (op!=1)*'0 0 1',
drawfill(contextpos - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0);
op = floor((mousepos_y - contextpos_y)/8*(scrwidth/640));
drawstring(contextpos + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=1)*'0 0 1'*(scrwidth/640),
1);
}
@ -1013,18 +1015,18 @@ void() Invent_Draw =
if (showcontextmenu && show_inventory)
{
drawfill(contextpos - '8 8 0', '88 24 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1);
drawfill(contextpos - '8 8 0', '32 48 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1);
op = floor((mousepos_y - contextpos_y)/8);
drawstring(contextpos + (0 * '0 8 0'), "use/reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1);
drawstring(contextpos + (1 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1);
drawstring(contextpos + (0 * ('0 8 0'*(scrwidth/640))), "use", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=0)*'0 0 1'*(scrwidth/640), 1);
drawstring(contextpos + (2 * ('0 8 0'*(scrwidth/640))), "drop", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1);
if (getstati(108) == 1)
drawstring(contextpos + (2 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1);
drawstring(contextpos + (4 * ('0 8 0'*(scrwidth/640))), "sell", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1);
}
else if (showmixmenu && show_inventory)
{
drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9);
drawfill(contextpos - '8 8 0', '16 24 0'+'96 96 0', '0 0 0', 1);
op = floor((mousepos_y - contextpos_y)/8);
drawstring(contextpos + (0 * '0 8 0'), "mix items", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1);
@ -1227,13 +1229,13 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent =
{
if (showcontextmenu && show_inventory)
{
op = floor((mousepos_y - contextpos_y)/8);
op = ceil((mousepos_y - contextpos_y)/(8*(scrwidth/640)));
if (op == 0)
localcmd(strcat("cmd invuse ", ftos(slotnum), "\n"));
else if ((op == 1))
else if ((op == 2))
localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n"));
else if (op == 2)
else if (op == 4)
localcmd(strcat("cmd invsell ", ftos(slotnum), "\n"));
showcontextmenu = false;

View File

@ -94,16 +94,23 @@ float() CheckAttack =
else if (enemy_range == RANGE_NEAR)
{
if (self.th_melee)
chance = 0.2;
chance = 0.95;
else
chance = 0.4;
chance = 0.95;
}
else if (enemy_range == RANGE_MID)
{
if (self.th_melee)
chance = 0.05;
chance = 0.95;
else
chance = 0.1;
chance = 0.95;
}
else if (enemy_range == RANGE_FAR)
{
if (self.th_melee)
chance = 0.9;
else
chance = 0.9;
}
else
chance = 0;
@ -111,7 +118,7 @@ float() CheckAttack =
if (random () < chance)
{
self.th_missile ();
SUB_AttackFinished (2*random());
SUB_AttackFinished (3*random());
return TRUE;
}
@ -261,9 +268,11 @@ float() SoldierCheckAttack =
if (enemy_range == RANGE_MELEE)
chance = 0.9;
else if (enemy_range == RANGE_NEAR)
chance = 0.4;
chance = 0.9;
else if (enemy_range == RANGE_MID)
chance = 0.05;
chance = 0.9;
else if (enemy_range == RANGE_FAR)
chance = 0.9;
else
chance = 0;

View File

@ -85,7 +85,7 @@ float IID_GREN_STUN = 105;
float IID_GREN_FLARE = 106;
//armour
#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER)
#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_WASTELAND)
float IID_ARM_DESERT = 200;
float IID_ARM_LEATHER = 201;
float IID_ARM_VANDAL = 202;
@ -95,6 +95,7 @@ float IID_ARM_COMBAT = 205;
float IID_ARM_SEVA = 206;
float IID_ARM_FORCE = 207;
float IID_ARM_LPOWER = 208;
float IID_ARM_WASTELAND = 208;
//stims
#define IsChem(iid) (iid >= IID_CHEM_STIMPACK && iid <= IID_CHEM_BESERK)
@ -915,6 +916,9 @@ string(float iid) GetItemWModel =
if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE)
return "progs/junk1.mdl";
if (iid >= IID_ARM_LEATHER && iid <= IID_ARM_WASTELAND)
return "progs/armor.mdl";
if (iid == IID_MONEY)
return "progs/money.mdl";
@ -1375,7 +1379,8 @@ string(float iid) GetItemName =
return "force armor";
if (iid == IID_ARM_LPOWER)
return "power armor";
if (iid == IID_ARM_WASTELAND)
return "wasteland jacket";
if (iid == IID_CHEM_STIMPACK)
return "stimpack";
@ -1577,7 +1582,7 @@ float(float iid) GetBaseValue =
if (iid == IID_AM_2MMEC)
return 120;
if (iid == IID_AM_10MM)
return 12;
return 10;
if (iid == IID_AM_556MM)
return 20;
if (iid == IID_AM_5MMHIGHVEL)
@ -1630,7 +1635,8 @@ float(float iid) GetBaseValue =
return 300;
if (iid == IID_ARM_LPOWER)
return 450;
if (iid == IID_ARM_WASTELAND)
return 150;
if (iid == IID_CHEM_STIMPACK)
return 5;
@ -1864,7 +1870,8 @@ string(float iid) GetItemDesc =
return "experimental energy-field armor, very low absorb";
if (iid == IID_ARM_LPOWER)
return "the heaviest armor with great protection";
if (iid == IID_ARM_WASTELAND)
return "upgraded vandal armor with extra small arms protection";
if (iid == IID_CHEM_STIMPACK)
return "advanced healing chem that replaces lost blood";
@ -1964,6 +1971,8 @@ float(float iid) GetArmorThreshold =
return 3;
if (iid == IID_ARM_VANDAL)
return 4;
if (iid == IID_ARM_VANDAL)
return 5;
if (iid == IID_ARM_METAL)
return 1;
if (iid == IID_ARM_TESLA)
@ -1988,6 +1997,8 @@ float(float iid) GetArmorAbsorb =
return 20;
if (iid == IID_ARM_VANDAL)
return 30;
if (iid == IID_ARM_WASTELAND)
return 30;
if (iid == IID_ARM_METAL)
return 50;
if (iid == IID_ARM_TESLA)
@ -2316,6 +2327,8 @@ string(float iid) GetItemImage =
return "leather.jpg";
if (iid == IID_ARM_VANDAL)
return "vandal.jpg";
if (iid == IID_ARM_WASTELAND)
return "vandal.jpg";
if (iid == IID_ARM_METAL)
return "metal.jpg";
if (iid == IID_ARM_TESLA)
@ -2925,6 +2938,8 @@ float(float iid) GetItemThreatLevel =
return 0;
if (iid == IID_ARM_VANDAL)
return 0;
if (iid == IID_ARM_WASTELAND)
return 0;
if (iid == IID_ARM_METAL)
return 0;
if (iid == IID_ARM_TESLA)

View File

@ -316,13 +316,13 @@ void(vector loc) SpawnJunk =
if (random()*100 <= 50)
if (random()*100 <= 25)
junk.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1);
else if (random()*100 <= 50)
else if (random()*100 <= 25)
junk.islot1 = SlotVal(IID_MISC_CHEMICALS, 1);
else if (random()*100 <= 33)
else if (random()*100 <= 25)
junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1);
else if (random()*100 <= 33)
else if (random()*100 <= 25)
junk.islot1 = SlotVal(IID_MISC_AEROSOL, 1);
else if (random()*100 <= 10)
junk.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1);

View File

@ -194,7 +194,7 @@ void (float db) loud_noise =
while (te)
{
if (te.classname == "monster" && te.enemy.classname != "player")
if (te.classname == "monster" && (te.enemy.classname != "player" && te.charmed <= 0))
{
dir = normalize(te.origin - self.origin);
v = vlen(te.origin - self.origin);

View File

@ -351,7 +351,7 @@ void (float tmp, float dam) army_fire3 =
if (trace_ent.takedamage)
{
SpawnBlood (org, PLAT_LOW_TRIGGER);
dam = dam + random()*dam;
dam = 6 + random()*6;
dam = dam * (1 - (trace_fraction/2));
T_Damage (trace_ent, self, self, dam);
}

View File

@ -637,7 +637,10 @@ void(float damage, float dist, float rate) FireMelee =
if (dot < 0.5 && trace_ent.takedamage)
{
tdam = 20 + (60*self.skill_sneak);
if (trace_ent.enemy.classname == "player")
tdam = 20 + (60*self.skill_sneak);
else
tdam = 20 + (50*self.skill_sneak);
if (trace_ent.solid != SOLID_BSP)
SpawnBlood (org, 1);
@ -665,6 +668,18 @@ void(float damage, float dist, float rate) FireMelee =
self.sneak = 0;
spawn_excla(self, 3);
}
else
{
bprint(2, self.netname);
bprint(2, " assassinates ");
bprint(2, trace_ent.netname);
bprint(2, "!\n");
if (random()*4<2)
sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE);
else
sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE);
}
}
else if (trace_ent.takedamage)
{
@ -2060,9 +2075,9 @@ void() W_Attack =
else if (weap == IID_WP_MP9)
FireSMG(12, 0, "weapons/mp9.wav", 1500, 0.08);
else if (weap == IID_WP_GREASEGUN_S)
FireSMG(9, 0, "weapons/greasegun.wav", 1200, 0.08);
FireSMG(12, 0, "weapons/greasegun.wav", 1200, 0.08);
else if (weap == IID_WP_MP9_S)
FireSMG(9, 0, "weapons/mp9.wav", 1200, 0.08);
FireSMG(12, 0, "weapons/mp9.wav", 1200, 0.08);
else if (weap == IID_WP_RANGEMASTER)
FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1);
else if (weap == IID_WP_AK112)
@ -2661,7 +2676,7 @@ void (vector org) bullet_hole =
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (self.origin, MULTICAST_PHS);
multicast (org, MULTICAST_PHS);
};
@ -3404,6 +3419,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG =
dam = dam * 1.1;
}
if (weap == IID_WP_GREASEGUN_S)
tmp = 210;
if (self.velocity == '0 0 0')
tmp = tmp + (15*self.recoil);
else
@ -4623,15 +4642,6 @@ void () UseStimpack =
sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM);
sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n");
thing = findradius(self.origin, 400);
while (thing)
{
if (thing.classname == "player" && thing.health < self.health)
self.score = self.score - 50;
thing = thing.chain;
}
self.health = self.health + 30 + (self.skill_doctor);
self.regen = self.regen + (5 + (self.skill_doctor/2));
spawn_healing(self);
@ -4672,15 +4682,6 @@ void () UseSuperStim =
sprint(self, PRINT_MEDIUM, "you are not injured.\n");
else if (self.health < self.max_health)
{
local entity thing;
thing = findradius(self.origin, 400);
while (thing)
{
if (thing.classname == "player" && (thing.health+20) < self.health)
self.score = self.score - 50;
thing = thing.chain;
}
DecreaseDestroySlot(x);//take away a stimpack
sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM);
@ -4834,16 +4835,6 @@ void () UseMedicalBag =
{
DecreaseDestroySlot(x);//take away a medkit
local entity thing;
thing = findradius(self.origin, 400);
while (thing)
{
if (thing.classname == "player" && (thing.health+20) < self.health)
self.score = self.score - 25;
thing = thing.chain;
}
sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM);
self.health = self.health + 5 + (self.skill_doctor/2);
self.regen = self.regen + 3 + (self.skill_doctor/2);

View File

@ -1799,6 +1799,7 @@ void() worldspawn =
precache_model ("progs/backpack.mdl");
precache_model ("progs/zom_gib.mdl");
precache_model ("progs/v_light.mdl");
precache_model ("progs/armor.mdl");
precache_model ("maps/crate.bsp");
//