Git Repos / fte_dogmode / qc / projectiles / hknightspell.qc
Last update to this file was on 2024-04-05 at 14:18.
Show hknightspell.qc
//==============================================================================
// Death Knight Magic Missile
//==============================================================================
//======================================================================
// constants
//======================================================================
const float HKNSPELL_DIRECT_DAMAGE = 9; // direct damage; 9 is id1
const float HKNSPELL_SPLASH_DAMAGE = 50;// splash damage; 50 is pd3
const float HKNSPELL_EXPLOD_DAMAGE = 20;// explosive direct damage; 20 is pd3
const float HKNSPELL_SPEED = 300; // id1 Death Knight missile is 300ups
const vector HKNSPELL_MINS = '0 0 0'; // let's not change this -- CEV
const vector HKNSPELL_MAXS = '0 0 0'; //
//======================================================================
// forward declarations
//======================================================================
// projectile_hknightspell
entity(entity src, vector org, vector vel, float offset)
spawn_projectile_hknightspell;
void(entity e) projectile_hknightspell_init;
strip void() projectile_hknightspell;
//------------------------------------------------------------------------------
//----------------------------------------------------------------------
// class projectile_hknightspell: base_projectile
// {
//--------------------------------------------------------------
entity(entity src, vector org, vector vel, float offset)
spawn_projectile_hknightspell =
{
local entity e = spawn ();
e.owner = src;
e.enemy = src.enemy;
e.origin = org;
e.velocity = vel;
e.projexpl = src.projexpl;
// 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;
// unique to this magic missile
e.distance = offset;
projectile_hknightspell_init (e);
return e;
};
//--------------------------------------------------------------
void(entity e) projectile_hknightspell_init =
{
base_projectile_init (e);
e.classname = "knightspike";
e.classtype = CT_PROJECTILE_HKNIGHT;
e.movetype = MOVETYPE_FLYMISSILE;
e.solid = SOLID_BBOX;
e.touch = base_projectile_touch;
e.angles = vectoangles (e.velocity);
if (base_projectile_parse_projexpl(e.projexpl, e.distance))
e.aflag |= PROJECTILE_EXPLOSIVE;
if (!e.proj_basespeed)
e.proj_basespeed = HKNSPELL_SPEED;
if (!e.direct_damage)
if (e.aflag & PROJECTILE_EXPLOSIVE)
e.direct_damage = HKNSPELL_EXPLOD_DAMAGE;
else
e.direct_damage = HKNSPELL_DIRECT_DAMAGE;
if (!e.splash_damage)
if (e.aflag & PROJECTILE_EXPLOSIVE)
e.splash_damage = HKNSPELL_SPLASH_DAMAGE;
else
e.splash_damage = 0;
// dumptruck_ds custom_mdls
if (e.mdl_proj != "")
setmodel (e, e.mdl_proj);
else
if (e.aflag & PROJECTILE_EXPLOSIVE)
setmodel (e, "progs/k_spike2.mdl");
else
setmodel (e, "progs/k_spike.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, HKNSPELL_MINS, HKNSPELL_MAXS);
setorigin (e, e.origin);
};
//--------------------------------------------------------------
strip void() projectile_hknightspell =
{
projectile_hknightspell_init (self);
};
// };
Return to the top of this page or return to the overview of this repo.
Log hknightspell.qc
Date | Commit Message | Author | + | - |
---|---|---|---|---|
2024-04-05 | Player footsteps, shareware monsters, misc? | cev | +1 | |
2024-03-24 | 2nd pass refactor, rework QC class structure | cev | +83 | -37 |
2024-02-18 | Client/player, projectiles, entrypoints refactor | cev | +74 |
Return to the top of this page or return to the overview of this repo.