mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 03:51:32 +00:00
*** empty log message ***
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1845 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1d437c5023
commit
6c209f284b
5 changed files with 261 additions and 18 deletions
|
@ -346,6 +346,214 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
|
|||
self = oldself;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
X_Damage
|
||||
|
||||
The other damage function.
|
||||
|
||||
============
|
||||
*/
|
||||
|
||||
void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
|
||||
{
|
||||
local entity oldself;
|
||||
local float save;
|
||||
local float take, severity, helm;
|
||||
local string attackerteam, targteam;
|
||||
|
||||
|
||||
if (!targ.takedamage)
|
||||
return;
|
||||
|
||||
// used by buttons and triggers to set activator for target firing
|
||||
damage_attacker = attacker;
|
||||
|
||||
|
||||
// check for quad damage powerup on the attacker
|
||||
if (attacker.super_damage_finished > time && inflictor.classname != "door")
|
||||
if (deathmatch == 4)
|
||||
damage = damage * 8;
|
||||
else
|
||||
damage = damage * 4;
|
||||
|
||||
if (attacker.critical == 3)//attacker scored a headshot/critical
|
||||
{
|
||||
if (attacker.critical == 3)
|
||||
{
|
||||
severity = 0 + random()*20;
|
||||
if (attacker.perk == 7)
|
||||
severity = severity + 4;
|
||||
|
||||
if (attacker.class == 3)
|
||||
severity = severity + 2;
|
||||
|
||||
if (severity >= 19)
|
||||
damage = (damage * 3.0);
|
||||
else if (severity >= 14)
|
||||
damage = (damage * 2.5);
|
||||
else
|
||||
damage = (damage * 2.0);
|
||||
|
||||
helm = targ.armortype;
|
||||
if (targ.helmet == 0)
|
||||
{
|
||||
sound (targ, CHAN_BODY, "player/headshot.wav", 1, ATTN_NORM);
|
||||
helm = 0;
|
||||
}
|
||||
if (targ.helmet == AS_STRAIGHT)
|
||||
{
|
||||
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
|
||||
helm = 0.10;
|
||||
}
|
||||
if (targ.helmet == AS_SLIDING)
|
||||
{
|
||||
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
|
||||
helm = 0.15;
|
||||
}
|
||||
|
||||
damage = (damage - (damage * helm));
|
||||
|
||||
makevectors (targ.v_angle);
|
||||
}
|
||||
}
|
||||
|
||||
if (random()*4<=1)
|
||||
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
|
||||
|
||||
// add to the damage total for clients, which will be sent as a single
|
||||
// message at the end of the frame
|
||||
// FIXME: remove after combining shotgun blasts?
|
||||
if (targ.flags & FL_CLIENT)
|
||||
{
|
||||
targ.dmg_take = targ.dmg_take + take;
|
||||
targ.dmg_save = targ.dmg_save + save;
|
||||
targ.dmg_inflictor = inflictor;
|
||||
}
|
||||
|
||||
damage_inflictor = inflictor;
|
||||
|
||||
/*
|
||||
// figure momentum add
|
||||
if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) )
|
||||
{
|
||||
dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
|
||||
dir = normalize(dir);
|
||||
// Set kickback for smaller weapons
|
||||
//Zoid -- use normal NQ kickback
|
||||
// // Read: only if it's not yourself doing the damage
|
||||
// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname))
|
||||
// targ.velocity = targ.velocity + dir * damage * 11;
|
||||
// else
|
||||
// Otherwise, these rules apply to rockets and grenades
|
||||
// for blast velocity
|
||||
targ.velocity = targ.velocity + dir * damage * 8;
|
||||
|
||||
// Rocket Jump modifiers
|
||||
if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname))
|
||||
targ.velocity = targ.velocity + dir * damage * rj;
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
// check for godmode or invincibility
|
||||
if (targ.flags & FL_GODMODE)
|
||||
return;
|
||||
|
||||
if (targ.invincible_finished >= time)
|
||||
{
|
||||
if (self.invincible_sound < time)
|
||||
{
|
||||
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
|
||||
self.invincible_sound = time + 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// team play damage avoidance
|
||||
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
|
||||
attackerteam = infokey(attacker, "team");
|
||||
targteam = infokey(targ, "team");
|
||||
|
||||
if ((teamplay == 1) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
if ((teamplay == 3) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
(targ != attacker)&& inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
|
||||
// do the damage
|
||||
//different sorts of armour simply subtract different ammounts
|
||||
//this makes armor like the force armor good against many small rounds
|
||||
//(SMG, shotguns, swords, etc) but useless against big damage (grenades)
|
||||
//power armor, which has the best of both worlds, is also the heaviest :p
|
||||
|
||||
switch(ToIID(targ.islot3))
|
||||
{
|
||||
case IID_ARM_BROTHERHOOD:
|
||||
take -= 1;
|
||||
break;
|
||||
case IID_ARM_FORCE:
|
||||
take -= 2;
|
||||
break;
|
||||
case IID_ARM_LPOWER:
|
||||
take -= 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (take <= 0)
|
||||
{
|
||||
take = 0;
|
||||
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
targ.health = targ.health - take;
|
||||
|
||||
if (targ.health <= 0)
|
||||
{
|
||||
Killed (targ, attacker);
|
||||
return;
|
||||
}
|
||||
|
||||
// react to the damage
|
||||
oldself = self;
|
||||
self = targ;
|
||||
|
||||
/*SERVER
|
||||
if ( (self.flags & FL_MONSTER) && attacker != world)
|
||||
{
|
||||
// get mad unless of the same class (except for soldiers)
|
||||
if (self != attacker && attacker != self.enemy)
|
||||
{
|
||||
if ( (self.classname != attacker.classname)
|
||||
|| (self.classname == "monster" ) )
|
||||
{
|
||||
if (self.enemy.classname == "player")
|
||||
self.oldenemy = self.enemy;
|
||||
self.enemy = attacker;
|
||||
FoundTarget ();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (self.th_pain)
|
||||
{
|
||||
self.th_pain (attacker, take);
|
||||
}
|
||||
|
||||
self = oldself;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
T_RadiusDamage
|
||||
|
|
|
@ -31,8 +31,10 @@ float IID_WP_AK74 = 417;
|
|||
float IID_WP_DKS1 = 418;
|
||||
float IID_WP_MOONLIGHT = 419;
|
||||
float IID_WP_SA80 = 420;
|
||||
float IID_WP_GAUSERIFLE = 421;
|
||||
float IID_WP_GAUSERIFLE = 421; //2mm EC
|
||||
float IID_WP_PULSERIFLE = 422;
|
||||
float IID_WP_FNFAL = 423; //.308 AP
|
||||
|
||||
|
||||
//and ammo for those guns
|
||||
float IID_AM_NEEDLER = 507;
|
||||
|
@ -468,6 +470,8 @@ string(float iid) GetItemVModel =
|
|||
return "progs/v_srifle.mdl";
|
||||
if (iid == IID_WP_MOONLIGHT)
|
||||
return "progs/v_night.mdl";
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return "progs/v_rangem.mdl";
|
||||
|
||||
|
||||
if (iid == IID_WP_SA80)
|
||||
|
@ -534,6 +538,8 @@ string(float iid) GetItemWModel =
|
|||
return "progs/w_night.mdl";
|
||||
if (iid == IID_WP_SA80)
|
||||
return "progs/w_sa80.mdl";
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return "progs/w_rangem.mdl";
|
||||
|
||||
if (iid == IID_WP_GAUSERIFLE)
|
||||
return "progs/w_gauss.mdl";
|
||||
|
@ -602,6 +608,8 @@ float(float iid) WeaponAmmoType =
|
|||
return IID_AM_556MM;
|
||||
if (iid == IID_WP_SA80)
|
||||
return IID_AM_556MM;
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return IID_AM_762MM;
|
||||
|
||||
if (iid == IID_WP_GAUSERIFLE)
|
||||
return IID_AM_2MMEC;
|
||||
|
@ -649,6 +657,8 @@ float(float iid) WeaponMagQuant =
|
|||
return 10;
|
||||
if (iid == IID_WP_PULSERIFLE)
|
||||
return 40;
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return 20;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
@ -700,7 +710,9 @@ float(float iid) GetItemWeight =
|
|||
if (iid == IID_WP_GAUSERIFLE)
|
||||
return 9;
|
||||
if (iid == IID_WP_PULSERIFLE)
|
||||
return 10;
|
||||
return 12;
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return 9;
|
||||
|
||||
|
||||
if (iid == IID_ARM_SHIRT)
|
||||
|
@ -798,6 +810,8 @@ string(float iid) GetItemName =
|
|||
return "gauss rifle (2mm EC)";
|
||||
if (iid == IID_WP_PULSERIFLE)
|
||||
return "laser carbine (energy)";
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return "fn-fal (7.62mm)";
|
||||
|
||||
|
||||
|
||||
|
@ -806,17 +820,17 @@ string(float iid) GetItemName =
|
|||
if (iid == IID_AM_2MMEC)
|
||||
return "2mm EC ammo";
|
||||
if (iid == IID_AM_10MM)
|
||||
return "10mm ammo";
|
||||
return "10mm FMJ";
|
||||
if (iid == IID_AM_556MM)
|
||||
return "5.56mm ammo";
|
||||
return "5.56mm FMJ";
|
||||
if (iid == IID_AM_5MMHIGHVEL)
|
||||
return "5mm high-velocity ammo";
|
||||
return "5mm JHP";
|
||||
if (iid == IID_AM_12GAUGESHELLS)
|
||||
return "12-guage shotgun shells";
|
||||
if (iid == IID_AM_ENERGYCELL)
|
||||
return "small energy cell";
|
||||
if (iid == IID_AM_762MM)
|
||||
return "7.62mm ammo";
|
||||
return "7.62mm AP";
|
||||
if (iid == IID_AM_44MAGNUM)
|
||||
return ".44 magnum ammo";
|
||||
if (iid == IID_AM_45ACP)
|
||||
|
@ -955,7 +969,8 @@ string(float iid) GetItemImage =
|
|||
return "grifle.jpg";
|
||||
if (iid == IID_WP_PULSERIFLE)
|
||||
return "lcarbine.jpg";
|
||||
|
||||
if (iid == IID_WP_FNFAL)
|
||||
return "fnfal.jpg";
|
||||
|
||||
|
||||
if (iid == IID_AM_NEEDLER)
|
||||
|
@ -1081,6 +1096,8 @@ float(string itname) ItemIDOfName =
|
|||
return IID_WP_MP7;
|
||||
if (itname == "rangemaster")
|
||||
return IID_WP_RANGEMASTER;
|
||||
if (itname == "fnfal")
|
||||
return IID_WP_FNFAL;
|
||||
if (itname == "ak-112")
|
||||
return IID_WP_AK112;
|
||||
if (itname == "ak-74")
|
||||
|
|
|
@ -141,7 +141,7 @@ string () ShotgunString =
|
|||
*/
|
||||
string () RifleString =
|
||||
{
|
||||
return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n<EFBFBD>1‘ rangemaster 7mm 03 11$\n<EFBFBD>2‘ ak-112 5mm 04 21$\n<EFBFBD>3‘ remington .308 05 24$\n<EFBFBD>4‘ ak-74 5mm 04 27$\n<EFBFBD>5‘ moonlight .223 05 36$\n<EFBFBD>6‘ xl-70 5mm 05 23$\n<EFBFBD>7‘ plasma rifle 07 41$\n<EFBFBD>8‘ gauss rifle 2mm 08 51$\n");
|
||||
return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n<EFBFBD>1‘ rangemaster 7mm 03 11$\n<EFBFBD>2‘ ak-112 5mm 04 21$\n<EFBFBD>3‘ remington .308 05 24$\n<EFBFBD>4‘ ak-74 5mm 04 27$\n<EFBFBD>5‘ moonlight .223 05 36$\n<EFBFBD>6‘ sa-80 5mm 05 32$\n<EFBFBD>7‘ plasma rifle 12 41$\n<EFBFBD>8‘ gauss rifle 2mm 07 32$\n<EFBFBD>9‘ fn-fal .308 09 25$\n");
|
||||
};
|
||||
|
||||
string () ChemString =
|
||||
|
|
|
@ -140,6 +140,8 @@ void(string type) ChangeAmmo =
|
|||
self.ammotype2 = type;
|
||||
};
|
||||
|
||||
void() SetWeaponModel;
|
||||
|
||||
void (float wt, float cost, float wid) BuyWeapon =
|
||||
{
|
||||
local string itname;
|
||||
|
@ -182,6 +184,8 @@ void (float wt, float cost, float wid) BuyWeapon =
|
|||
|
||||
ammotype = WeaponAmmoType(wid);//load weapon with full ammo (may be changed)
|
||||
AddStackable(self, ammotype, ammocount*3);
|
||||
|
||||
SetWeaponModel();
|
||||
};
|
||||
|
||||
|
||||
|
@ -572,9 +576,9 @@ void() W_PlayerMenu =
|
|||
if (self.currentmenu == "shop_shotguns")
|
||||
{
|
||||
if (self.impulse == 1)
|
||||
BuyWeapon(3, 3, IID_WP_PIPERIFLE); //weight, cost, item
|
||||
BuyWeapon(3, 4, IID_WP_PIPERIFLE); //weight, cost, item
|
||||
if (self.impulse == 2)
|
||||
BuyWeapon(4, 7, IID_WP_WINCHESTER); //weight, cost, item
|
||||
BuyWeapon(4, 8, IID_WP_WINCHESTER); //weight, cost, item
|
||||
if (self.impulse == 3)
|
||||
BuyWeapon(5, 12, IID_WP_MOSSBERG); //weight, cost, item
|
||||
if (self.impulse == 4)
|
||||
|
@ -597,9 +601,11 @@ void() W_PlayerMenu =
|
|||
if (self.impulse == 6)
|
||||
BuyWeapon(4, 32, IID_WP_SA80); //weight, cost, item
|
||||
if (self.impulse == 7)
|
||||
BuyWeapon(7, 40, IID_WP_GAUSERIFLE); //weight, cost, item
|
||||
BuyWeapon(12, 45, IID_WP_PULSERIFLE); //weight, cost, item
|
||||
if (self.impulse == 8)
|
||||
BuyWeapon(10, 45, IID_WP_PULSERIFLE); //weight, cost, item
|
||||
BuyWeapon(7, 32, IID_WP_GAUSERIFLE); //weight, cost, item
|
||||
if (self.impulse == 9)
|
||||
BuyWeapon(9, 25, IID_WP_FNFAL); //weight, cost, item
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1073,7 +1073,7 @@ void() W_Attack =
|
|||
weap == IID_WP_VIBROBLADE ||
|
||||
weap == IID_WP_POWERAXE)
|
||||
{
|
||||
self.attack_finished = time + 0.25;
|
||||
self.attack_finished = time + 0.50;
|
||||
player_knife1 ();
|
||||
}
|
||||
else if (weap == IID_WP_USP)
|
||||
|
@ -1101,13 +1101,15 @@ void() W_Attack =
|
|||
else if (weap == IID_WP_AK112)
|
||||
FireAssaultRifle(14, 2, "weapons/ak112.wav", 4000, 0.09);
|
||||
else if (weap == IID_WP_AK74)
|
||||
FireAssaultRifle(18, 2, "weapons/ak47.wav", 6000, 0.1);
|
||||
FireAssaultRifle(18, 2, "weapons/ak47.wav", 4000, 0.1);
|
||||
else if (weap == IID_WP_DKS1)
|
||||
FireAssaultRifle(30, 2, "weapons/dks-1.wav", 8000, 0.5);
|
||||
FireAssaultRifle(24, 2, "weapons/dks-1.wav", 8000, 0.5);
|
||||
else if (weap == IID_WP_MOONLIGHT)
|
||||
FireAssaultRifle(16, 2, "weapons/m4-nw.wav", 4000, 0.09);
|
||||
FireAssaultRifle(14, 2, "weapons/m4-nw.wav", 4000, 0.09);
|
||||
else if (weap == IID_WP_SA80)
|
||||
FireAssaultRifle(17, 2, "weapons/sa80.wav", 4000, 0.08);
|
||||
else if (weap == IID_WP_FNFAL)
|
||||
FireAssaultRifle(12, 3, "weapons/fnfal.wav", 6000, 0.12);
|
||||
|
||||
//float IID_WP_GAUSERIFLE = 421;
|
||||
//float IID_WP_PULSERIFLE = 422;
|
||||
|
@ -2062,6 +2064,7 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol =
|
|||
if (trace_ent.solid == SOLID_BSP)
|
||||
SpawnWood (trace_ent, org, 1);
|
||||
|
||||
dam = dam + random()*dam;
|
||||
T_Damage (trace_ent, self, self, dam);
|
||||
|
||||
self.critical = 0;
|
||||
|
@ -2153,6 +2156,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG =
|
|||
if (trace_ent.solid == SOLID_BSP)
|
||||
SpawnWood (trace_ent, org, 1);
|
||||
|
||||
dam = dam + random()*dam;
|
||||
T_Damage (trace_ent, self, self, dam);
|
||||
self.critical = 0;
|
||||
|
||||
|
@ -2170,9 +2174,11 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG =
|
|||
|
||||
void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle =
|
||||
{
|
||||
local float hs, tmp, zdif, is_headshot, z;
|
||||
local float weap, hs, tmp, zdif, is_headshot, z;
|
||||
local vector dir, source, targ, org, adjust, headshot_check;
|
||||
|
||||
weap = ToIID(self.(SlotField(self.current_slot)));
|
||||
|
||||
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
|
||||
|
||||
self.attack_finished = (time + rate);
|
||||
|
@ -2271,7 +2277,12 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle
|
|||
if (trace_ent.solid == SOLID_BSP)
|
||||
SpawnWood (trace_ent, org, 1);
|
||||
|
||||
T_Damage (trace_ent, self, self, dam);
|
||||
dam = dam + random()*dam;
|
||||
|
||||
if (weap != IID_WP_DKS1 && weap != IID_WP_FNFAL)
|
||||
T_Damage (trace_ent, self, self, dam);
|
||||
else if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL)
|
||||
X_Damage (trace_ent, self, self, dam);
|
||||
self.critical = 0;
|
||||
|
||||
if (trace_ent.solid == SOLID_BSP)
|
||||
|
@ -3722,6 +3733,7 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 =
|
|||
|
||||
self.critical = 3;
|
||||
}
|
||||
|
||||
T_Damage (trace_ent, self, self, dam);
|
||||
self.critical = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue