3 /* ammotype */ ATTRIB(Crylink, ammo_field, .int, ammo_cells)
4 /* impulse */ ATTRIB(Crylink, impulse, int, 6)
5 /* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
6 /* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID);
7 /* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
8 /* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
10 /* model */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM);
12 /* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
13 /* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
14 /* wepimg */ ATTRIB(Crylink, model2, string, "weaponcrylink");
15 /* refname */ ATTRIB(Crylink, netname, string, "crylink");
16 /* wepname */ ATTRIB(Crylink, message, string, _("Crylink"));
18 REGISTER_WEAPON(CRYLINK, NEW(Crylink));
20 #define CRYLINK_SETTINGS(w_cvar,w_prop) CRYLINK_SETTINGS_LIST(w_cvar, w_prop, CRYLINK, crylink)
21 #define CRYLINK_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
22 w_cvar(id, sn, BOTH, ammo) \
23 w_cvar(id, sn, BOTH, animtime) \
24 w_cvar(id, sn, BOTH, damage) \
25 w_cvar(id, sn, BOTH, edgedamage) \
26 w_cvar(id, sn, BOTH, radius) \
27 w_cvar(id, sn, BOTH, force) \
28 w_cvar(id, sn, BOTH, spread) \
29 w_cvar(id, sn, BOTH, refire) \
30 w_cvar(id, sn, BOTH, speed) \
31 w_cvar(id, sn, BOTH, shots) \
32 w_cvar(id, sn, BOTH, bounces) \
33 w_cvar(id, sn, BOTH, bouncedamagefactor) \
34 w_cvar(id, sn, BOTH, middle_lifetime) \
35 w_cvar(id, sn, BOTH, middle_fadetime) \
36 w_cvar(id, sn, BOTH, other_lifetime) \
37 w_cvar(id, sn, BOTH, other_fadetime) \
38 w_cvar(id, sn, BOTH, linkexplode) \
39 w_cvar(id, sn, BOTH, joindelay) \
40 w_cvar(id, sn, BOTH, joinspread) \
41 w_cvar(id, sn, BOTH, joinexplode) \
42 w_cvar(id, sn, BOTH, joinexplode_damage) \
43 w_cvar(id, sn, BOTH, joinexplode_edgedamage) \
44 w_cvar(id, sn, BOTH, joinexplode_radius) \
45 w_cvar(id, sn, BOTH, joinexplode_force) \
46 w_cvar(id, sn, SEC, spreadtype) \
47 w_cvar(id, sn, NONE, secondary) \
48 w_prop(id, sn, float, reloading_ammo, reload_ammo) \
49 w_prop(id, sn, float, reloading_time, reload_time) \
50 w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \
51 w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
52 w_prop(id, sn, string, weaponreplace, weaponreplace) \
53 w_prop(id, sn, float, weaponstart, weaponstart) \
54 w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) \
55 w_prop(id, sn, float, weaponthrowable, weaponthrowable)
58 CRYLINK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
60 .float crylink_waitrelease;
61 .entity crylink_lastgroup;
69 spawnfunc(weapon_crylink) { weapon_defaultspawnfunc(WEP_CRYLINK.m_id); }
71 void W_Crylink_CheckLinks(entity e)
77 error("W_Crylink_CheckLinks: entity is world");
78 if(e.classname != "spike" || wasfreed(e))
79 error(sprintf("W_Crylink_CheckLinks: entity is not a spike but a %s (freed: %d)", e.classname, wasfreed(e)));
82 for(i = 0; i < 1000; ++i)
84 if(p.queuenext.queueprev != p || p.queueprev.queuenext != p)
85 error("W_Crylink_CheckLinks: queue is inconsistent");
91 error("W_Crylink_CheckLinks: infinite chain");
94 void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next)
96 W_Crylink_CheckLinks(next);
97 if(me == own.crylink_lastgroup)
98 own.crylink_lastgroup = ((me == next) ? world : next);
99 prev.queuenext = next;
100 next.queueprev = prev;
101 me.classname = "spike_oktoremove";
103 W_Crylink_CheckLinks(next);
106 void W_Crylink_Dequeue(entity e)
108 W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
111 void W_Crylink_Reset(void)
113 W_Crylink_Dequeue(self);
117 // force projectile to explode
118 void W_Crylink_LinkExplode(entity e, entity e2)
125 a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1);
127 if(e == e.realowner.crylink_lastgroup)
128 e.realowner.crylink_lastgroup = world;
130 float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
132 RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other);
134 W_Crylink_LinkExplode(e.queuenext, e2);
136 e.classname = "spike_oktoremove";
140 // adjust towards center
141 // returns the origin where they will meet... and the time till the meeting is
142 // stored in w_crylink_linkjoin_time.
143 // could possibly network this origin and time, and display a special particle
144 // effect when projectiles meet there :P
145 // jspeed: joining speed (calculate this as join spread * initial speed)
146 float w_crylink_linkjoin_time;
147 vector W_Crylink_LinkJoin(entity e, float jspeed)
149 vector avg_origin, avg_velocity;
154 // FIXME remove this debug code
155 W_Crylink_CheckLinks(e);
157 w_crylink_linkjoin_time = 0;
159 avg_origin = e.origin;
160 avg_velocity = e.velocity;
162 for(p = e; (p = p.queuenext) != e; )
164 avg_origin += WarpZone_RefSys_TransformOrigin(p, e, p.origin);
165 avg_velocity += WarpZone_RefSys_TransformVelocity(p, e, p.velocity);
168 avg_origin *= (1.0 / n);
169 avg_velocity *= (1.0 / n);
172 return avg_origin; // nothing to do
174 // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
175 avg_dist = pow(vlen(e.origin - avg_origin), 2);
176 for(p = e; (p = p.queuenext) != e; )
177 avg_dist += pow(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2);
178 avg_dist *= (1.0 / n);
179 avg_dist = sqrt(avg_dist);
182 return avg_origin; // no change needed
186 e.velocity = avg_velocity;
187 UpdateCSQCProjectile(e);
188 for(p = e; (p = p.queuenext) != e; )
190 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
191 UpdateCSQCProjectile(p);
193 targ_origin = avg_origin + 1000000000 * normalize(avg_velocity); // HUUUUUUGE
197 w_crylink_linkjoin_time = avg_dist / jspeed;
198 targ_origin = avg_origin + w_crylink_linkjoin_time * avg_velocity;
200 e.velocity = (targ_origin - e.origin) * (1.0 / w_crylink_linkjoin_time);
201 UpdateCSQCProjectile(e);
202 for(p = e; (p = p.queuenext) != e; )
204 p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (1.0 / w_crylink_linkjoin_time));
205 UpdateCSQCProjectile(p);
209 // jspeed -> +infinity:
210 // w_crylink_linkjoin_time -> +0
211 // targ_origin -> avg_origin
212 // p->velocity -> HUEG towards center
214 // w_crylink_linkjoin_time -> +/- infinity
215 // targ_origin -> avg_velocity * +/- infinity
216 // p->velocity -> avg_velocity
217 // jspeed -> -infinity:
218 // w_crylink_linkjoin_time -> -0
219 // targ_origin -> avg_origin
220 // p->velocity -> HUEG away from center
223 W_Crylink_CheckLinks(e);
228 void W_Crylink_LinkJoinEffect_Think(void)
230 // is there at least 2 projectiles very close?
233 e = self.owner.crylink_lastgroup;
237 if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
239 for(p = e; (p = p.queuenext) != e; )
241 if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
246 float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
248 if(WEP_CVAR_BOTH(crylink, isprimary, joinexplode))
250 n /= WEP_CVAR_BOTH(crylink, isprimary, shots);
254 WEP_CVAR_BOTH(crylink, isprimary, joinexplode_damage) * n,
255 WEP_CVAR_BOTH(crylink, isprimary, joinexplode_edgedamage) * n,
256 WEP_CVAR_BOTH(crylink, isprimary, joinexplode_radius) * n,
259 WEP_CVAR_BOTH(crylink, isprimary, joinexplode_force) * n,
260 e.projectiledeathtype,
263 Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, self.origin, '0 0 0', n);
270 float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
272 entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, false);
273 float hit_friendly = 0;
278 if((head.takedamage != DAMAGE_NO) && (head.deadflag == DEAD_NO))
280 if(SAME_TEAM(head, projectile.realowner))
289 return (hit_enemy ? false : hit_friendly);
292 // NO bounce protection, as bounces are limited!
293 void W_Crylink_Touch(void)
297 float isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
301 a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
303 finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
307 f = WEP_CVAR_BOTH(crylink, isprimary, bouncedamagefactor);
311 float totaldamage = RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, self.projectiledeathtype, other);
313 if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(self, WEP_CVAR_BOTH(crylink, isprimary, radius)))))
315 if(self == self.realowner.crylink_lastgroup)
316 self.realowner.crylink_lastgroup = world;
317 W_Crylink_LinkExplode(self.queuenext, self);
318 self.classname = "spike_oktoremove";
325 W_Crylink_Dequeue(self);
329 self.cnt = self.cnt - 1;
330 self.angles = vectoangles(self.velocity);
332 self.projectiledeathtype |= HITTYPE_BOUNCE;
333 // commented out as it causes a little hitch...
335 // CSQCProjectile(proj, true, PROJECTILE_CRYLINK, true);
338 void W_Crylink_Fadethink(void)
340 W_Crylink_Dequeue(self);
344 void W_Crylink_Attack(Weapon thiswep)
346 float counter, shots;
347 entity proj, prevproj, firstproj;
349 vector forward, right, up;
352 W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(crylink, ammo));
354 maxdmg = WEP_CVAR_PRI(crylink, damage) * WEP_CVAR_PRI(crylink, shots);
355 maxdmg *= 1 + WEP_CVAR_PRI(crylink, bouncedamagefactor) * WEP_CVAR_PRI(crylink, bounces);
356 if(WEP_CVAR_PRI(crylink, joinexplode))
357 maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
359 W_SetupShot(self, false, 2, SND(CRYLINK_FIRE), CH_WEAPON_A, maxdmg);
364 shots = WEP_CVAR_PRI(crylink, shots);
365 Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
366 proj = prevproj = firstproj = world;
367 for(counter = 0; counter < shots; ++counter)
370 proj.reset = W_Crylink_Reset;
371 proj.realowner = proj.owner = self;
372 proj.classname = "spike";
373 proj.bot_dodge = true;
374 proj.bot_dodgerating = WEP_CVAR_PRI(crylink, damage);
376 proj.queuenext = proj;
377 proj.queueprev = proj;
379 else if(counter == 0) { // first projectile, store in firstproj for now
382 else if(counter == shots - 1) { // last projectile, link up with first projectile
383 prevproj.queuenext = proj;
384 firstproj.queueprev = proj;
385 proj.queuenext = firstproj;
386 proj.queueprev = prevproj;
388 else { // else link up with previous projectile
389 prevproj.queuenext = proj;
390 proj.queueprev = prevproj;
395 proj.movetype = MOVETYPE_BOUNCEMISSILE;
396 PROJECTILE_MAKETRIGGER(proj);
397 proj.projectiledeathtype = WEP_CRYLINK.m_id;
398 //proj.gravity = 0.001;
400 setorigin(proj, w_shotorg);
401 setsize(proj, '0 0 0', '0 0 0');
409 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
413 s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor;
414 W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, false);
415 proj.touch = W_Crylink_Touch;
417 proj.think = W_Crylink_Fadethink;
420 proj.fade_time = time + WEP_CVAR_PRI(crylink, middle_lifetime);
421 proj.fade_rate = 1 / WEP_CVAR_PRI(crylink, middle_fadetime);
422 proj.nextthink = time + WEP_CVAR_PRI(crylink, middle_lifetime) + WEP_CVAR_PRI(crylink, middle_fadetime);
426 proj.fade_time = time + WEP_CVAR_PRI(crylink, other_lifetime);
427 proj.fade_rate = 1 / WEP_CVAR_PRI(crylink, other_fadetime);
428 proj.nextthink = time + WEP_CVAR_PRI(crylink, other_lifetime) + WEP_CVAR_PRI(crylink, other_fadetime);
430 proj.teleport_time = time + WEP_CVAR_PRI(crylink, joindelay);
431 proj.cnt = WEP_CVAR_PRI(crylink, bounces);
432 //proj.scale = 1 + 1 * proj.cnt;
434 proj.angles = vectoangles(proj.velocity);
436 //proj.glow_size = 20;
438 proj.flags = FL_PROJECTILE;
439 proj.missile_flags = MIF_SPLASH;
441 CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
443 MUTATOR_CALLHOOK(EditProjectile, self, proj);
445 if(WEP_CVAR_PRI(crylink, joinspread) != 0)
447 self.crylink_lastgroup = proj;
448 W_Crylink_CheckLinks(proj);
449 self.crylink_waitrelease = 1;
453 void W_Crylink_Attack2(Weapon thiswep)
455 float counter, shots;
456 entity proj, prevproj, firstproj;
458 vector forward, right, up;
461 W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(crylink, ammo));
463 maxdmg = WEP_CVAR_SEC(crylink, damage) * WEP_CVAR_SEC(crylink, shots);
464 maxdmg *= 1 + WEP_CVAR_SEC(crylink, bouncedamagefactor) * WEP_CVAR_SEC(crylink, bounces);
465 if(WEP_CVAR_SEC(crylink, joinexplode))
466 maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
468 W_SetupShot(self, false, 2, SND(CRYLINK_FIRE2), CH_WEAPON_A, maxdmg);
473 shots = WEP_CVAR_SEC(crylink, shots);
474 Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
475 proj = prevproj = firstproj = world;
476 for(counter = 0; counter < shots; ++counter)
479 proj.reset = W_Crylink_Reset;
480 proj.realowner = proj.owner = self;
481 proj.classname = "spike";
482 proj.bot_dodge = true;
483 proj.bot_dodgerating = WEP_CVAR_SEC(crylink, damage);
485 proj.queuenext = proj;
486 proj.queueprev = proj;
488 else if(counter == 0) { // first projectile, store in firstproj for now
491 else if(counter == shots - 1) { // last projectile, link up with first projectile
492 prevproj.queuenext = proj;
493 firstproj.queueprev = proj;
494 proj.queuenext = firstproj;
495 proj.queueprev = prevproj;
497 else { // else link up with previous projectile
498 prevproj.queuenext = proj;
499 proj.queueprev = prevproj;
504 proj.movetype = MOVETYPE_BOUNCEMISSILE;
505 PROJECTILE_MAKETRIGGER(proj);
506 proj.projectiledeathtype = WEP_CRYLINK.m_id | HITTYPE_SECONDARY;
507 //proj.gravity = 0.001;
509 setorigin(proj, w_shotorg);
510 setsize(proj, '0 0 0', '0 0 0');
512 if(WEP_CVAR_SEC(crylink, spreadtype) == 1)
519 makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
523 s = s * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor;
524 s = w_shotdir + right * s.y + up * s.z;
528 s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor);
531 W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, false);
532 proj.touch = W_Crylink_Touch;
533 proj.think = W_Crylink_Fadethink;
534 if(counter == (shots - 1) / 2)
536 proj.fade_time = time + WEP_CVAR_SEC(crylink, middle_lifetime);
537 proj.fade_rate = 1 / WEP_CVAR_SEC(crylink, middle_fadetime);
538 proj.nextthink = time + WEP_CVAR_SEC(crylink, middle_lifetime) + WEP_CVAR_SEC(crylink, middle_fadetime);
542 proj.fade_time = time + WEP_CVAR_SEC(crylink, other_lifetime);
543 proj.fade_rate = 1 / WEP_CVAR_SEC(crylink, other_fadetime);
544 proj.nextthink = time + WEP_CVAR_SEC(crylink, other_lifetime) + WEP_CVAR_SEC(crylink, other_fadetime);
546 proj.teleport_time = time + WEP_CVAR_SEC(crylink, joindelay);
547 proj.cnt = WEP_CVAR_SEC(crylink, bounces);
548 //proj.scale = 1 + 1 * proj.cnt;
550 proj.angles = vectoangles(proj.velocity);
552 //proj.glow_size = 20;
554 proj.flags = FL_PROJECTILE;
555 proj.missile_flags = MIF_SPLASH;
557 CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
559 MUTATOR_CALLHOOK(EditProjectile, self, proj);
561 if(WEP_CVAR_SEC(crylink, joinspread) != 0)
563 self.crylink_lastgroup = proj;
564 W_Crylink_CheckLinks(proj);
565 self.crylink_waitrelease = 2;
569 METHOD(Crylink, wr_aim, void(entity thiswep))
573 self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
575 self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
577 METHOD(Crylink, wr_think, void(entity thiswep, entity actor, int slot, int fire))
579 if(autocvar_g_balance_crylink_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) { // forced reload
580 Weapon w = get_weaponinfo(actor.weapon);
586 if(actor.crylink_waitrelease != 1)
587 if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(crylink, refire)))
589 W_Crylink_Attack(thiswep);
590 weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(crylink, animtime), w_ready);
594 if((fire & 2) && autocvar_g_balance_crylink_secondary)
596 if(actor.crylink_waitrelease != 2)
597 if(weapon_prepareattack(thiswep, actor, true, WEP_CVAR_SEC(crylink, refire)))
599 W_Crylink_Attack2(thiswep);
600 weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR_SEC(crylink, animtime), w_ready);
604 if((actor.crylink_waitrelease == 1 && !(fire & 1)) || (actor.crylink_waitrelease == 2 && !(fire & 2)))
606 if(!actor.crylink_lastgroup || time > actor.crylink_lastgroup.teleport_time)
608 // fired and released now!
609 if(actor.crylink_lastgroup)
612 entity linkjoineffect;
613 float isprimary = (actor.crylink_waitrelease == 1);
615 pos = W_Crylink_LinkJoin(actor.crylink_lastgroup, WEP_CVAR_BOTH(crylink, isprimary, joinspread) * WEP_CVAR_BOTH(crylink, isprimary, speed));
617 linkjoineffect = spawn();
618 linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
619 linkjoineffect.classname = "linkjoineffect";
620 linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
621 linkjoineffect.owner = actor;
622 setorigin(linkjoineffect, pos);
624 actor.crylink_waitrelease = 0;
625 if(!thiswep.wr_checkammo1(thiswep) && !thiswep.wr_checkammo2(thiswep))
626 if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
629 actor.cnt = WEP_CRYLINK.m_id;
630 actor.switchweapon = w_getbestweapon(actor);
635 METHOD(Crylink, wr_init, void(entity thiswep))
637 CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
639 METHOD(Crylink, wr_checkammo1, bool(entity thiswep))
642 // don't "run out of ammo" and switch weapons while waiting for release
643 if(self.crylink_lastgroup && self.crylink_waitrelease)
646 float ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_PRI(crylink, ammo);
647 ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_PRI(crylink, ammo);
650 METHOD(Crylink, wr_checkammo2, bool(entity thiswep))
653 // don't "run out of ammo" and switch weapons while waiting for release
654 if(self.crylink_lastgroup && self.crylink_waitrelease)
657 float ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_SEC(crylink, ammo);
658 ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_SEC(crylink, ammo);
661 METHOD(Crylink, wr_config, void(entity thiswep))
663 CRYLINK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
665 METHOD(Crylink, wr_reload, void(entity thiswep))
667 W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD));
669 METHOD(Crylink, wr_suicidemessage, int(entity thiswep))
671 return WEAPON_CRYLINK_SUICIDE;
673 METHOD(Crylink, wr_killmessage, int(entity thiswep))
675 return WEAPON_CRYLINK_MURDER;
679 METHOD(Crylink, wr_impacteffect, void(entity thiswep))
683 org2 = w_org + w_backoff * 2;
684 if(w_deathtype & HITTYPE_SECONDARY)
686 pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1);
688 sound(self, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM);
692 pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1);
694 sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM);