mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-25 05:11:05 +00:00
SERVER: Clean up Flamethrower Logic
Streamlines Flamethrower contact code to be faster/simpler as well as do some damage so Insta-Kill activates on time.
This commit is contained in:
parent
aaca254c03
commit
bc2aec1a96
4 changed files with 51 additions and 26 deletions
|
@ -400,7 +400,7 @@ void() Zombie_Think = //called every frame for zombies
|
|||
Effect_Fire(self.origin);
|
||||
|
||||
if (self.ltime < time && self.onfire){
|
||||
DamageHandler(self, self.firer, 300, S_NORMAL);
|
||||
DamageHandler(self, self.firer, 300, S_FLAME);
|
||||
self.ltime = time + 2;
|
||||
|
||||
if (self.fire_timeout < time)
|
||||
|
|
|
@ -426,16 +426,27 @@ void(entity attacker, float d_style) DieHandler =
|
|||
|
||||
if (attacker.classname == "player") {
|
||||
attacker.kills++;
|
||||
if (d_style == S_HEADSHOT) {
|
||||
addmoney(attacker, 100, true);
|
||||
attacker.headshots++;
|
||||
} else if (d_style == S_NORMAL) {
|
||||
addmoney(attacker, 60, true);
|
||||
}
|
||||
else if (d_style == S_KNIFE){
|
||||
addmoney(attacker, 130, true);
|
||||
} else if (d_style == S_TESLA) {
|
||||
addmoney(attacker, 50, true);
|
||||
|
||||
switch(d_style) {
|
||||
case S_HEADSHOT:
|
||||
addmoney(attacker, 100, true);
|
||||
attacker.headshots++;
|
||||
break;
|
||||
case S_KNIFE:
|
||||
addmoney(attacker, 130, true);
|
||||
break;
|
||||
case S_TESLA:
|
||||
addmoney(attacker, 50, true);
|
||||
break;
|
||||
case S_FLAME:
|
||||
addmoney(attacker, 50, true);
|
||||
|
||||
// override their death sound (FIXME: make a new sound..)
|
||||
sound(self, CHAN_BODY, "sounds/pu/drop.wav", 1, ATTN_NORM);
|
||||
break;
|
||||
default:
|
||||
addmoney(attacker, 60, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,25 +63,38 @@ void(vector org, entity whodunit) Flame_Linger =
|
|||
//
|
||||
void() Flame_Touch =
|
||||
{
|
||||
if (other == world) {
|
||||
entity target = other;
|
||||
|
||||
// Flame hit a BSP object, so persist/linger to wait for a catch.
|
||||
if (target == world) {
|
||||
Flame_Linger(self.origin, self);
|
||||
remove(self);
|
||||
} else {
|
||||
if (other.onfire || other.owner.onfire)
|
||||
}
|
||||
// Some other entity
|
||||
else {
|
||||
// Only impact monsters (this also serves as a limb skip :D)
|
||||
if (!(target.flags & FL_MONSTER))
|
||||
return;
|
||||
if (other.classname == "ai_zombie_head" || other.classname == "ai_zombie_larm"
|
||||
|| other.classname == "ai_zombie_rarm") {
|
||||
other.owner.onfire = true;
|
||||
other.owner.ltime = time + 2;
|
||||
other.owner.fire_timeout = time + 10;
|
||||
addmoney(self.owner, 10, true);
|
||||
} else if (other.classname == "ai_zombie" || other.classname == "ai_dog") {
|
||||
other.onfire = true;
|
||||
other.firer = self.owner;
|
||||
other.ltime = time + 2;
|
||||
other.fire_timeout = time + 10;
|
||||
addmoney(self.owner, 10, true);
|
||||
|
||||
// Guard this stuff behind first-light
|
||||
if (!target.onfire) {
|
||||
// They're ours
|
||||
target.firer = self.owner;
|
||||
|
||||
// Initialize next-light (this is done to make sure we arent
|
||||
// doing intense fire damage right away)
|
||||
target.ltime = time + 2;
|
||||
|
||||
// Start the Fire Effect
|
||||
Effect_Fire(target.origin);
|
||||
|
||||
// Only do 1 damage to trigger insta-kill damage.
|
||||
DamageHandler(target, target.firer, 1, S_FLAME);
|
||||
}
|
||||
|
||||
// Set the monster alight
|
||||
target.onfire = true;
|
||||
target.fire_timeout = time + 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -268,6 +268,7 @@ float map_compatibility_mode;
|
|||
#define S_EXPLOSIVE 5
|
||||
#define S_ZAPPER 6
|
||||
#define S_TESLA 7
|
||||
#define S_FLAME 8
|
||||
|
||||
//Perk types
|
||||
#define P_JUG 1
|
||||
|
|
Loading…
Reference in a new issue