3 /* WEP_##id */ CRYLINK,
4 /* function */ w_crylink,
5 /* ammotype */ IT_CELLS,
7 /* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
8 /* rating */ BOT_PICKUP_RATING_MID,
10 /* shortname */ "crylink",
11 /* fullname */ _("Crylink")
16 .float crylink_waitrelease;
17 .entity crylink_lastgroup;
22 void W_Crylink_CheckLinks(entity e)
28 error("W_Crylink_CheckLinks: entity is world");
29 if(e.classname != "spike" || wasfreed(e))
30 error(sprintf("W_Crylink_CheckLinks: entity is not a spike but a %s (freed: %d)", e.classname, wasfreed(e)));
33 for(i = 0; i < 1000; ++i)
35 if(p.queuenext.queueprev != p || p.queueprev.queuenext != p)
36 error("W_Crylink_CheckLinks: queue is inconsistent");
42 error("W_Crylink_CheckLinks: infinite chain");
45 void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next)
47 W_Crylink_CheckLinks(next);
48 if(me == own.crylink_lastgroup)
49 own.crylink_lastgroup = ((me == next) ? world : next);
50 prev.queuenext = next;
51 next.queueprev = prev;
52 me.classname = "spike_oktoremove";
54 W_Crylink_CheckLinks(next);
57 void W_Crylink_Dequeue(entity e)
59 W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
62 void W_Crylink_Reset(void)
64 W_Crylink_Dequeue(self);
68 // force projectile to explode
69 void W_Crylink_LinkExplode (entity e, entity e2)
76 a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1);
78 if(e == e.realowner.crylink_lastgroup)
79 e.realowner.crylink_lastgroup = world;
81 if(e.projectiledeathtype & HITTYPE_SECONDARY)
82 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_damage * a, autocvar_g_balance_crylink_secondary_edgedamage * a, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * a, e.projectiledeathtype, other);
84 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);
86 W_Crylink_LinkExplode(e.queuenext, e2);
88 e.classname = "spike_oktoremove";
92 // adjust towards center
93 // returns the origin where they will meet... and the time till the meeting is
94 // stored in w_crylink_linkjoin_time.
95 // could possibly network this origin and time, and display a special particle
96 // effect when projectiles meet there :P
97 // jspeed: MINIMUM jing speed
98 // jtime: MAXIMUM jing time (0: none)
99 float w_crylink_linkjoin_time;
100 vector W_Crylink_LinkJoin(entity e, float jspeed, float jtime)
102 vector avg_origin, avg_velocity;
107 // FIXME remove this debug code
108 W_Crylink_CheckLinks(e);
110 w_crylink_linkjoin_time = 0;
112 avg_origin = e.origin;
113 avg_velocity = e.velocity;
115 for(p = e; (p = p.queuenext) != e; )
117 avg_origin += WarpZone_RefSys_TransformOrigin(p, e, p.origin);
118 avg_velocity += WarpZone_RefSys_TransformVelocity(p, e, p.velocity);
121 avg_origin *= (1.0 / n);
122 avg_velocity *= (1.0 / n);
125 return avg_origin; // nothing to do
127 // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
128 avg_dist = pow(vlen(e.origin - avg_origin), 2);
129 for(p = e; (p = p.queuenext) != e; )
130 avg_dist += pow(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2);
131 avg_dist *= (1.0 / n);
132 avg_dist = sqrt(avg_dist);
135 return avg_origin; // no change needed
137 if(jspeed == 0 && jtime == 0)
139 e.velocity = avg_velocity;
140 UpdateCSQCProjectile(e);
141 for(p = e; (p = p.queuenext) != e; )
143 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
144 UpdateCSQCProjectile(p);
146 targ_origin = avg_origin + 1000000000 * normalize(avg_velocity); // HUUUUUUGE
153 w_crylink_linkjoin_time = min(jtime, avg_dist / jspeed);
155 w_crylink_linkjoin_time = jtime;
158 w_crylink_linkjoin_time = avg_dist / jspeed;
159 targ_origin = avg_origin + w_crylink_linkjoin_time * avg_velocity;
161 e.velocity = (targ_origin - e.origin) * (1.0 / w_crylink_linkjoin_time);
162 UpdateCSQCProjectile(e);
163 for(p = e; (p = p.queuenext) != e; )
165 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (1.0 / w_crylink_linkjoin_time));
166 UpdateCSQCProjectile(p);
170 // jspeed -> +infinity:
171 // w_crylink_linkjoin_time -> +0
172 // targ_origin -> avg_origin
173 // p->velocity -> HUEG towards center
175 // w_crylink_linkjoin_time -> +/- infinity
176 // targ_origin -> avg_velocity * +/- infinity
177 // p->velocity -> avg_velocity
178 // jspeed -> -infinity:
179 // w_crylink_linkjoin_time -> -0
180 // targ_origin -> avg_origin
181 // p->velocity -> HUEG away from center
184 W_Crylink_CheckLinks(e);
189 void W_Crylink_LinkJoinEffect_Think()
191 // is there at least 2 projectiles very close?
194 e = self.owner.crylink_lastgroup;
198 if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
200 for(p = e; (p = p.queuenext) != e; )
202 if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
207 if(e.projectiledeathtype & HITTYPE_SECONDARY)
209 if(autocvar_g_balance_crylink_secondary_joinexplode)
211 n = n / autocvar_g_balance_crylink_secondary_shots;
212 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n,
213 autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n,
214 autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner,
215 autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
217 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
222 if(autocvar_g_balance_crylink_primary_joinexplode)
224 n = n / autocvar_g_balance_crylink_primary_shots;
225 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n,
226 autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n,
227 autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner,
228 autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
230 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
238 float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
240 entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, FALSE);
241 float hit_friendly = 0;
246 if((head.takedamage != DAMAGE_NO) && (head.deadflag == DEAD_NO))
248 if(IsDifferentTeam(head, projectile.realowner))
257 return (hit_enemy ? FALSE : hit_friendly);
260 // NO bounce protection, as bounces are limited!
261 void W_Crylink_Touch (void)
268 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
270 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
274 f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
278 float totaldamage = 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);
280 if(totaldamage && ((autocvar_g_balance_crylink_primary_linkexplode == 2) || ((autocvar_g_balance_crylink_primary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_primary_radius))))
282 if(self == self.realowner.crylink_lastgroup)
283 self.realowner.crylink_lastgroup = world;
284 W_Crylink_LinkExplode(self.queuenext, self);
285 self.classname = "spike_oktoremove";
292 W_Crylink_Dequeue(self);
296 self.cnt = self.cnt - 1;
297 self.angles = vectoangles(self.velocity);
299 self.projectiledeathtype |= HITTYPE_BOUNCE;
300 // commented out as it causes a little hitch...
302 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
305 void W_Crylink_Touch2 (void)
312 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
314 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
318 f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
322 float totaldamage = 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);
324 if(totaldamage && ((autocvar_g_balance_crylink_secondary_linkexplode == 2) || ((autocvar_g_balance_crylink_secondary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_secondary_radius))))
326 if(self == self.realowner.crylink_lastgroup)
327 self.realowner.crylink_lastgroup = world;
328 W_Crylink_LinkExplode(self.queuenext, self);
329 self.classname = "spike_oktoremove";
336 W_Crylink_Dequeue(self);
340 self.cnt = self.cnt - 1;
341 self.angles = vectoangles(self.velocity);
343 self.projectiledeathtype |= HITTYPE_BOUNCE;
344 // commented out as it causes a little hitch...
346 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
349 void W_Crylink_Fadethink (void)
351 W_Crylink_Dequeue(self);
355 void W_Crylink_Attack (void)
357 float counter, shots;
358 entity proj, prevproj, firstproj;
360 vector forward, right, up;
363 W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_reload_ammo);
365 maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
366 maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
367 if(autocvar_g_balance_crylink_primary_joinexplode)
368 maxdmg += autocvar_g_balance_crylink_primary_joinexplode_damage;
370 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
375 shots = autocvar_g_balance_crylink_primary_shots;
376 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
377 proj = prevproj = firstproj = world;
378 for(counter = 0; counter < shots; ++counter)
381 proj.reset = W_Crylink_Reset;
382 proj.realowner = proj.owner = self;
383 proj.classname = "spike";
384 proj.bot_dodge = TRUE;
385 proj.bot_dodgerating = autocvar_g_balance_crylink_primary_damage;
387 proj.queuenext = proj;
388 proj.queueprev = proj;
390 else if(counter == 0) { // first projectile, store in firstproj for now
393 else if(counter == shots - 1) { // last projectile, link up with first projectile
394 prevproj.queuenext = proj;
395 firstproj.queueprev = proj;
396 proj.queuenext = firstproj;
397 proj.queueprev = prevproj;
399 else { // else link up with previous projectile
400 prevproj.queuenext = proj;
401 proj.queueprev = prevproj;
406 proj.movetype = MOVETYPE_BOUNCEMISSILE;
407 PROJECTILE_MAKETRIGGER(proj);
408 proj.projectiledeathtype = WEP_CRYLINK;
409 //proj.gravity = 0.001;
411 setorigin (proj, w_shotorg);
412 setsize(proj, '0 0 0', '0 0 0');
420 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
424 s = s * autocvar_g_balance_crylink_primary_spread * g_weaponspreadfactor;
425 W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_crylink_primary_speed, 0, 0, 0, FALSE);
426 proj.touch = W_Crylink_Touch;
428 proj.think = W_Crylink_Fadethink;
431 proj.fade_time = time + autocvar_g_balance_crylink_primary_middle_lifetime;
432 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_middle_fadetime;
433 proj.nextthink = time + autocvar_g_balance_crylink_primary_middle_lifetime + autocvar_g_balance_crylink_primary_middle_fadetime;
437 proj.fade_time = time + autocvar_g_balance_crylink_primary_other_lifetime;
438 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
439 proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
441 proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
442 proj.cnt = autocvar_g_balance_crylink_primary_bounces;
443 //proj.scale = 1 + 1 * proj.cnt;
445 proj.angles = vectoangles (proj.velocity);
447 //proj.glow_size = 20;
449 proj.flags = FL_PROJECTILE;
450 proj.missile_flags = MIF_SPLASH;
452 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
454 other = proj; MUTATOR_CALLHOOK(EditProjectile);
456 if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
458 self.crylink_lastgroup = proj;
459 W_Crylink_CheckLinks(proj);
460 self.crylink_waitrelease = 1;
464 void W_Crylink_Attack2 (void)
466 float counter, shots;
467 entity proj, prevproj, firstproj;
469 vector forward, right, up;
472 W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_secondary_ammo, autocvar_g_balance_crylink_reload_ammo);
474 maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
475 maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
476 if(autocvar_g_balance_crylink_secondary_joinexplode)
477 maxdmg += autocvar_g_balance_crylink_secondary_joinexplode_damage;
479 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
484 shots = autocvar_g_balance_crylink_secondary_shots;
485 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
486 proj = prevproj = firstproj = world;
487 for(counter = 0; counter < shots; ++counter)
490 proj.reset = W_Crylink_Reset;
491 proj.realowner = proj.owner = self;
492 proj.classname = "spike";
493 proj.bot_dodge = TRUE;
494 proj.bot_dodgerating = autocvar_g_balance_crylink_secondary_damage;
496 proj.queuenext = proj;
497 proj.queueprev = proj;
499 else if(counter == 0) { // first projectile, store in firstproj for now
502 else if(counter == shots - 1) { // last projectile, link up with first projectile
503 prevproj.queuenext = proj;
504 firstproj.queueprev = proj;
505 proj.queuenext = firstproj;
506 proj.queueprev = prevproj;
508 else { // else link up with previous projectile
509 prevproj.queuenext = proj;
510 proj.queueprev = prevproj;
515 proj.movetype = MOVETYPE_BOUNCEMISSILE;
516 PROJECTILE_MAKETRIGGER(proj);
517 proj.projectiledeathtype = WEP_CRYLINK | HITTYPE_SECONDARY;
518 //proj.gravity = 0.001;
520 setorigin (proj, w_shotorg);
521 setsize(proj, '0 0 0', '0 0 0');
523 if(autocvar_g_balance_crylink_secondary_spreadtype == 1)
530 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
534 s = s * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor;
535 s = w_shotdir + right * s_y + up * s_z;
539 s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor);
542 W_SetupProjectileVelocityEx(proj, s, v_up, autocvar_g_balance_crylink_secondary_speed, 0, 0, 0, FALSE);
543 proj.touch = W_Crylink_Touch2;
544 proj.think = W_Crylink_Fadethink;
545 if(counter == (shots - 1) / 2)
547 proj.fade_time = time + autocvar_g_balance_crylink_secondary_middle_lifetime;
548 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_middle_fadetime;
549 proj.nextthink = time + autocvar_g_balance_crylink_secondary_middle_lifetime + autocvar_g_balance_crylink_secondary_middle_fadetime;
553 proj.fade_time = time + autocvar_g_balance_crylink_secondary_line_lifetime;
554 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
555 proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
557 proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
558 proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
559 //proj.scale = 1 + 1 * proj.cnt;
561 proj.angles = vectoangles (proj.velocity);
563 //proj.glow_size = 20;
565 proj.flags = FL_PROJECTILE;
566 proj.missile_flags = MIF_SPLASH;
568 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
570 other = proj; MUTATOR_CALLHOOK(EditProjectile);
572 if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
574 self.crylink_lastgroup = proj;
575 W_Crylink_CheckLinks(proj);
576 self.crylink_waitrelease = 2;
580 void spawnfunc_weapon_crylink (void)
582 weapon_defaultspawnfunc(WEP_CRYLINK);
585 float w_crylink(float req)
591 self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
593 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
595 else if (req == WR_THINK)
597 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
598 weapon_action(self.weapon, WR_RELOAD);
600 if (self.BUTTON_ATCK)
602 if (self.crylink_waitrelease != 1)
603 if (weapon_prepareattack(0, autocvar_g_balance_crylink_primary_refire))
606 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_crylink_primary_animtime, w_ready);
610 if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
612 if (self.crylink_waitrelease != 2)
613 if (weapon_prepareattack(1, autocvar_g_balance_crylink_secondary_refire))
616 weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_crylink_secondary_animtime, w_ready);
620 if ((self.crylink_waitrelease == 1 && !self.BUTTON_ATCK) || (self.crylink_waitrelease == 2 && !self.BUTTON_ATCK2))
622 if (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time)
624 // fired and released now!
625 if(self.crylink_lastgroup)
628 entity linkjoineffect;
630 if(self.crylink_waitrelease == 1)
632 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);
637 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);
640 linkjoineffect = spawn();
641 linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
642 linkjoineffect.classname = "linkjoineffect";
643 linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
644 linkjoineffect.owner = self;
645 setorigin(linkjoineffect, pos);
647 self.crylink_waitrelease = 0;
648 if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
649 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
652 self.cnt = WEP_CRYLINK;
653 self.switchweapon = w_getbestweapon(self);
658 else if (req == WR_PRECACHE)
660 precache_model ("models/weapons/g_crylink.md3");
661 precache_model ("models/weapons/v_crylink.md3");
662 precache_model ("models/weapons/h_crylink.iqm");
663 precache_sound ("weapons/crylink_fire.wav");
664 precache_sound ("weapons/crylink_fire2.wav");
665 precache_sound ("weapons/crylink_linkjoin.wav");
666 //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
668 else if (req == WR_SETUP)
670 weapon_setup(WEP_CRYLINK);
671 self.current_ammo = ammo_cells;
673 else if (req == WR_CHECKAMMO1)
675 // don't "run out of ammo" and switch weapons while waiting for release
676 if(self.crylink_lastgroup && self.crylink_waitrelease)
679 ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
680 ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
683 else if (req == WR_CHECKAMMO2)
685 // don't "run out of ammo" and switch weapons while waiting for release
686 if(self.crylink_lastgroup && self.crylink_waitrelease)
689 ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
690 ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
693 else if (req == WR_RELOAD)
695 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");
697 else if (req == WR_SUICIDEMESSAGE)
699 return WEAPON_CRYLINK_SUICIDE;
701 else if (req == WR_KILLMESSAGE)
703 return WEAPON_CRYLINK_MURDER;
709 float w_crylink(float req)
711 if(req == WR_IMPACTEFFECT)
714 org2 = w_org + w_backoff * 2;
715 if(w_deathtype & HITTYPE_SECONDARY)
717 pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
719 sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
723 pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
725 sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
728 else if(req == WR_PRECACHE)
730 precache_sound("weapons/crylink_impact2.wav");
731 precache_sound("weapons/crylink_impact.wav");