mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-31 05:30:56 +00:00
SERVER: Basic support for trigger_setfire
This commit is contained in:
parent
997d6748e9
commit
3ea3d20e67
5 changed files with 39 additions and 4 deletions
|
@ -447,11 +447,8 @@ void() Zombie_Think = //called every frame for zombies
|
|||
DamageHandler(self, self.firer, 300, S_NORMAL);
|
||||
self.ltime = time + 2;
|
||||
|
||||
self.spins++;
|
||||
if (self.spins >= 5) {
|
||||
self.spins = 0;
|
||||
if (self.fire_timeout < time)
|
||||
self.onfire = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1096,6 +1093,7 @@ void() removeZombie =
|
|||
self.outside = TRUE;
|
||||
self.hop_step = 0;
|
||||
self.onfire = false;
|
||||
self.fire_timeout = 0;
|
||||
self.calc_time = 0;
|
||||
self.tries = 0;
|
||||
self.takedamage = DAMAGE_NO;
|
||||
|
|
|
@ -259,6 +259,7 @@ void() SUB_Null2 = {};
|
|||
vector trace_plane_normal;
|
||||
|
||||
.float dmg;
|
||||
.float fire_timeout;
|
||||
|
||||
//
|
||||
// AI definitions
|
||||
|
|
|
@ -367,6 +367,29 @@ void() trigger_atroundend =
|
|||
//self.use = multi_use;
|
||||
}
|
||||
|
||||
#define SPAWNFLAG_TRIGGERFIRE_PLAYER 1
|
||||
#define SPAWNFLAG_TRIGGERFIRE_NODAMAGE 2
|
||||
#define SPAWNFLAG_TRIGGERFIRE_HEALTHNERF 4
|
||||
|
||||
void() trigger_setfire_touch =
|
||||
{
|
||||
if (other.aistatus != "1" && (other.classname == "player" && !(self.spawnflags & SPAWNFLAG_TRIGGERFIRE_PLAYER)))
|
||||
return;
|
||||
|
||||
other.onfire = true;
|
||||
other.fire_timeout = time + self.fire_timeout;
|
||||
|
||||
if ((self.spawnflags & SPAWNFLAG_TRIGGERFIRE_NODAMAGE) && other.aistatus == "1")
|
||||
other.ltime = time + 10000;
|
||||
}
|
||||
|
||||
void() trigger_setfire =
|
||||
{
|
||||
InitTrigger ();
|
||||
self.spawnflags = 3;
|
||||
self.touch = trigger_setfire_touch;
|
||||
}
|
||||
|
||||
//
|
||||
// Quake Triggers
|
||||
//
|
||||
|
|
|
@ -438,6 +438,14 @@ void() PlayerPreThink =
|
|||
|
||||
JumpCheck(0);
|
||||
|
||||
// Fire effect
|
||||
if (self.onfire) {
|
||||
Effect_Fire(self.origin);
|
||||
|
||||
if (self.fire_timeout < time)
|
||||
self.onfire = false;
|
||||
}
|
||||
|
||||
// refuel/cool flamethrowers
|
||||
if (self.ltime < time) {
|
||||
// FIXME: Weapon hardcode definition.
|
||||
|
@ -758,6 +766,9 @@ void() PlayerSpawn =
|
|||
self.classname = "player";
|
||||
self.solid = SOLID_BBOX;
|
||||
|
||||
self.onfire = false;
|
||||
self.fire_timeout = 0;
|
||||
|
||||
// We can only collide with zombies (and not their limbs)
|
||||
|
||||
#ifdef FTE
|
||||
|
|
|
@ -73,11 +73,13 @@ void() Flame_Touch =
|
|||
|| 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue