1 #include "shockwave.qh"
3 REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
6 // enable when shockwave replaces shotgun
8 METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e))
10 //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
11 if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
13 return WEP_MACHINEGUN;
19 const float MAX_SHOCKWAVE_HITS = 10;
20 //#define DEBUG_SHOCKWAVE
23 .entity swing_alreadyhit;
24 .float shockwave_blasttime;
25 entity shockwave_hit[MAX_SHOCKWAVE_HITS];
26 float shockwave_hit_damage[MAX_SHOCKWAVE_HITS];
27 vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
30 void W_Shockwave_Melee_Think(entity this)
33 float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
37 // check to see if we can still continue, otherwise give up now
38 if(IS_DEAD(this.realowner) && WEP_CVAR(shockwave, melee_no_doubleslap))
44 // set start time of melee
48 W_PlayStrengthSound(this.realowner);
51 // update values for v_* vectors
52 makevectors(this.realowner.v_angle);
54 // calculate swing percentage based on time
55 meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor(this.realowner);
56 swing = bound(0, (this.cnt + meleetime - time) / meleetime, 10);
57 f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
59 // perform the traces needed for this frame
60 for(i=this.swing_prev; i < f; ++i)
62 swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
64 targpos = (this.realowner.origin + this.realowner.view_ofs
65 + (v_forward * WEP_CVAR(shockwave, melee_range))
66 + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
67 + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
69 WarpZone_traceline_antilag(
71 (this.realowner.origin + this.realowner.view_ofs),
75 ANTILAG_LATENCY(this.realowner)
78 // draw lightning beams for debugging
79 #ifdef DEBUG_SHOCKWAVE
80 te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
81 te_customflash(targpos, 40, 2, '1 1 1');
84 is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
86 if((trace_fraction < 1) // if trace is good, apply the damage and remove this if necessary
87 && (trace_ent.takedamage == DAMAGE_AIM)
88 && (trace_ent != this.swing_alreadyhit)
89 && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
91 target_victim = trace_ent; // so it persists through other calls
93 if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught
94 swing_damage = (WEP_CVAR(shockwave, melee_damage) * min(1, swing_factor + 1));
96 swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage) * min(1, swing_factor + 1));
98 // trigger damage with this calculated info
104 (WEP_SHOCKWAVE.m_id | HITTYPE_SECONDARY),
105 this.weaponentity_fld,
106 (this.realowner.origin + this.realowner.view_ofs),
107 (v_forward * WEP_CVAR(shockwave, melee_force))
111 if(accuracy_isgooddamage(this.realowner, target_victim))
112 { accuracy_add(this.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
114 #ifdef DEBUG_SHOCKWAVE
116 "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.",
117 this.realowner.netname,
118 target_victim.netname,
125 // allow multiple hits with one swing, but not against the same player twice
126 if(WEP_CVAR(shockwave, melee_multihit))
128 this.swing_alreadyhit = target_victim;
129 continue; // move along to next trace
139 if(time >= this.cnt + meleetime)
149 this.nextthink = time;
153 void W_Shockwave_Melee(Weapon thiswep, entity actor, .entity weaponentity, int fire)
155 sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM);
156 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
158 entity meleetemp = new_pure(meleetemp);
159 meleetemp.owner = meleetemp.realowner = actor;
160 setthink(meleetemp, W_Shockwave_Melee_Think);
161 meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor(actor);
162 meleetemp.weaponentity_fld = weaponentity;
163 W_SetupShot_Range(actor, weaponentity, true, 0, SND_Null, 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range), thiswep.m_id | HITTYPE_SECONDARY);
166 // SHOCKWAVE ATTACK MODE
167 float W_Shockwave_Attack_CheckSpread(
169 vector nearest_on_line,
171 vector attack_endpos)
174 float distance_of_attack = vlen(sw_shotorg - attack_endpos);
175 float distance_from_line = vlen(targetorg - nearest_on_line);
177 spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
180 (WEP_CVAR(shockwave, blast_spread_min) * (1 - spreadlimit))
182 (WEP_CVAR(shockwave, blast_spread_max) * spreadlimit)
186 (spreadlimit && (distance_from_line <= spreadlimit))
188 ((vlen(normalize(targetorg - sw_shotorg) - normalize(attack_endpos - sw_shotorg)) * RAD2DEG) <= 90)
190 { return bound(0, (distance_from_line / spreadlimit), 1); }
195 float W_Shockwave_Attack_IsVisible(
198 vector nearest_on_line,
200 vector attack_endpos)
202 vector nearest_to_attacker = head.WarpZone_findradius_nearest;
203 vector center = (head.origin + (head.mins + head.maxs) * 0.5);
207 // STEP ONE: Check if the nearest point is clear
208 if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
210 WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, actor);
211 if(trace_fraction == 1) { return true; } // yes, the nearest point is clear and we can allow the damage
214 // STEP TWO: Check if shotorg to center point is clear
215 if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
217 WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, actor);
218 if(trace_fraction == 1) { return true; } // yes, the center point is clear and we can allow the damage
221 // STEP THREE: Check each corner to see if they are clear
224 corner = get_corner_position(head, i);
225 if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
227 WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, actor);
228 if(trace_fraction == 1) { return true; } // yes, this corner is clear and we can allow the damage
235 float W_Shockwave_Attack_CheckHit(
241 if(!head) { return false; }
244 for(i = 0; i <= queue; ++i)
246 if(shockwave_hit[i] == head)
248 if(vlen2(final_force) > vlen2(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
249 if(final_damage > shockwave_hit_damage[i]) { shockwave_hit_damage[i] = final_damage; }
254 shockwave_hit[queue] = head;
255 shockwave_hit_force[queue] = final_force;
256 shockwave_hit_damage[queue] = final_damage;
260 void W_Shockwave_Send(entity actor)
262 WriteHeader(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
263 WriteVector(MSG_BROADCAST, w_shotorg);
264 WriteVector(MSG_BROADCAST, w_shotdir);
265 WriteShort(MSG_BROADCAST, WEP_CVAR(shockwave, blast_distance));
266 WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_max), 255));
267 WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_min), 255));
268 WriteByte(MSG_BROADCAST, etof(actor));
271 void W_Shockwave_Attack(Weapon thiswep, entity actor, .entity weaponentity)
274 float multiplier, multiplier_from_accuracy, multiplier_from_distance;
276 vector final_force, center, vel;
281 // set up the shot direction
282 W_SetupShot(actor, weaponentity, true, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage), thiswep.m_id);
283 vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
284 WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, actor);
285 vector attack_hitpos = trace_endpos;
286 float distance_to_end = vlen(w_shotorg - attack_endpos);
287 float distance_to_hit = vlen(w_shotorg - attack_hitpos);
288 //entity transform = WarpZone_trace_transform;
290 // do the firing effect now
291 W_Shockwave_Send(actor);
294 WEP_CVAR(shockwave, blast_splash_damage),
295 WEP_CVAR(shockwave, blast_splash_edgedamage),
296 WEP_CVAR(shockwave, blast_splash_radius),
297 w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
303 // splash damage/jumping trace
304 head = WarpZone_FindRadius(
307 WEP_CVAR(shockwave, blast_splash_radius),
308 WEP_CVAR(shockwave, blast_jump_radius)
313 float lag = ((IS_REAL_CLIENT(actor)) ? ANTILAG_LATENCY(actor) : 0);
314 bool noantilag = ((IS_CLIENT(actor)) ? CS(actor).cvar_cl_noantilag : false);
317 if(autocvar_g_antilag == 0 || noantilag)
318 lag = 0; // only do hitscan, but no antilag
320 antilag_takeback_all(actor, lag);
326 float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
328 if((head == actor) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
330 // ========================
331 // BLAST JUMP CALCULATION
332 // ========================
334 // calculate importance of distance and accuracy for this attack
335 multiplier_from_accuracy = (1 -
337 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_jump_radius)))
342 multiplier_from_distance = (1 -
344 min(1, (distance_to_hit / distance_to_end))
351 WEP_CVAR(shockwave, blast_jump_multiplier_min),
353 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_jump_multiplier_accuracy))
355 (multiplier_from_distance * WEP_CVAR(shockwave, blast_jump_multiplier_distance))
359 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
362 (WEP_CVAR(shockwave, blast_jump_damage) * multiplier)
364 (WEP_CVAR(shockwave, blast_jump_edgedamage) * (1 - multiplier))
367 // figure out the direction of force
368 vel = normalize(vec2(head.velocity));
371 bound(0, (vlen(vel) / autocvar_sv_maxspeed), 1)
373 WEP_CVAR(shockwave, blast_jump_force_velocitybias)
375 final_force = normalize((CENTER_OR_VIEWOFS(head) - attack_hitpos) + vel);
377 // now multiply the direction by force units
378 final_force *= (WEP_CVAR(shockwave, blast_jump_force) * multiplier);
379 final_force.z *= WEP_CVAR(shockwave, blast_jump_force_zscale);
381 // trigger damage with this calculated info
393 #ifdef DEBUG_SHOCKWAVE
395 "SELF HIT: multiplier = %f, damage = %f, force = %f... "
396 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
400 multiplier_from_accuracy,
401 multiplier_from_distance
405 else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
407 // ==========================
408 // BLAST SPLASH CALCULATION
409 // ==========================
411 // calculate importance of distance and accuracy for this attack
412 multiplier_from_accuracy = (1 -
414 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_splash_radius)))
419 multiplier_from_distance = (1 -
421 min(1, (distance_to_hit / distance_to_end))
428 WEP_CVAR(shockwave, blast_splash_multiplier_min),
430 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_splash_multiplier_accuracy))
432 (multiplier_from_distance * WEP_CVAR(shockwave, blast_splash_multiplier_distance))
436 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
439 (WEP_CVAR(shockwave, blast_splash_damage) * multiplier)
441 (WEP_CVAR(shockwave, blast_splash_edgedamage) * (1 - multiplier))
444 // figure out the direction of force
445 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias));
446 final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force));
447 //te_lightning2(NULL, attack_hitpos, (attack_hitpos + (final_force * 200)));
449 // now multiply the direction by force units
450 final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier);
451 final_force.z *= WEP_CVAR(shockwave, blast_force_zscale);
453 // queue damage with this calculated info
454 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
456 #ifdef DEBUG_SHOCKWAVE
458 "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
459 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
463 multiplier_from_accuracy,
464 multiplier_from_distance
473 head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), false);
476 if((head != actor) && head.takedamage)
478 // ========================
479 // BLAST CONE CALCULATION
480 // ========================
482 // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
483 center = CENTER_OR_VIEWOFS(head);
485 // find the closest point on the enemy to the center of the attack
486 float h; // hypotenuse, which is the distance between attacker to head
487 float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
489 h = vlen(center - actor.origin);
490 a = h * (normalize(center - actor.origin) * w_shotdir);
491 // WEAPONTODO: replace with simpler method
493 vector nearest_on_line = (w_shotorg + a * w_shotdir);
494 vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
496 if((vdist(head.WarpZone_findradius_dist, <=, WEP_CVAR(shockwave, blast_distance)))
497 && (W_Shockwave_Attack_IsVisible(actor, head, nearest_on_line, w_shotorg, attack_endpos)))
499 // calculate importance of distance and accuracy for this attack
500 multiplier_from_accuracy = (1 -
501 W_Shockwave_Attack_CheckSpread(
508 multiplier_from_distance = (1 -
510 min(1, (vlen(head.WarpZone_findradius_dist) / distance_to_end))
517 WEP_CVAR(shockwave, blast_multiplier_min),
519 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_multiplier_accuracy))
521 (multiplier_from_distance * WEP_CVAR(shockwave, blast_multiplier_distance))
525 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
528 (WEP_CVAR(shockwave, blast_damage) * multiplier)
530 (WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier))
533 // figure out the direction of force
534 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
535 final_force = normalize(center - (nearest_on_line - final_force));
536 //te_lightning2(NULL, nearest_on_line, (attack_hitpos + (final_force * 200)));
538 // now multiply the direction by force units
539 final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
540 final_force.z *= WEP_CVAR(shockwave, blast_force_zscale);
542 // queue damage with this calculated info
543 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
545 #ifdef DEBUG_SHOCKWAVE
547 "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
548 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
552 multiplier_from_accuracy,
553 multiplier_from_distance
561 for(i = 1; i <= queue; ++i)
563 head = shockwave_hit[i-1];
564 final_force = shockwave_hit_force[i-1];
565 final_damage = shockwave_hit_damage[i-1];
578 if(accuracy_isgooddamage(actor, head))
579 accuracy_add(actor, thiswep, 0, final_damage);
581 #ifdef DEBUG_SHOCKWAVE
583 "SHOCKWAVE by %s: damage = %f, force = %f.",
590 shockwave_hit[i-1] = NULL;
591 shockwave_hit_force[i-1] = '0 0 0';
592 shockwave_hit_damage[i-1] = 0;
596 antilag_restore_all(actor);
599 METHOD(Shockwave, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
601 if(vdist(actor.origin - actor.enemy.origin, <=, WEP_CVAR(shockwave, melee_range)))
602 { PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); }
604 { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); }
606 METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
610 if(time >= actor.(weaponentity).shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary
612 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(shockwave, blast_animtime)))
614 W_Shockwave_Attack(thiswep, actor, weaponentity);
615 actor.(weaponentity).shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor(actor);
616 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
622 //if(actor.clip_load >= 0) // we are not currently reloading
623 if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(shockwave, melee_refire)))
625 // attempt forcing playback of the anim by switching to another anim (that we never play) here...
626 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, W_Shockwave_Melee);
630 METHOD(Shockwave, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
632 return true; // infinite ammo
634 METHOD(Shockwave, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
636 // shockwave has infinite ammo
639 METHOD(Shockwave, wr_suicidemessage, Notification(entity thiswep))
641 return WEAPON_THINKING_WITH_PORTALS;
643 METHOD(Shockwave, wr_killmessage, Notification(entity thiswep))
645 if(w_deathtype & HITTYPE_SECONDARY)
646 return WEAPON_SHOCKWAVE_MURDER_SLAP;
648 return WEAPON_SHOCKWAVE_MURDER;
653 // WEAPONTODO: add client side settings for these
654 const float SW_MAXALPHA = 0.5;
655 const float SW_FADETIME = 0.4;
656 const float SW_DISTTOMIN = 200;
657 void Draw_Shockwave(entity this)
659 // fading/removal control
660 float a = bound(0, (SW_MAXALPHA - ((time - this.sw_time) / SW_FADETIME)), SW_MAXALPHA);
661 if(a < ALPHA_MIN_VISIBLE) { delete(this); }
663 // WEAPONTODO: save this only once when creating the entity
664 vector sw_color = entcs_GetColor(this.sv_entnum - 1); // Team_ColorRGB(entcs_GetTeam(this.sv_entnum));
666 // WEAPONTODO: trace to find what we actually hit
667 vector endpos = (this.sw_shotorg + (this.sw_shotdir * this.sw_distance));
669 vector _forward, right, up;
670 VECTOR_VECTORS(this.sw_shotdir, _forward, right, up);
672 // WEAPONTODO: combine and simplify these calculations
673 vector min_end = ((this.sw_shotorg + (this.sw_shotdir * SW_DISTTOMIN)) + (up * this.sw_spread_min));
674 vector max_end = (endpos + (up * this.sw_spread_max));
675 float spread_to_min = vlen(normalize(min_end - this.sw_shotorg) - this.sw_shotdir);
676 float spread_to_max = vlen(normalize(max_end - min_end) - this.sw_shotdir);
678 vector first_min_end = '0 0 0', prev_min_end = '0 0 0', new_min_end = '0 0 0';
679 vector first_max_end = '0 0 0', prev_max_end = '0 0 0', new_max_end = '0 0 0';
680 float new_max_dist, new_min_dist;
682 vector deviation, angle = '0 0 0';
683 float counter, divisions = 20;
684 for(counter = 0; counter < divisions; ++counter)
686 // perfect circle effect lines
687 makevectors('0 360 0' * (0.75 + (counter - 0.5) / divisions));
688 angle.y = v_forward.x;
689 angle.z = v_forward.y;
691 // first do the spread_to_min effect
692 deviation = angle * spread_to_min;
693 deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
694 new_min_dist = SW_DISTTOMIN;
695 new_min_end = (this.sw_shotorg + (deviation * new_min_dist));
696 //te_lightning2(NULL, new_min_end, this.sw_shotorg);
698 // then calculate spread_to_max effect
699 deviation = angle * spread_to_max;
700 deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
701 new_max_dist = vlen(new_min_end - endpos);
702 new_max_end = (new_min_end + (deviation * new_max_dist));
703 //te_lightning2(NULL, new_end, prev_min_end);
708 first_min_end = new_min_end;
709 first_max_end = new_max_end;
714 // draw from shot origin to min spread radius
715 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
716 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
717 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
718 R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a);
721 // draw from min spread radius to max spread radius
722 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
723 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
724 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
725 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
726 R_PolygonVertex(new_max_end, '0 0 0', sw_color, a);
730 prev_min_end = new_min_end;
731 prev_max_end = new_max_end;
733 // last division only
734 if((counter + 1) == divisions)
736 // draw from shot origin to min spread radius
737 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
738 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
739 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
740 R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a);
743 // draw from min spread radius to max spread radius
744 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
745 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
746 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
747 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
748 R_PolygonVertex(first_max_end, '0 0 0', sw_color, a);
754 NET_HANDLE(TE_CSQC_SHOCKWAVEPARTICLE, bool isNew)
756 Net_ReadShockwaveParticle();
760 void Net_ReadShockwaveParticle()
764 shockwave.draw = Draw_Shockwave;
765 IL_PUSH(g_drawables, shockwave);
767 shockwave.sw_shotorg = ReadVector();
768 shockwave.sw_shotdir = ReadVector();
770 shockwave.sw_distance = ReadShort();
771 shockwave.sw_spread_max = ReadByte();
772 shockwave.sw_spread_min = ReadByte();
774 shockwave.sv_entnum = ReadByte();
776 shockwave.sw_time = time;
779 METHOD(Shockwave, wr_impacteffect, void(entity thiswep, entity actor))
781 // handled by Net_ReadShockwaveParticle
783 //org2 = w_org + w_backoff * 2;
784 //pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);