*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1859 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Magnus 2006-01-13 03:41:57 +00:00
parent 232c7fbc15
commit 4e1e456ad0
5 changed files with 38 additions and 18 deletions

View file

@ -182,7 +182,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
return; return;
} }
if (random()*4<=1)
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
// save damage based on the target's armor level // save damage based on the target's armor level

View file

@ -276,7 +276,7 @@ float (entity to, float iid, float quant) TryGiveStackable =
local float slot; local float slot;
local float item; local float item;
slot = SlotOfItem(to, iid); slot = SlotOfItem(to, iid);
if (slot != 0) if (slot > 2)
{ {
item = ItemInSlot(to, slot); item = ItemInSlot(to, slot);
if (ToStatus(item) + quant > 100) //100 is our maxstack value here if (ToStatus(item) + quant > 100) //100 is our maxstack value here

View file

@ -42,7 +42,7 @@ void(float cost, float iid) BuyStackable =
//put grenade in inventory //put grenade in inventory
//finds existing grenades, otherwise, empty slot //finds existing grenades, otherwise, empty slot
AddStackable(self, iid, 1); TryGiveStackable(self, iid, 1);
}; };
void() BuyBandages = void() BuyBandages =
@ -118,7 +118,7 @@ void(float cost, float type) BuyChem =
chemname = GetItemName(type); chemname = GetItemName(type);
sprint(self, PRINT_HIGH, chemname); sprint(self, PRINT_HIGH, chemname);
sprint(self, PRINT_HIGH, " purchased.\n"); sprint(self, PRINT_HIGH, " purchased.\n");
AddStackable(self, type, 1); TryGiveStackable(self, type, 1);
}; };
void(string type) ChangeAmmo = void(string type) ChangeAmmo =
@ -183,7 +183,7 @@ void (float wt, float cost, float wid) BuyWeapon =
ammotype = WeaponAmmoType(wid);//load weapon with full ammo (may be changed) ammotype = WeaponAmmoType(wid);//load weapon with full ammo (may be changed)
AddStackable(self, ammotype, ammocount*3); TryGiveStackable(self, ammotype, ammocount*3);
SetWeaponModel(); SetWeaponModel();
}; };

View file

@ -145,7 +145,7 @@ void () player_climb = [ 23, player_run ]
void () player_run = [ 137, player_run ] void () player_run = [ 137, player_run ]
{ {
if (self.rtime < time && self.attack == 0) if (self.rtime < time)
self.weaponframe = 0; self.weaponframe = 0;
if (self.equipment_slot) if (self.equipment_slot)

View file

@ -968,6 +968,10 @@ void (float slotno) ReloadWeapon =
ac = ToStatus(asv); ac = ToStatus(asv);
x = WeaponMagQuant(wid); //get the max ammo capacity x = WeaponMagQuant(wid); //get the max ammo capacity
if (ToStatus(self.wslot) == x) //weapon full already
return;
x = x - ToStatus(self.wslot); //take away the ammo currently in the weapon x = x - ToStatus(self.wslot); //take away the ammo currently in the weapon
if (x > ac) //make sure there's enough ammo if (x > ac) //make sure there's enough ammo
x = ac; x = ac;
@ -982,8 +986,16 @@ void (float slotno) ReloadWeapon =
self.wslot = SlotVal(wid, x + ToStatus(self.wslot)); self.wslot = SlotVal(wid, x + ToStatus(self.wslot));
if (wid == IID_WP_PIPERIFLE || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_PIPERIFLE || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG)
{
sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM);
self.attack_finished = time + 1;
self.rtime = time + 1;
if (self.current_slot == slotno)
self.currentammo = ToStatus(ItemInSlot(self, slotno));
return;
}
else else
sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM);
@ -1093,9 +1105,9 @@ void() W_Attack =
else if (weap == IID_WP_JACKHAMMER) else if (weap == IID_WP_JACKHAMMER)
W_FireShotgun (1, 5, 6, 160, 3000, 1); W_FireShotgun (1, 5, 6, 160, 3000, 1);
else if (weap == IID_WP_MP9) else if (weap == IID_WP_MP9)
FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.06); FireSMG(12, 2, "weapons/burst.wav", 2000, 0.09);
else if (weap == IID_WP_MP7) else if (weap == IID_WP_MP7)
FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.06); FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.09);
else if (weap == IID_WP_RANGEMASTER) else if (weap == IID_WP_RANGEMASTER)
FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.5); FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.5);
else if (weap == IID_WP_AK112) else if (weap == IID_WP_AK112)
@ -1993,7 +2005,7 @@ void(float slot, float magazine) GiveAmmo =
void (float dam, float rec, string snd, float rng, float rate) FirePistol = void (float dam, float rec, string snd, float rng, float rate) FirePistol =
{ {
local float weap, tmp, zdif, xdif, ydif, is_headshot; local float weap, tmp, zdif, xdif, ydif, is_headshot;
local vector dir, source, targ, org, org2, adjust; local vector dir, source, targ, org, org2, org3, adjust;
weap = ToIID(self.(SlotField(self.current_slot))); weap = ToIID(self.(SlotField(self.current_slot)));
@ -2002,9 +2014,9 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol =
self.attack_finished = (time + rate); self.attack_finished = (time + rate);
if (self.attack == 0 && self.position == POS_STAND) if (self.position == POS_STAND)
player_single1 (); player_single1 ();
if (self.attack == 0 && self.position >= POS_DUCK) if (self.position >= POS_DUCK)
player_single1_s (); player_single1_s ();
if (self.position == 0) if (self.position == 0)
@ -2045,6 +2057,8 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol =
if (trace_fraction == 1) if (trace_fraction == 1)
return; return;
org3 = self.origin + v_forward*32 + '0 0 22';
org = trace_endpos - v_forward * 1; org = trace_endpos - v_forward * 1;
org2 = trace_endpos + (v_forward * ((trace_ent.size_y / 2) + (trace_ent.size_x / 2))); org2 = trace_endpos + (v_forward * ((trace_ent.size_y / 2) + (trace_ent.size_x / 2)));
if (trace_ent.takedamage) if (trace_ent.takedamage)
@ -2078,26 +2092,32 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol =
T_Damage (trace_ent, self, self, dam); T_Damage (trace_ent, self, self, dam);
self.critical = 0; self.critical = 0;
if (trace_ent.solid == SOLID_BSP)
penetrate (org, (dam / 2), (dam / 2));
} }
else else
{ {
bullet_hole (org); bullet_hole (org);
dir = vectoangles (source - targ); dir = vectoangles (source - targ);
penetrate (org, (dam / 2), (dam / 2));
return; return;
} }
}; };
void (float dam, float rec, string snd, float rng, float rate) FireSMG = void (float dam, float rec, string snd, float rng, float rate) FireSMG =
{ {
local float tmp, zdif, xdif, ydif, is_headshot; local float weap, tmp, zdif, xdif, ydif, is_headshot;
local vector dir, source, targ, org, org2, adjust; local vector dir, source, targ, org, org2, adjust;
weap = ToIID(self.(SlotField(self.current_slot)));
if (weap != IID_WP_MP9)
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
if (weap == IID_WP_MP9 && self.attack == 0)
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
if (weap == IID_WP_MP9 && self.attack == 6)
{
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
self.attack = 1;
}
sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
self.attack_finished = (time + rate); self.attack_finished = (time + rate);
@ -3749,6 +3769,7 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 =
self.critical = 3; self.critical = 3;
} }
dam = dam + random()*dam;
T_Damage (trace_ent, self, self, dam); T_Damage (trace_ent, self, self, dam);
self.critical = 0; self.critical = 0;
} }