Git Repos / fte_dogmode / qc / projectiles / fireball.qc
Last update to this file was on 2024-03-24 at 02:40.
Show fireball.qc
//==============================================================================
// Fireballs - launched by misc_fireball
//==============================================================================
//======================================================================
// constants
//======================================================================
const float FIREBALL_DIRECT_DAMAGE = 20;// 20 in id1
// no splash damage
const float FIREBALL_SPEED = 1000.0f; // base speed appears to be 1000 in id1
//======================================================================
// forward declarations
//======================================================================
// projectile_fireball
void() projectile_fireball_touch;
entity(entity src, vector org, vector vel, float dmg) spawn_projectile_fireball;
void(entity e) projectile_fireball_init;
strip void() projectile_fireball;
//------------------------------------------------------------------------------
//----------------------------------------------------------------------
// class projectile_fireball: base_projectile
// {
//--------------------------------------------------------------
void() projectile_fireball_touch =
{
t_damage2 (other, self, self, self.direct_damage);
remove (self);
};
//--------------------------------------------------------------
entity(entity src, vector org, vector vel, float dmg)
spawn_projectile_fireball =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
e.velocity = vel;
projectile_fireball_init (e);
return e;
};
//--------------------------------------------------------------
void(entity e) projectile_fireball_init =
{
base_projectile_init (e);
e.classname = "fireball";
e.classtype = CT_PROJECTILE_FIREBALL;
e.movetype = MOVETYPE_TOSS;
e.solid = SOLID_TRIGGER;
e.touch = projectile_fireball_touch;
e.angles = vectoangles (e.velocity);
if (!e.proj_basespeed)
e.proj_basespeed = FIREBALL_SPEED;
if (!e.direct_damage)
e.direct_damage = FIREBALL_DIRECT_DAMAGE;
// dumptruck_ds
if (e.mdl_proj && e.mdl_proj != "")
setmodel (e, e.mdl_proj);
else
setmodel (e, "progs/lavaball.mdl");
if (e.skin_proj)
e.skin = e.skin_proj;
setsize (e, '0 0 0', '0 0 0');
setorigin (e, e.origin);
e.think = sub_remove;
e.nextthink = time + 5;
};
//--------------------------------------------------------------
strip void() projectile_fireball =
{
projectile_fireball_init (self);
};
// };
Return to the top of this page or return to the overview of this repo.
Log fireball.qc
Date | Commit Message | Author | + | - |
---|---|---|---|---|
2024-03-24 | 2nd pass refactor, rework QC class structure | cev | +85 |
Return to the top of this page or return to the overview of this repo.