- couple bugfixes related to assault cannons

- cleanup of FireBullets and friends
- changed how damage is handled with assault cannon.  probably alot
  more powerful now
This commit is contained in:
Adam Olsen 2001-09-26 03:59:53 +00:00
parent 747b0a4760
commit 14651ae7ef
6 changed files with 63 additions and 70 deletions

1
BUGS
View file

@ -12,3 +12,4 @@
- intercepting your sentry when it turrets kills you, but stops the sentry - intercepting your sentry when it turrets kills you, but stops the sentry
- if you judo an assault cannon your speed isn't restored when it's returned - if you judo an assault cannon your speed isn't restored when it's returned
- I've been told that if you're a thief and you start setting a detpack you won't get revealed until it's finished - I've been told that if you're a thief and you start setting a detpack you won't get revealed until it's finished
- sentries/teslas should check their pointcontents every frame, and blow up if they're out of the map

View file

@ -581,6 +581,8 @@ float (float desc, string buf) cfwrite = #106;
float (float desc) cfeof = #107; float (float desc) cfeof = #107;
float () cfquota = #108; float () cfquota = #108;
string (...) sprintf = #109;
//============================================================================ //============================================================================
// //

View file

@ -661,7 +661,7 @@ void() JobJudoka =
oself = self; oself = self;
self = trace_ent; self = trace_ent;
stuffcmd(self, "-attack;v_idlescale 0\n"); stuffcmd(self, "-attack;v_idlescale 0\n");
self.tfstate = self.tfstate - (self.tfstate & TFSTATE_CANT_MOVE); self.tfstate = self.tfstate - (self.tfstate & TFSTATE_ASSAULTCANNON);
TeamFortress_SetSpeed(self); TeamFortress_SetSpeed(self);
self.weaponframe = 0; self.weaponframe = 0;
self.count = 1; self.count = 1;

1
spy.qc
View file

@ -324,6 +324,7 @@ void(float type) TeamFortress_SpyFeignDeath =
if (at_spot.classname == "player" && self != at_spot && at_spot.is_feigning == TRUE) if (at_spot.classname == "player" && self != at_spot && at_spot.is_feigning == TRUE)
{ {
sprint(self, PRINT_HIGH, "You can't feign on top of another spy!\n"); sprint(self, PRINT_HIGH, "You can't feign on top of another spy!\n");
return;
} }
at_spot = at_spot.chain; at_spot = at_spot.chain;

View file

