W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
}
+void W_Crylink_Reset(void)
+{
+ W_Crylink_Dequeue(self);
+ remove(self);
+}
+
// force projectile to explode
void W_Crylink_LinkExplode (entity e, entity e2)
{
float a;
+
+ if(e == e2)
+ return;
+
a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1);
if(e == e.realowner.crylink_lastgroup)
else
RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
- if(e.queuenext != e2)
- W_Crylink_LinkExplode(e.queuenext, e2);
+ W_Crylink_LinkExplode(e.queuenext, e2);
e.classname = "spike_oktoremove";
remove (e);
p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
UpdateCSQCProjectile(p);
}
+ targ_origin = avg_origin + 1000000000 * normalize(avg_velocity); // HUUUUUUGE
}
else
{
if(self == self.realowner.crylink_lastgroup)
self.realowner.crylink_lastgroup = world;
W_Crylink_LinkExplode(self.queuenext, self);
+ self.classname = "spike_oktoremove";
remove (self);
return;
}
if(self == self.realowner.crylink_lastgroup)
self.realowner.crylink_lastgroup = world;
W_Crylink_LinkExplode(self.queuenext, self);
+ self.classname = "spike_oktoremove";
remove (self);
return;
}
void W_Crylink_Attack (void)
{
- local float counter, shots;
- local entity proj, prevproj, firstproj;
- local vector s;
+ float counter, shots;
+ entity proj, prevproj, firstproj;
+ vector s;
vector forward, right, up;
float maxdmg;
shots = autocvar_g_balance_crylink_primary_shots;
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
- proj = world;
- while (counter < shots)
+ proj = prevproj = firstproj = world;
+ for(counter = 0; counter < shots; ++counter)
{
proj = spawn ();
+ proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.bot_dodge = TRUE;
//proj.glow_size = 20;
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH;
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
-
- counter = counter + 1;
}
if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
{
void W_Crylink_Attack2 (void)
{
- local float counter, shots;
- local entity proj, prevproj, firstproj;
+ float counter, shots;
+ entity proj, prevproj, firstproj;
float maxdmg;
W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_secondary_ammo, autocvar_g_balance_crylink_reload_ammo);
shots = autocvar_g_balance_crylink_secondary_shots;
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
- proj = world;
- while (counter < shots)
+ proj = prevproj = firstproj = world;
+ for(counter = 0; counter < shots; ++counter)
{
proj = spawn ();
+ proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.bot_dodge = TRUE;
//proj.glow_size = 20;
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH;
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
-
- counter = counter + 1;
}
if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
{
return TRUE;
ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
- ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
return TRUE;
ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_crylink(float req)