djcev.com

//

Git Repos / fte_dogmode / qc / projectiles / lavaball.qc

Last update to this file was on 2024-06-15 at 19:50.

Show lavaball.qc

//==============================================================================
// Chthon Lavaball
//==============================================================================

//======================================================================
// constants
//======================================================================
const float LAVABALL_DIRECT_DAMAGE = 100;// direct damage; 100 is id1
const float LAVABALL_SPLASH_DAMAGE = 120;// splash damage; 120 is id1
const float LAVABALL_SPEED = 300; // id1 Chthon fires at 300ups
const float LAVABALL_HEALTH = 100; // much more difficult to destroy

// found using FTE's sv_gameplayfix_setmodelrealbox
// const vector LAVABALL_MINS = '-4.06976 -7.56844 -3.0414';
// const vector LAVABALL_MAXS = '9.56484 7.31226 13.5418';
const vector LAVABALL_MINS = '-7 -7 -8';// slightly more generous mins & maxs
const vector LAVABALL_MAXS = '7 7 8';

//======================================================================
// forward declarations
//======================================================================

// projectile_lavaball
void(vector dir) projectile_lavaball_destroy;
entity(entity src, vector org, vector vel) spawn_projectile_lavaball;
void(entity e) projectile_lavaball_init;
strip void() projectile_lavaball;

//------------------------------------------------------------------------------

//----------------------------------------------------------------------
// class projectile_lavaball: base_projectile
// {
//--------------------------------------------------------------
void(vector dir) projectile_lavaball_destroy =
{
if (self.aflag & PROJECTILE_DESTROYED)
return;

self.aflag |= PROJECTILE_DESTROYED;
self.destroy = sub_nulldestroy;
self.think = sub_null;
self.touch = sub_null;
base_projectile_touch ();
};

//--------------------------------------------------------------
entity(entity src, vector org, vector vel) spawn_projectile_lavaball =
{
entity e = spawn ();
e.owner = src;
e.enemy = src.enemy;
e.origin = org;
e.velocity = vel;
e.avelocity = src.cust_avelocity;
// parameters for homing
e.homing = src.homing;
e.proj_speed_mod = src.proj_speed_mod;
e.waitmin = src.waitmin;
// model, skin, & sounds
e.mdl_proj = src.mdl_proj;
e.skin_proj = src.skin_proj;
e.snd_hit = src.snd_hit;

projectile_lavaball_init (e);
return e;
};

//--------------------------------------------------------------
void(entity e) projectile_lavaball_init =
{
base_projectile_init (e);

e.classname = "lavaball";
e.classtype = CT_PROJECTILE_LAVABALL;
e.movetype = MOVETYPE_FLYMISSILE;
e.solid = SOLID_BBOX;
e.destroy = projectile_lavaball_destroy;
e.touch = base_projectile_touch;
e.aflag |= PROJECTILE_EXPLOSIVE;
e.health = LAVABALL_HEALTH;
e.takedamage = DAMAGE_YES;
e.angles = vectoangles (e.velocity);

// trap_shooter sets avelocity to '0 0 400' -- CEV
if (!e.avelocity)
e.avelocity = '200 100 300';

if (!e.proj_basespeed)
e.proj_basespeed = LAVABALL_SPEED;

if (!e.direct_damage)
e.direct_damage = LAVABALL_DIRECT_DAMAGE;

if (!e.splash_damage)
e.splash_damage = LAVABALL_SPLASH_DAMAGE;

// dumptruck_ds custom_mdls
if (e.mdl_proj != "")
setmodel (e, e.mdl_proj);
else
setmodel (e, "progs/lavaball.mdl");

// dumptruck_ds
if (e.skin_proj)
e.skin = e.skin_proj;
else
e.skin = 0;

if (e.homing > 0)
{
base_projectile_setup_homing (e,
e.proj_basespeed * e.proj_speed_mod);
}
else
{
e.think = sub_remove;
e.nextthink = time + 6;
}

setsize (e, LAVABALL_MINS, LAVABALL_MAXS);
setorigin (e, e.origin);
};

//--------------------------------------------------------------
strip void() projectile_lavaball =
{
projectile_lavaball_init (self);
};
// };

Return to the top of this page or return to the overview of this repo.

Log lavaball.qc

Return to the top of this page or return to the overview of this repo.