@ -1118,26 +1118,25 @@ void(entity hit, float damage) AddMultiDamage =
multi_damage = multi_damage + damage; multi_damage = multi_damage + damage;
}; };
void() Multi_Finish = void (integer big) Multi_Finish =
{ {
/* WK Save spam SB ok, you save spam*/ /* WK Save spam SB ok, you save spam*/
if (puff_count) if (puff_count)
{ {
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_GUNSHOT); WriteByte (MSG_MULTICAST, TE_GUNSHOT);
WriteByte (MSG_MULTICAST, puff_count); WriteByte (MSG_MULTICAST, big ? puff_count * 2 : puff_count);
WriteCoord (MSG_MULTICAST, puff_org_x); WriteCoord (MSG_MULTICAST, puff_org_x);
WriteCoord (MSG_MULTICAST, puff_org_y); WriteCoord (MSG_MULTICAST, puff_org_y);
WriteCoord (MSG_MULTICAST, puff_org_z); WriteCoord (MSG_MULTICAST, puff_org_z);
multicast (puff_org, MULTICAST_PVS); multicast (puff_org, MULTICAST_PVS);
} }
if (blood_count) if (blood_count)
{ {
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_BLOOD); WriteByte (MSG_MULTICAST, TE_BLOOD);
WriteByte (MSG_MULTICAST, blood_count); WriteByte (MSG_MULTICAST, big ? blood_count * 2 : puff_count);
WriteCoord (MSG_MULTICAST, blood_org_x); WriteCoord (MSG_MULTICAST, blood_org_x);
WriteCoord (MSG_MULTICAST, blood_org_y); WriteCoord (MSG_MULTICAST, blood_org_y);
WriteCoord (MSG_MULTICAST, blood_org_z); WriteCoord (MSG_MULTICAST, blood_org_z);
@ -1158,40 +1157,33 @@ BULLETS
TraceAttack TraceAttack
================ ================
*/ */
void(float damage, vector dir) TraceAttack = void (float damage, vector dir) TraceAttack =
{ {
local vector vel, org; local vector vel, org;
vel = normalize(dir + v_up*crandom() + v_right*crandom()); vel = normalize (dir + v_up * crandom() + v_right * crandom());
vel = vel + 2*trace_plane_normal; vel = vel + 2 * trace_plane_normal;
vel = vel * 200; vel = vel * 200;
org = trace_endpos - dir*4; org = trace_endpos - dir * 4;
//WK Sweep mines at the end of the attack //WK Sweep mines at the end of the attack
GuerillaMineSweep(trace_endpos); GuerillaMineSweep (trace_endpos);
if (trace_ent.takedamage) if (damage && trace_ent.takedamage) {
{
blood_count = blood_count + 1;
blood_org = org; blood_org = org;
blood_count++;
AddMultiDamage (trace_ent, damage); AddMultiDamage (trace_ent, damage);
} } else {
else puff_org = org;
{ puff_count++;
if (trace_ent.classname == "force_field") //- OfN - Makes field explosion b4 removing it
{ if (trace_ent.classname == "force_field") { //- OfN - Makes field explosion b4 removing it
FieldExplosion(trace_ent,trace_endpos,trace_ent); FieldExplosion(trace_ent,trace_endpos,trace_ent);
PutFieldWork(trace_ent); PutFieldWork(trace_ent);
} }
else
{
//multicast (trace_endpos, MULTICAST_PVS);
puff_count = puff_count + 1;
} }
}
}; };
/* /*
@ -1207,48 +1199,38 @@ void(float shotcount, vector dir, vector spread) FireBullets =
local vector direction; local vector direction;
local vector src; local vector src;
makevectors(self.v_angle); // makevectors (self.v_angle); // umm, shouldn't this be dir?
makevectors (dir);
src = self.origin + v_forward*10; src = self.origin + v_forward * 10;
src_z = self.absmin_z + self.size_z * 0.7; src_z = self.absmin_z + self.size_z * 0.7;
ClearMultiDamage (); ClearMultiDamage ();
if (self.current_weapon & WEAP_ASSAULT_CANNON)
{
direction = dir;
direction += (crandom() + crandom()) * 0.08 * v_right;
direction += (crandom() + crandom()) * 0.05 * v_up;
traceline (src, src + direction*2048, FALSE, self); //WK 2048
}
else
traceline (src, src + dir * 1024, FALSE, self); //WK 2048
puff_org = trace_endpos - dir * 4;
puff_count = shotcount;
while (shotcount > 0) while (shotcount > 0)
{ {
direction = dir + crandom() * spread_x * v_right + crandom() * spread_y * v_up; direction = dir;
direction += AVG (crandom(), crandom()) * spread_x * v_right;
direction += AVG (crandom(), crandom()) * spread_y * v_up;
if (self.current_weapon & WEAP_ASSAULT_CANNON) if (self.current_weapon & WEAP_ASSAULT_CANNON)
traceline (src, src + direction * 2048, FALSE, self); //WK 2048 traceline (src, src + direction * 2048, FALSE, self); //WK 2048
else else
traceline (src, src + direction * 1024, FALSE, self); //WK 2048 traceline (src, src + direction * 2024, FALSE, self); //WK 2048A
if (trace_fraction != 1.0)
{ if (trace_fraction == 1.0)
if (self.current_weapon & WEAP_ASSAULT_CANNON) //WK Sinth's bugfix TraceAttack (0, direction);
else if (self.current_weapon & WEAP_ASSAULT_CANNON) //WK Sinth's bugfix
TraceAttack (5, direction); //WK(12) (6) Reversed from 2.5 TraceAttack (5, direction); //WK(12) (6) Reversed from 2.5
else if (self.current_weapon & WEAP_LIGHT_ASSAULT) else if (self.current_weapon & WEAP_LIGHT_ASSAULT)
{
TraceAttack (4, direction); TraceAttack (4, direction);
}
else else
TraceAttack (6, direction); //WK 4 TraceAttack (6, direction); //WK 4
}
shotcount = shotcount - 1; shotcount--;
} }
ApplyMultiDamage (); ApplyMultiDamage ();
Multi_Finish (); Multi_Finish (TRUE);
}; };
/* /*
@ -1275,7 +1257,7 @@ void() W_FireShotgun =
} }
deathmsg = DMSG_SHOTGUN; deathmsg = DMSG_SHOTGUN;
FireBullets (6, dir, '0.04 0.04 0'); FireBullets (6, dir, '0.02 0.02 0');
}; };
@ -1308,7 +1290,7 @@ void() W_FireSuperShotgun =
dir = normalize (dir - self.origin); dir = normalize (dir - self.origin);
} }
deathmsg = DMSG_SSHOTGUN; deathmsg = DMSG_SSHOTGUN;
FireBullets (12, dir, '0.19 0.10 0'); //WK 14, 0.14, 0.08 FireBullets (12, dir, '0.05 0.05 0'); //WK 14, 0.14, 0.08
}; };
@ -1322,19 +1304,22 @@ void(vector direction, float damage) FireSniperBullet =
{ {
local vector src; local vector src;
makevectors(self.v_angle); makevectors (self.v_angle);
src = self.origin + v_forward*10; src = self.origin + v_forward * 10;
src_z = self.absmin_z + self.size_z * 0.7; src_z = self.absmin_z + self.size_z * 0.7;
ClearMultiDamage (); ClearMultiDamage ();
traceline (src, src + direction*4096, FALSE, self); traceline (src, src + direction * 4096, FALSE, self);
if (trace_fraction != 1.0) if (trace_fraction == 1.0)
TraceAttack (0, direction);
else
TraceAttack (damage, direction); TraceAttack (damage, direction);
ApplyMultiDamage (); ApplyMultiDamage ();
Multi_Finish (FALSE);
}; };
@ -1485,11 +1470,13 @@ void() W_FireSniperRifle =
ClearMultiDamage (); ClearMultiDamage ();
if (trace_fraction != 1.0) // if it hit something if (trace_fraction == 1.0)
TraceAttack (0, dir);
else // if it hit something
TraceAttack (self.heat * dam_mult, dir); TraceAttack (self.heat * dam_mult, dir);
ApplyMultiDamage (); ApplyMultiDamage ();
Multi_Finish (FALSE);
}; };
/* /*
@ -1532,8 +1519,8 @@ void() W_FireAssaultCannon =
//We want more of a cone of fire... //We want more of a cone of fire...
// FireBullets (5, dir, '0.2 0.1 0'); // FireBullets (5, dir, '0.2 0.1 0');
// FireBullets (5, dir, '0.4 0.1 0'); // FireBullets (5, dir, '0.4 0.1 0');
FireBullets (7, dir, '0.15 0.1 0'); FireBullets (7, dir, '0.16 0.12 0');
FireBullets (3, dir, '0.3 0.1 0'); FireBullets (3, dir, '0.12 0.09 0');
}; };
/* /*
@ -1565,7 +1552,7 @@ void() W_FireLightAssault =
self.reload_light_assault = self.reload_light_assault + 1; self.reload_light_assault = self.reload_light_assault + 1;
if (CheckForReload() == TRUE) return; if (CheckForReload() == TRUE) return;
FireBullets (5, dir, '0.2 0.1 0'); FireBullets (5, dir, '0.1 0.05 0');
Attack_Finished(0.2); Attack_Finished(0.2);
}; };
@ -3220,6 +3207,7 @@ void() W_Attack =
if (self.ammo_cells < 4) if (self.ammo_cells < 4)
{ {
sprint (self, PRINT_MEDIUM, "Insufficient cells to power up the Assault Cannon.\n"); sprint (self, PRINT_MEDIUM, "Insufficient cells to power up the Assault Cannon.\n");
stuffcmd (self, "-attack;\n"); // to avoid flooding
} }
else else
{ {
@ -4712,6 +4700,7 @@ void() W_WeaponFrame =
else else
{ {
sprint(self, PRINT_MEDIUM, "You cannot fire the assault cannon without\nyour feet on the ground...\n"); sprint(self, PRINT_MEDIUM, "You cannot fire the assault cannon without\nyour feet on the ground...\n");
stuffcmd (self, "-attack;\n"); // so that they don't get flooded
} }
} }
else else

View file

@ -574,6 +574,7 @@ void() bodyque =
// creates bodyques // creates bodyques
}; };
void() InitBodyQue = void() InitBodyQue =
{ {
bodyque_head = spawn(); bodyque_head = spawn();
@ -587,7 +588,6 @@ void() InitBodyQue =
bodyque_head.owner.owner.owner.owner = bodyque_head; bodyque_head.owner.owner.owner.owner = bodyque_head;
}; };
// make a body que entry for the given ent so the ent can be // make a body que entry for the given ent so the ent can be
// respawned elsewhere // respawned elsewhere
void(entity ent) CopyToBodyQue = void(entity ent) CopyToBodyQue =