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: joining speed (calculate this as join spread * initial speed)
98 float w_crylink_linkjoin_time;
99 vector W_Crylink_LinkJoin(entity e, float jspeed)
101 vector avg_origin, avg_velocity;
106 // FIXME remove this debug code
107 W_Crylink_CheckLinks(e);
109 w_crylink_linkjoin_time = 0;
111 avg_origin = e.origin;
112 avg_velocity = e.velocity;
114 for(p = e; (p = p.queuenext) != e; )
116 avg_origin += WarpZone_RefSys_TransformOrigin(p, e, p.origin);
117 avg_velocity += WarpZone_RefSys_TransformVelocity(p, e, p.velocity);
120 avg_origin *= (1.0 / n);
121 avg_velocity *= (1.0 / n);
124 return avg_origin; // nothing to do
126 // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
127 avg_dist = pow(vlen(e.origin - avg_origin), 2);
128 for(p = e; (p = p.queuenext) != e; )
129 avg_dist += pow(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2);
130 avg_dist *= (1.0 / n);
131 avg_dist = sqrt(avg_dist);
134 return avg_origin; // no change needed
138 e.velocity = avg_velocity;
139 UpdateCSQCProjectile(e);
140 for(p = e; (p = p.queuenext) != e; )
142 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
143 UpdateCSQCProjectile(p);
145 targ_origin = avg_origin + 1000000000 * normalize(avg_velocity); // HUUUUUUGE
149 w_crylink_linkjoin_time = avg_dist / jspeed;
150 targ_origin = avg_origin + w_crylink_linkjoin_time * avg_velocity;
152 e.velocity = (targ_origin - e.origin) * (1.0 / w_crylink_linkjoin_time);
153 UpdateCSQCProjectile(e);
154 for(p = e; (p = p.queuenext) != e; )
156 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (1.0 / w_crylink_linkjoin_time));
157 UpdateCSQCProjectile(p);
161 // jspeed -> +infinity:
162 // w_crylink_linkjoin_time -> +0
163 // targ_origin -> avg_origin
164 // p->velocity -> HUEG towards center
166 // w_crylink_linkjoin_time -> +/- infinity
167 // targ_origin -> avg_velocity * +/- infinity
168 // p->velocity -> avg_velocity
169 // jspeed -> -infinity:
170 // w_crylink_linkjoin_time -> -0
171 // targ_origin -> avg_origin
172 // p->velocity -> HUEG away from center
175 W_Crylink_CheckLinks(e);
180 void W_Crylink_LinkJoinEffect_Think()
182 // is there at least 2 projectiles very close?
185 e = self.owner.crylink_lastgroup;
189 if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
191 for(p = e; (p = p.queuenext) != e; )
193 if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
198 if(e.projectiledeathtype & HITTYPE_SECONDARY)
200 if(autocvar_g_balance_crylink_secondary_joinexplode)
202 n = n / autocvar_g_balance_crylink_secondary_shots;
203 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n,
204 autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n,
205 autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner,
206 autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
208 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
213 if(autocvar_g_balance_crylink_primary_joinexplode)
215 n = n / autocvar_g_balance_crylink_primary_shots;
216 RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n,
217 autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n,
218 autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner,
219 autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
221 pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
229 float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
231 entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, FALSE);
232 float hit_friendly = 0;
237 if((head.takedamage != DAMAGE_NO) && (head.deadflag == DEAD_NO))
239 if(IsDifferentTeam(head, projectile.realowner))
248 return (hit_enemy ? FALSE : hit_friendly);
251 // NO bounce protection, as bounces are limited!
252 void W_Crylink_Touch (void)
259 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
261 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
265 f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
269 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);
271 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))))
273 if(self == self.realowner.crylink_lastgroup)
274 self.realowner.crylink_lastgroup = world;
275 W_Crylink_LinkExplode(self.queuenext, self);
276 self.classname = "spike_oktoremove";
283 W_Crylink_Dequeue(self);
287 self.cnt = self.cnt - 1;
288 self.angles = vectoangles(self.velocity);
290 self.projectiledeathtype |= HITTYPE_BOUNCE;
291 // commented out as it causes a little hitch...
293 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
296 void W_Crylink_Touch2 (void)
303 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
305 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
309 f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
313 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);
315 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))))
317 if(self == self.realowner.crylink_lastgroup)
318 self.realowner.crylink_lastgroup = world;
319 W_Crylink_LinkExplode(self.queuenext, self);
320 self.classname = "spike_oktoremove";
327 W_Crylink_Dequeue(self);
331 self.cnt = self.cnt - 1;
332 self.angles = vectoangles(self.velocity);
334 self.projectiledeathtype |= HITTYPE_BOUNCE;
335 // commented out as it causes a little hitch...
337 // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
340 void W_Crylink_Fadethink (void)
342 W_Crylink_Dequeue(self);
346 void W_Crylink_Attack (void)
348 float counter, shots;
349 entity proj, prevproj, firstproj;
351 vector forward, right, up;
354 W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_reload_ammo);
356 maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
357 maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
358 if(autocvar_g_balance_crylink_primary_joinexplode)
359 maxdmg += autocvar_g_balance_crylink_primary_joinexplode_damage;
361 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
366 shots = autocvar_g_balance_crylink_primary_shots;
367 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
368 proj = prevproj = firstproj = world;
369 for(counter = 0; counter < shots; ++counter)
372 proj.reset = W_Crylink_Reset;
373 proj.realowner = proj.owner = self;
374 proj.classname = "spike";
375 proj.bot_dodge = TRUE;
376 proj.bot_dodgerating = autocvar_g_balance_crylink_primary_damage;
378 proj.queuenext = proj;
379 proj.queueprev = proj;
381 else if(counter == 0) { // first projectile, store in firstproj for now
384 else if(counter == shots - 1) { // last projectile, link up with first projectile
385 prevproj.queuenext = proj;
386 firstproj.queueprev = proj;
387 proj.queuenext = firstproj;
388 proj.queueprev = prevproj;
390 else { // else link up with previous projectile
391 prevproj.queuenext = proj;
392 proj.queueprev = prevproj;
397 proj.movetype = MOVETYPE_BOUNCEMISSILE;
398 PROJECTILE_MAKETRIGGER(proj);
399 proj.projectiledeathtype = WEP_CRYLINK;
400 //proj.gravity = 0.001;
402 setorigin (proj, w_shotorg);
403 setsize(proj, '0 0 0', '0 0 0');
411 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
415 s = s * autocvar_g_balance_crylink_primary_spread * g_weaponspreadfactor;
416 W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_crylink_primary_speed, 0, 0, 0, FALSE);
417 proj.touch = W_Crylink_Touch;
419 proj.think = W_Crylink_Fadethink;
422 proj.fade_time = time + autocvar_g_balance_crylink_primary_middle_lifetime;
423 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_middle_fadetime;
424 proj.nextthink = time + autocvar_g_balance_crylink_primary_middle_lifetime + autocvar_g_balance_crylink_primary_middle_fadetime;
428 proj.fade_time = time + autocvar_g_balance_crylink_primary_other_lifetime;
429 proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
430 proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
432 proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
433 proj.cnt = autocvar_g_balance_crylink_primary_bounces;
434 //proj.scale = 1 + 1 * proj.cnt;
436 proj.angles = vectoangles (proj.velocity);
438 //proj.glow_size = 20;
440 proj.flags = FL_PROJECTILE;
441 proj.missile_flags = MIF_SPLASH;
443 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
445 other = proj; MUTATOR_CALLHOOK(EditProjectile);
447 if(autocvar_g_balance_crylink_primary_joinspread != 0)
449 self.crylink_lastgroup = proj;
450 W_Crylink_CheckLinks(proj);
451 self.crylink_waitrelease = 1;
455 void W_Crylink_Attack2 (void)
457 float counter, shots;
458 entity proj, prevproj, firstproj;
460 vector forward, right, up;
463 W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_secondary_ammo, autocvar_g_balance_crylink_reload_ammo);
465 maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
466 maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
467 if(autocvar_g_balance_crylink_secondary_joinexplode)
468 maxdmg += autocvar_g_balance_crylink_secondary_joinexplode_damage;
470 W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
475 shots = autocvar_g_balance_crylink_secondary_shots;
476 pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
477 proj = prevproj = firstproj = world;
478 for(counter = 0; counter < shots; ++counter)
481 proj.reset = W_Crylink_Reset;
482 proj.realowner = proj.owner = self;
483 proj.classname = "spike";
484 proj.bot_dodge = TRUE;
485 proj.bot_dodgerating = autocvar_g_balance_crylink_secondary_damage;
487 proj.queuenext = proj;
488 proj.queueprev = proj;
490 else if(counter == 0) { // first projectile, store in firstproj for now
493 else if(counter == shots - 1) { // last projectile, link up with first projectile
494 prevproj.queuenext = proj;
495 firstproj.queueprev = proj;
496 proj.queuenext = firstproj;
497 proj.queueprev = prevproj;
499 else { // else link up with previous projectile
500 prevproj.queuenext = proj;
501 proj.queueprev = prevproj;
506 proj.movetype = MOVETYPE_BOUNCEMISSILE;
507 PROJECTILE_MAKETRIGGER(proj);
508 proj.projectiledeathtype = WEP_CRYLINK | HITTYPE_SECONDARY;
509 //proj.gravity = 0.001;
511 setorigin (proj, w_shotorg);
512 setsize(proj, '0 0 0', '0 0 0');
514 if(autocvar_g_balance_crylink_secondary_spreadtype == 1)
521 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
525 s = s * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor;
526 s = w_shotdir + right * s_y + up * s_z;
530 s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor);
533 W_SetupProjectileVelocityEx(proj, s, v_up, autocvar_g_balance_crylink_secondary_speed, 0, 0, 0, FALSE);
534 proj.touch = W_Crylink_Touch2;
535 proj.think = W_Crylink_Fadethink;
536 if(counter == (shots - 1) / 2)
538 proj.fade_time = time + autocvar_g_balance_crylink_secondary_middle_lifetime;
539 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_middle_fadetime;
540 proj.nextthink = time + autocvar_g_balance_crylink_secondary_middle_lifetime + autocvar_g_balance_crylink_secondary_middle_fadetime;
544 proj.fade_time = time + autocvar_g_balance_crylink_secondary_line_lifetime;
545 proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
546 proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
548 proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
549 proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
550 //proj.scale = 1 + 1 * proj.cnt;
552 proj.angles = vectoangles (proj.velocity);
554 //proj.glow_size = 20;
556 proj.flags = FL_PROJECTILE;
557 proj.missile_flags = MIF_SPLASH;
559 CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
561 other = proj; MUTATOR_CALLHOOK(EditProjectile);
563 if(autocvar_g_balance_crylink_secondary_joinspread != 0)
565 self.crylink_lastgroup = proj;
566 W_Crylink_CheckLinks(proj);
567 self.crylink_waitrelease = 2;
571 void spawnfunc_weapon_crylink (void)
573 weapon_defaultspawnfunc(WEP_CRYLINK);
576 float w_crylink(float req)
582 self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
584 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
586 else if (req == WR_THINK)
588 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
589 weapon_action(self.weapon, WR_RELOAD);
591 if (self.BUTTON_ATCK)
593 if (self.crylink_waitrelease != 1)
594 if (weapon_prepareattack(0, autocvar_g_balance_crylink_primary_refire))
597 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_crylink_primary_animtime, w_ready);
601 if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
603 if (self.crylink_waitrelease != 2)
604 if (weapon_prepareattack(1, autocvar_g_balance_crylink_secondary_refire))
607 weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_crylink_secondary_animtime, w_ready);
611 if ((self.crylink_waitrelease == 1 && !self.BUTTON_ATCK) || (self.crylink_waitrelease == 2 && !self.BUTTON_ATCK2))
613 if (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time)
615 // fired and released now!
616 if(self.crylink_lastgroup)
619 entity linkjoineffect;
621 if(self.crylink_waitrelease == 1)
623 pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed);
628 pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_secondary_joinspread * autocvar_g_balance_crylink_secondary_speed);
631 linkjoineffect = spawn();
632 linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
633 linkjoineffect.classname = "linkjoineffect";
634 linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
635 linkjoineffect.owner = self;
636 setorigin(linkjoineffect, pos);
638 self.crylink_waitrelease = 0;
639 if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
640 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
643 self.cnt = WEP_CRYLINK;
644 self.switchweapon = w_getbestweapon(self);
649 else if (req == WR_PRECACHE)
651 precache_model ("models/weapons/g_crylink.md3");
652 precache_model ("models/weapons/v_crylink.md3");
653 precache_model ("models/weapons/h_crylink.iqm");
654 precache_sound ("weapons/crylink_fire.wav");
655 precache_sound ("weapons/crylink_fire2.wav");
656 precache_sound ("weapons/crylink_linkjoin.wav");
657 //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
659 else if (req == WR_SETUP)
661 weapon_setup(WEP_CRYLINK);
662 self.current_ammo = ammo_cells;
664 else if (req == WR_CHECKAMMO1)
666 // don't "run out of ammo" and switch weapons while waiting for release
667 if(self.crylink_lastgroup && self.crylink_waitrelease)
670 ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
671 ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
674 else if (req == WR_CHECKAMMO2)
676 // don't "run out of ammo" and switch weapons while waiting for release
677 if(self.crylink_lastgroup && self.crylink_waitrelease)
680 ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
681 ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
684 else if (req == WR_RELOAD)
686 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");
688 else if (req == WR_SUICIDEMESSAGE)
690 return WEAPON_CRYLINK_SUICIDE;
692 else if (req == WR_KILLMESSAGE)
694 return WEAPON_CRYLINK_MURDER;
700 float w_crylink(float req)
702 if(req == WR_IMPACTEFFECT)
705 org2 = w_org + w_backoff * 2;
706 if(w_deathtype & HITTYPE_SECONDARY)
708 pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
710 sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTEN_NORM);
714 pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
716 sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTEN_NORM);
719 else if(req == WR_PRECACHE)
721 precache_sound("weapons/crylink_impact2.wav");
722 precache_sound("weapons/crylink_impact.wav");