Git Repos / fte_dogmode / qc / projectiles / zombiechunk.qc
Last update to this file was on 2025-08-13 at 05:20.
Show zombiechunk.qc
//==============================================================================
// Zombie grenade projectile
//==============================================================================
//======================================================================
// constants
//======================================================================
const float ZCHUNK_DIRECT_DAMAGE = 10; // direct damage; 10 is id1
// zombie chunks don't splash
const float ZCHUNK_SPEED = 600; // id1 default 600
const vector ZCHUNK_MINS = '0 0 0'; // let's not change this -- CEV
const vector ZCHUNK_MAXS = '0 0 0'; //
//======================================================================
// forward declarations
//======================================================================
// projectile_zombiechunk
void() projectile_zombiechunk_touch;
entity(entity src, vector org, vector vel) spawn_projectile_zombiechunk;
void(entity e) projectile_zombiechunk_init;
strip void() projectile_zombiechunk;
//------------------------------------------------------------------------------
//----------------------------------------------------------------------
// class projectile_zombiechunk: base_projectile
// {
//--------------------------------------------------------------
// ZombieGrenadeTouch
//--------------------------------------------------------------
void() projectile_zombiechunk_touch =
{
if (base_projectile_check_touch())
return;
if (other.takedamage)
{
// hardcoded 10 damage -- CEV
t_damage2 (other, self, self.owner, self.dmg);
SOUND (self, snd_zombie_hit)
remove (self);
return;
}
// bounce sound
SOUND (self, snd_zombie_miss)
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.touch = sub_remove;
};
//--------------------------------------------------------------
entity(entity src, vector org, vector vel)
spawn_projectile_zombiechunk =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
e.velocity = vel;
// damage
e.dmg = ZCHUNK_DIRECT_DAMAGE;
projectile_zombiechunk_init (e);
return e;
};
//--------------------------------------------------------------
void(entity e) projectile_zombiechunk_init =
{
base_projectile_init (e);
e.classname = "zgibs";
e.classtype = CT_PROJECTILE_ZOMBIECHUNK;
e.movetype = MOVETYPE_BOUNCE;
e.solid = SOLID_BBOX;
e.touch = projectile_zombiechunk_touch;
e.angles = vectoangles (e.velocity);
if (!e.avelocity)
e.avelocity = '3000 1000 2000';
if (!e.dmg)
e.dmg = ZCHUNK_DIRECT_DAMAGE;
setmodel (e, "progs/zom_gib.mdl");
e.skin = 0;
setsize (e, ZCHUNK_MINS, ZCHUNK_MAXS);
setorigin (e, e.origin);
// set missile duration
e.nextthink = time + 2.5;
e.think = sub_remove;
};
//--------------------------------------------------------------
strip void() projectile_zombiechunk =
{
projectile_zombiechunk_init (self);
};
// };
Return to the top of this page or return to the overview of this repo.
Log zombiechunk.qc
Date | Commit Message | Author | + | - |
---|---|---|---|---|
2025-08-13 | Another big commit. Item changes, field rework, etc. | cev | +6 | -12 |
2025-03-30 | Big commit. Entity networking, etc. | cev | +2 | -15 |
2024-06-15 | Major update, committing as-is, will have bugs | cev | +4 | -2 |
2024-04-05 | Player footsteps, shareware monsters, misc? | cev | +1 | |
2024-03-24 | 2nd pass refactor, rework QC class structure | cev | +77 | -34 |
2024-02-18 | Client/player, projectiles, entrypoints refactor | cev | +77 |
Return to the top of this page or return to the overview of this repo.