mirror of
https://git.code.sf.net/p/quake/prozac-qfcc
synced 2024-11-27 14:32:03 +00:00
- bugs, todo
- cleaned up some misc bugs in the hook, as well as formatting
This commit is contained in:
parent
6cc0a7f26c
commit
0b97684c96
5 changed files with 159 additions and 154 deletions
1
BUGS
1
BUGS
|
@ -26,3 +26,4 @@
|
|||
- multicast isn't called as often as it should be
|
||||
- nail grenades need a cap on their tempentity creation, in the range of 50 - 100
|
||||
- hover boots fuel usage should be affected by how fast you're moving, and you should go up faster when you're not moving. the "empty" penalty should be smaller.
|
||||
- taking over a tesla should set the colormap (?) to the new owner
|
||||
|
|
5
TODO
5
TODO
|
@ -33,4 +33,7 @@ o Make 50 frag (upgrade from frags? maybe not) teslas change color or do somet
|
|||
o Medikits should trigger buttons
|
||||
o Fix Sentry movement on platforms. (Make the top the only real entity, and the bottom one purely visual and adjusted to match it's position every frame)
|
||||
o MegaTF-style caltrops. (requested by Misty-chan)
|
||||
|
||||
o specs should have access to admin commands, ceasefire, and query
|
||||
o chance for detpack disarm/krak to set it off
|
||||
o random damage from detpacks
|
||||
o random timer too?
|
||||
|
|
109
hook.qc
109
hook.qc
|
@ -32,6 +32,7 @@ Morning Star. Depending on latency, performance should be near exact.
|
|||
|
||||
// prototypes for WEAPONS.QC functions
|
||||
float() crandom;
|
||||
void (entity base) Remove_Chain;
|
||||
|
||||
//
|
||||
// Reset_Grapple - Removes the hook and resets its owner's state.
|
||||
|
@ -40,11 +41,17 @@ float() crandom;
|
|||
void (entity rhook) Reset_Grapple =
|
||||
{
|
||||
sound (rhook.owner, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NONE);
|
||||
|
||||
if (rhook.goalentity) {
|
||||
Remove_Chain (rhook.goalentity);
|
||||
}
|
||||
|
||||
rhook.owner.on_hook = FALSE;
|
||||
rhook.owner.hook_out = FALSE;
|
||||
rhook.owner.fire_held_down = FALSE;
|
||||
rhook.owner.weaponframe = 0;
|
||||
rhook.owner.gravity = 1; // FIXME: interferes with other gravity stuff
|
||||
rhook.owner.hook = NIL;
|
||||
|
||||
rhook.think = SUB_Remove;
|
||||
rhook.nextthink = time;
|
||||
|
@ -60,28 +67,23 @@ void () Grapple_Track =
|
|||
{
|
||||
// drop the hook if owner is dead or has released the button
|
||||
if (!self.owner.on_hook || self.owner.health <= 0) {
|
||||
Reset_Grapple (self);
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.owner.health <= 0 || self.owner.has_disconnected) { //CH does a real check if dead
|
||||
self.think = SUB_Remove;
|
||||
self.nextthink = time;
|
||||
if (self.goalentity) {
|
||||
self.goalentity.think = SUB_Remove;
|
||||
self.goalentity.nextthink = time;
|
||||
if (self.goalentity.goalentity) {
|
||||
self.goalentity.goalentity.think = SUB_Remove;
|
||||
self.goalentity.goalentity.nextthink = time;
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reset_Grapple (self);
|
||||
|
||||
if (!self.enemy.solid) {
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
|
||||
//WK
|
||||
if (self.enemy.classname == "player" && Teammate(self.enemy.team_no, self.owner.team_no)) {
|
||||
Reset_Grapple (self);
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -89,7 +91,7 @@ void () Grapple_Track =
|
|||
if (self.enemy.classname == "player") {
|
||||
T_Damage (self.enemy, self, self.owner, 2);
|
||||
if (self.enemy.health <= 0) {
|
||||
Reset_Grapple (self);
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -129,22 +131,20 @@ entity () MakeLink =
|
|||
// to remove the chain. Only one function required to
|
||||
// remove all links.
|
||||
//
|
||||
void () Remove_Chain =
|
||||
void (entity base) Remove_Chain =
|
||||
{
|
||||
self.think = SUB_Remove;
|
||||
self.nextthink = time;
|
||||
|
||||
if (self.goalentity)
|
||||
{
|
||||
self.goalentity.think = SUB_Remove;
|
||||
self.goalentity.nextthink = time;
|
||||
|
||||
if (self.goalentity.goalentity)
|
||||
{
|
||||
self.goalentity.goalentity.think = SUB_Remove;
|
||||
self.goalentity.goalentity.nextthink = time;
|
||||
base.think = SUB_Remove;
|
||||
base.nextthink = time;
|
||||
if (base.goalentity) {
|
||||
base.goalentity.think = SUB_Remove;
|
||||
base.goalentity.nextthink = time;
|
||||
if (base.goalentity.goalentity) {
|
||||
base.goalentity.goalentity.think = SUB_Remove;
|
||||
base.goalentity.goalentity.nextthink = time;
|
||||
}
|
||||
}
|
||||
|
||||
base.owner.hook.goalentity = NIL;
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -158,32 +158,23 @@ void () Update_Chain =
|
|||
|
||||
if (!self.owner.hook_out)
|
||||
{
|
||||
self.think = Remove_Chain;
|
||||
self.nextthink = time;
|
||||
// Remove_Chain (self);
|
||||
return;
|
||||
}
|
||||
|
||||
if (vlen(self.origin - self.owner.origin) >= 3000)
|
||||
{
|
||||
Reset_Grapple (self);
|
||||
return;
|
||||
}
|
||||
//CH Using a show grapple loc thing, it was updating while dead.
|
||||
if (self.owner.health <= 0 || self.owner.has_disconnected)
|
||||
{
|
||||
self.think = SUB_Remove;
|
||||
self.nextthink = time;
|
||||
if (self.goalentity)
|
||||
{
|
||||
self.goalentity.think = SUB_Remove;
|
||||
self.goalentity.nextthink = time;
|
||||
if (self.goalentity.goalentity)
|
||||
{
|
||||
self.goalentity.goalentity.think = SUB_Remove;
|
||||
self.goalentity.goalentity.nextthink = time;
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reset_Grapple (self);
|
||||
|
||||
// reset if it gets insane
|
||||
if (vlen (self.origin - self.owner.origin) >= 3000) {
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
} else if (!self.owner.on_hook && vlen (self.owner.hook.velocity) < 10) {
|
||||
Reset_Grapple (self.owner.hook);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -194,6 +185,9 @@ void () Update_Chain =
|
|||
setorigin (self, self.owner.origin + temp * 0.25);
|
||||
setorigin (self.goalentity, self.owner.origin + temp * 0.5);
|
||||
setorigin (self.goalentity.goalentity, self.owner.origin + temp * 0.75);
|
||||
self.velocity = '0 0 0';
|
||||
self.goalentity.velocity = '0 0 0';
|
||||
self.goalentity.goalentity.velocity = '0 0 0';
|
||||
|
||||
self.nextthink = time + 0.1;
|
||||
};
|
||||
|
@ -209,7 +203,10 @@ void () Build_Chain =
|
|||
self.goalentity.owner = self.owner;
|
||||
|
||||
self.goalentity.goalentity = MakeLink();
|
||||
self.goalentity.goalentity.owner = self.owner;
|
||||
|
||||
self.goalentity.goalentity.goalentity = MakeLink();
|
||||
self.goalentity.goalentity.goalentity.owner = self.owner;
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -278,7 +275,12 @@ void () Anchor_Grapple =
|
|||
// if you create new types of projectiles, make sure you use one of the
|
||||
// classnames below or write code to exclude your new classname so
|
||||
// grapples will not stick to them.
|
||||
if (other.classname == "missile" || other.classname == "grenade" || other.classname == "spike" || other.classname == "hook" || other.classname == "pipebomb") //CH maybe fix crash?
|
||||
if (other.classname == "missile"
|
||||
|| other.classname == "grenade"
|
||||
|| other.classname == "spike"
|
||||
|| other.classname == "hook"
|
||||
|| other.classname == "pipebomb"
|
||||
|| other.classname == "force_field") //CH maybe fix crash?
|
||||
return;
|
||||
|
||||
//if (isBuilding(other)) //WK don't hook onto buildings?
|
||||
|
@ -396,14 +398,15 @@ void () Service_Grapple =
|
|||
{
|
||||
self.fire_held_down = FALSE;
|
||||
|
||||
if (self.current_weapon == WEAP_HOOK)
|
||||
if (self.current_weapon == WEAP_HOOK) {
|
||||
Reset_Grapple (self.hook);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// If hooked to a player, track them directly!
|
||||
if (self.hook.enemy.classname == "player")
|
||||
hook_dir = (self.hook.enemy.origin - self.origin);
|
||||
// else, track to hook
|
||||
else
|
||||
else // else, track to hook
|
||||
hook_dir = (self.hook.origin - self.origin);
|
||||
|
||||
// set the facing of the grapple
|
||||
|
@ -411,15 +414,13 @@ void () Service_Grapple =
|
|||
|
||||
self.velocity = normalize(hook_dir) * self.maxspeed * 1.5;
|
||||
|
||||
if ( vlen(hook_dir) <= 100 && self.lefty) // cancel chain sound
|
||||
if (vlen(hook_dir) <= 100 && self.lefty) // cancel chain sound
|
||||
{
|
||||
// If there is a chain, ditch it now. We're
|
||||
// close enough. Having extra entities lying around
|
||||
// is never a good idea.
|
||||
if (self.hook.goalentity)
|
||||
{
|
||||
self.hook.goalentity.think = Remove_Chain;
|
||||
self.hook.goalentity.nextthink = time;
|
||||
if (self.hook.goalentity) {
|
||||
Remove_Chain (self.hook.goalentity);
|
||||
}
|
||||
|
||||
self.lefty = FALSE; // we've reset the sound channel.
|
||||
|
|
|
@ -1262,7 +1262,7 @@ void() PlayerDie =
|
|||
{
|
||||
Reset_Grapple (self.hook);
|
||||
Attack_Finished(0.75);
|
||||
self.hook_out = TRUE; // PutClientInServer will reset this
|
||||
// self.hook_out = TRUE; // PutClientInServer will reset this
|
||||
}
|
||||
self.items = self.items & ~(IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
|
||||
self.invisible_finished = 0; // don't die as eyes
|
||||
|
|
2
spy.qc
2
spy.qc
|
@ -343,7 +343,7 @@ void(float type) TeamFortress_SpyFeignDeath =
|
|||
{
|
||||
Reset_Grapple (self.hook);
|
||||
Attack_Finished(0.75);
|
||||
self.hook_out = TRUE; // PutClientInServer will reset this
|
||||
// self.hook_out = TRUE; // PutClientInServer will reset this
|
||||
}
|
||||
|
||||
if (self.undercover_team == 0 && self.undercover_skin == 0)
|
||||
|
|
Loading…
Reference in a new issue