2 REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", _("Crylink"));
6 .float crylink_waitrelease;
7 .entity crylink_lastgroup;
12 void W_Crylink_SetAmmoCounter()
14 // set clip_load to the weapon we have switched to, if the gun uses reloading
15 if(!autocvar_g_balance_crylink_reload_ammo)
16 self.clip_load = 0; // also keeps crosshair ammo from displaying
19 self.clip_load = self.crylink_load;
20 self.clip_size = autocvar_g_balance_crylink_reload_ammo; // for the crosshair ammo display
24 void W_Crylink_ReloadedAndReady()
28 // now do the ammo transfer
29 self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
30 while(self.clip_load < autocvar_g_balance_crylink_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
35 self.crylink_load = self.clip_load;
37 t = ATTACK_FINISHED(self) - autocvar_g_balance_crylink_reload_time - 1;
38 ATTACK_FINISHED(self) = t;
42 void W_Crylink_Reload()
44 // return if reloading is disabled for this weapon
45 if(!autocvar_g_balance_crylink_reload_ammo)
48 if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)))
53 sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
55 t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_crylink_reload_time + 1;
56 ATTACK_FINISHED(self) = t;
58 weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_crylink_reload_time, W_Crylink_ReloadedAndReady);
60 self.old_clip_load = self.clip_load;
64 void W_Crylink_CheckLinks(entity e)
70 error("W_Crylink_CheckLinks: entity is world");
73 for(i = 0; i < 1000; ++i)
75 if(p.queuenext.queueprev != p || p.queueprev.queuenext != p)
76 error("W_Crylink_CheckLinks: queue is inconsistent");
82 error("W_Crylink_CheckLinks: infinite chain");
85 void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next)
87 if(me == own.crylink_lastgroup)
88 own.crylink_lastgroup = ((me == next) ? world : next);
89 prev.queuenext = next;
90 next.queueprev = prev;
93 void W_Crylink_Dequeue(entity e)
95 W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
98 // force projectile to explode
99 void W_Crylink_LinkExplode (entity e, entity e2)
102 a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1);
104 if(e == e.realowner.crylink_lastgroup)
105 e.realowner.crylink_lastgroup = world;
107 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);
109 if(e.queuenext != e2)
110 W_Crylink_LinkExplode(e.queuenext, e2);
115 // adjust towards center
116 // returns the origin where they will meet... and the time till the meeting is
117 // stored in w_crylink_linkjoin_time.
118 // could possibly network this origin and time, and display a special particle
119 // effect when projectiles meet there :P
120 // jspeed: MINIMUM jing speed
121 // jtime: MAXIMUM jing time (0: none)
122 float w_crylink_linkjoin_time;
123 vector W_Crylink_LinkJoin(entity e, float jspeed, float jtime)
125 vector avg_origin, avg_velocity;
130 // FIXME remove this debug code
131 W_Crylink_CheckLinks(e);
133 w_crylink_linkjoin_time = 0;
135 avg_origin = e.origin;
136 avg_velocity = e.velocity;
138 for(p = e; (p = p.queuenext) != e; )
140 avg_origin += WarpZone_RefSys_TransformOrigin(p, e, p.origin);
141 avg_velocity += WarpZone_RefSys_TransformVelocity(p, e, p.velocity);
144 avg_origin *= (1.0 / n);
145 avg_velocity *= (1.0 / n);
148 return avg_origin; // nothing to do
150 // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
151 avg_dist = pow(vlen(e.origin - avg_origin), 2);
152 for(p = e; (p = p.queuenext) != e; )
153 avg_dist += pow(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2);
154 avg_dist *= (1.0 / n);
155 avg_dist = sqrt(avg_dist);
158 return avg_origin; // no change needed
160 if(jspeed == 0 && jtime == 0)
162 e.velocity = avg_velocity;
163 UpdateCSQCProjectile(e);
164 for(p = e; (p = p.queuenext) != e; )
166 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
167 UpdateCSQCProjectile(p);
175 w_crylink_linkjoin_time = min(jtime, avg_dist / jspeed);
177 w_crylink_linkjoin_time = jtime;
180 w_crylink_linkjoin_time = avg_dist / jspeed;
181 targ_origin = avg_origin + w_crylink_linkjoin_time * avg_velocity;
183 e.velocity = (targ_origin - e.origin) * (1.0 / w_crylink_linkjoin_time);
184 UpdateCSQCProjectile(e);
185 for(p = e; (p = p.queuenext) != e; )
187 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (1.0 / w_crylink_linkjoin_time));
188 UpdateCSQCProjectile(p);
192 // jspeed -> +infinity:
193 // w_crylink_linkjoin_time -> +0
194 // targ_origin -> avg_origin
195 // p->velocity -> HUEG towards center
197 // w_crylink_linkjoin_time -> +/- infinity
198 // targ_origin -> avg_velocity * +/- infinity
199 // p->velocity -> avg_velocity
200 // jspeed -> -infinity:
201 // w_crylink_linkjoin_time -> -0
202 // targ_origin -> avg_origin
203 // p->velocity -> HUEG away from center
209 void W_Crylink_LinkJoinEffect_Think()
211 // is there at least 2 projectiles very close?
214 e = self.owner.crylink_lastgroup;
218 if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
220 for(p = e; (p = p.queuenext) != e; )
222 if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
227 if(e.projectiledeathtype & HITTYPE_SECONDARY)
229 if(autocvar_g_balance_crylink_secondary_joinexplode)
231 n = n / autocvar_g_balance_crylink_secondary_shots;
232 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n,
233 autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n,
234 autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner,
235 autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
237 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
242 if(autocvar_g_balance_crylink_primary_joinexplode)
244 n = n / autocvar_g_balance_crylink_primary_shots;
245 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n,
246 autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n,
247 autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner,
248 autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
250 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
259 // NO bounce protection, as bounces are limited!
260 void W_Crylink_Touch (void)
265 local entity savenext, saveprev, saveown;
266 saveown = self.realowner;
267 savenext = self.queuenext;
268 saveprev = self.queueprev;
269 if(WarpZone_Projectile_Touch())
272 W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
277 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
279 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
283 f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
286 if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_primary_linkexplode)
288 if(self == self.realowner.crylink_lastgroup)
289 self.realowner.crylink_lastgroup = world;
290 W_Crylink_LinkExplode(self.queuenext, self);
297 W_Crylink_Dequeue(self);
301 self.cnt = self.cnt - 1;
302 self.angles = vectoangles(self.velocity);
304 self.projectiledeathtype |= HITTYPE_BOUNCE;
305 // commented out as it causes a little hitch...
307 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
310 void W_Crylink_Touch2 (void)
315 local entity savenext, saveprev, saveown;
316 savenext = self.queuenext;
317 saveprev = self.queueprev;
318 saveown = self.realowner;
319 if(WarpZone_Projectile_Touch())
322 W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
327 a = 1 - (time - self.fade_time) * self.fade_rate;
329 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
333 f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
336 if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_secondary_linkexplode)
338 if(self == self.realowner.crylink_lastgroup)
339 self.realowner.crylink_lastgroup = world;
340 W_Crylink_LinkExplode(self.queuenext, self);
347 W_Crylink_Dequeue(self);
351 self.cnt = self.cnt - 1;
352 self.angles = vectoangles(self.velocity);
354 self.projectiledeathtype |= HITTYPE_BOUNCE;
355 // commented out as it causes a little hitch...
357 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
360 void W_Crylink_Fadethink (void)
362 W_Crylink_Dequeue(self);
366 void W_Crylink_Attack (void)
368 local float counter, shots;
369 local entity proj, prevproj, firstproj;
371 vector forward, right, up;
374 // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
375 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
377 if(autocvar_g_balance_crylink_reload_ammo)
379 self.clip_load -= autocvar_g_balance_crylink_primary_ammo;
380 self.crylink_load = self.clip_load;
383 self.ammo_cells -= autocvar_g_balance_crylink_primary_ammo;
386 maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
387 maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
388 if(autocvar_g_balance_crylink_primary_joinexplode)
389 maxdmg += autocvar_g_balance_crylink_primary_joinexplode_damage;
391 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CHAN_WEAPON, maxdmg);
396 shots = autocvar_g_balance_crylink_primary_shots;
397 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
399 while (counter < shots)
402 proj.realowner = proj.owner = self;
403 proj.classname = "spike";
404 proj.bot_dodge = TRUE;
405 proj.bot_dodgerating = autocvar_g_balance_crylink_primary_damage;
407 proj.queuenext = proj;
408 proj.queueprev = proj;
410 else if(counter == 0) { // first projectile, store in firstproj for now
413 else if(counter == shots - 1) { // last projectile, link up with first projectile
414 prevproj.queuenext = proj;
415 firstproj.queueprev = proj;
416 proj.queuenext = firstproj;
417 proj.queueprev = prevproj;
419 else { // else link up with previous projectile
420 prevproj.queuenext = proj;
421 proj.queueprev = prevproj;
426 proj.movetype = MOVETYPE_BOUNCEMISSILE;
427 PROJECTILE_MAKETRIGGER(proj);
428 proj.projectiledeathtype = WEP_CRYLINK;
429 //proj.gravity = 0.001;
431 setorigin (proj, w_shotorg);
432 setsize(proj, '0 0 0', '0 0 0');
440 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
444 s = s * autocvar_g_balance_crylink_primary_spread * g_weaponspreadfactor;
445 W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_crylink_primary_speed, 0, 0, 0, FALSE);
446 proj.touch = W_Crylink_Touch;
448 proj.think = W_Crylink_Fadethink;
451 proj.fade_time = time + autocvar_g_balance_crylink_primary_middle_lifetime;
452 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_middle_fadetime;
453 proj.nextthink = time + autocvar_g_balance_crylink_primary_middle_lifetime + autocvar_g_balance_crylink_primary_middle_fadetime;
457 proj.fade_time = time + autocvar_g_balance_crylink_primary_other_lifetime;
458 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
459 proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
461 proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
462 proj.cnt = autocvar_g_balance_crylink_primary_bounces;
463 //proj.scale = 1 + 1 * proj.cnt;
465 proj.angles = vectoangles (proj.velocity);
467 //proj.glow_size = 20;
469 proj.flags = FL_PROJECTILE;
471 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
473 other = proj; MUTATOR_CALLHOOK(EditProjectile);
475 counter = counter + 1;
477 self.crylink_lastgroup = proj;
480 void W_Crylink_Attack2 (void)
482 local float counter, shots;
483 local entity proj, prevproj, firstproj;
486 // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
487 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
489 if(autocvar_g_balance_crylink_reload_ammo)
491 self.clip_load -= autocvar_g_balance_crylink_secondary_ammo;
492 self.crylink_load = self.clip_load;
495 self.ammo_cells -= autocvar_g_balance_crylink_secondary_ammo;
498 maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
499 maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
500 if(autocvar_g_balance_crylink_secondary_joinexplode)
501 maxdmg += autocvar_g_balance_crylink_secondary_joinexplode_damage;
503 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CHAN_WEAPON, maxdmg);
505 shots = autocvar_g_balance_crylink_secondary_shots;
506 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
508 while (counter < shots)
511 proj.realowner = proj.owner = self;
512 proj.classname = "spike";
513 proj.bot_dodge = TRUE;
514 proj.bot_dodgerating = autocvar_g_balance_crylink_secondary_damage;
516 proj.queuenext = proj;
517 proj.queueprev = proj;
519 else if(counter == 0) { // first projectile, store in firstproj for now
522 else if(counter == shots - 1) { // last projectile, link up with first projectile
523 prevproj.queuenext = proj;
524 firstproj.queueprev = proj;
525 proj.queuenext = firstproj;
526 proj.queueprev = prevproj;
528 else { // else link up with previous projectile
529 prevproj.queuenext = proj;
530 proj.queueprev = prevproj;
535 proj.movetype = MOVETYPE_BOUNCEMISSILE;
536 PROJECTILE_MAKETRIGGER(proj);
537 proj.projectiledeathtype = WEP_CRYLINK | HITTYPE_SECONDARY;
538 //proj.gravity = 0.001;
540 setorigin (proj, w_shotorg);
541 setsize(proj, '0 0 0', '0 0 0');
543 W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor), v_up, autocvar_g_balance_crylink_secondary_speed, 0, 0, 0, FALSE);
544 proj.touch = W_Crylink_Touch2;
545 proj.think = W_Crylink_Fadethink;
546 if(counter == (shots - 1) / 2)
548 proj.fade_time = time + autocvar_g_balance_crylink_secondary_middle_lifetime;
549 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_middle_fadetime;
550 proj.nextthink = time + autocvar_g_balance_crylink_secondary_middle_lifetime + autocvar_g_balance_crylink_secondary_middle_fadetime;
554 proj.fade_time = time + autocvar_g_balance_crylink_secondary_line_lifetime;
555 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
556 proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
558 proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
559 proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
560 //proj.scale = 1 + 1 * proj.cnt;
562 proj.angles = vectoangles (proj.velocity);
564 //proj.glow_size = 20;
566 proj.flags = FL_PROJECTILE;
568 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
570 other = proj; MUTATOR_CALLHOOK(EditProjectile);
572 counter = counter + 1;
574 self.crylink_lastgroup = proj;
577 void spawnfunc_weapon_crylink (void)
579 weapon_defaultspawnfunc(WEP_CRYLINK);
582 float w_crylink(float req)
587 self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
589 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
591 else if (req == WR_THINK)
593 if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)) // forced reload
595 else if (self.BUTTON_ATCK)
597 if (!self.crylink_waitrelease)
598 if (weapon_prepareattack(0, autocvar_g_balance_crylink_primary_refire))
601 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_crylink_primary_animtime, w_ready);
602 if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
603 self.crylink_waitrelease = 1;
606 else if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
608 if (!self.crylink_waitrelease)
609 if (weapon_prepareattack(1, autocvar_g_balance_crylink_secondary_refire))
612 weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_crylink_secondary_animtime, w_ready);
613 if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
614 self.crylink_waitrelease = 2;
619 if (self.crylink_waitrelease && (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time))
621 // fired and released now!
622 if(self.crylink_lastgroup)
625 entity linkjoineffect;
627 if(self.crylink_waitrelease == 1)
629 pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
634 pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_secondary_joinspread * autocvar_g_balance_crylink_secondary_speed, autocvar_g_balance_crylink_secondary_jointime);
637 linkjoineffect = spawn();
638 linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
639 linkjoineffect.classname = "linkjoineffect";
640 linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
641 linkjoineffect.owner = self;
642 setorigin(linkjoineffect, pos);
644 self.crylink_waitrelease = 0;
645 if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
648 self.cnt = WEP_CRYLINK;
649 self.switchweapon = w_getbestweapon(self);
654 else if (req == WR_PRECACHE)
656 precache_model ("models/weapons/g_crylink.md3");
657 precache_model ("models/weapons/v_crylink.md3");
658 precache_model ("models/weapons/h_crylink.iqm");
659 precache_sound ("weapons/crylink_fire.wav");
660 precache_sound ("weapons/crylink_fire2.wav");
661 precache_sound ("weapons/crylink_linkjoin.wav");
662 precache_sound ("weapons/reload.wav");
664 else if (req == WR_SETUP)
666 weapon_setup(WEP_CRYLINK);
667 W_Crylink_SetAmmoCounter();
669 else if (req == WR_CHECKAMMO1)
671 // don't "run out of ammo" and switch weapons while waiting for release
672 if(self.crylink_lastgroup && self.crylink_waitrelease)
675 if(autocvar_g_balance_crylink_reload_ammo)
676 return self.crylink_load >= autocvar_g_balance_crylink_primary_ammo;
678 return self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
680 else if (req == WR_CHECKAMMO2)
682 // don't "run out of ammo" and switch weapons while waiting for release
683 if(self.crylink_lastgroup && self.crylink_waitrelease)
686 if(autocvar_g_balance_crylink_reload_ammo)
687 return self.crylink_load >= autocvar_g_balance_crylink_secondary_ammo;
689 return self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
691 else if (req == WR_RELOAD)
695 else if (req == WR_SWITCHABLE)
697 // checks if this weapon can be switched to, when reloading is enabled
698 // returns true if there's either enough load in the weapon to use it,
699 // or we have enough ammo to reload the weapon to a usable point
701 ammo_amount = min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo);
702 return (autocvar_g_balance_crylink_reload_ammo && self.crylink_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
708 float w_crylink(float req)
710 if(req == WR_IMPACTEFFECT)
713 org2 = w_org + w_backoff * 2;
714 if(w_deathtype & HITTYPE_SECONDARY)
716 pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
718 sound(self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
722 pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
724 sound(self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
727 else if(req == WR_PRECACHE)
729 precache_sound("weapons/crylink_impact2.wav");
730 precache_sound("weapons/crylink_impact.wav");
732 else if (req == WR_SUICIDEMESSAGE)
734 w_deathtypestring = "%s succeeded at self-destructing themself with the Crylink";
736 else if (req == WR_KILLMESSAGE)
738 if(w_deathtype & HITTYPE_BOUNCE)
739 w_deathtypestring = "%s could not hide from %s's Crylink"; // unchecked: SPLASH (SECONDARY can't be)
740 else if(w_deathtype & HITTYPE_SPLASH)
741 w_deathtypestring = "%s was too close to %s's Crylink"; // unchecked: SECONDARY
743 w_deathtypestring = "%s took a close look at %s's Crylink"; // unchecked: SECONDARY