1 #include "shockwave.qh"
3 REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
7 const float MAX_SHOCKWAVE_HITS = 10;
8 //#define DEBUG_SHOCKWAVE
11 .entity swing_alreadyhit;
12 .float shockwave_blasttime;
13 entity shockwave_hit[MAX_SHOCKWAVE_HITS];
14 float shockwave_hit_damage[MAX_SHOCKWAVE_HITS];
15 vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
18 void W_Shockwave_Melee_Think(entity this)
21 float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
25 // check to see if we can still continue, otherwise give up now
26 if(IS_DEAD(this.realowner) && WEP_CVAR(shockwave, melee_no_doubleslap))
32 // set start time of melee
36 W_PlayStrengthSound(this.realowner);
39 // update values for v_* vectors
40 makevectors(this.realowner.v_angle);
42 // calculate swing percentage based on time
43 meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor(this.realowner);
44 swing = bound(0, (this.cnt + meleetime - time) / meleetime, 10);
45 f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
47 // perform the traces needed for this frame
48 for(i=this.swing_prev; i < f; ++i)
50 swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
52 targpos = (this.realowner.origin + this.realowner.view_ofs
53 + (v_forward * WEP_CVAR(shockwave, melee_range))
54 + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
55 + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
57 WarpZone_traceline_antilag(
59 (this.realowner.origin + this.realowner.view_ofs),
63 ANTILAG_LATENCY(this.realowner)
66 // draw lightning beams for debugging
67 #ifdef DEBUG_SHOCKWAVE
68 te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
69 te_customflash(targpos, 40, 2, '1 1 1');
72 is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
74 if((trace_fraction < 1) // if trace is good, apply the damage and remove this if necessary
75 && (trace_ent.takedamage == DAMAGE_AIM)
76 && (trace_ent != this.swing_alreadyhit)
77 && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
79 target_victim = trace_ent; // so it persists through other calls
81 if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught
82 swing_damage = (WEP_CVAR(shockwave, melee_damage) * min(1, swing_factor + 1));
84 swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage) * min(1, swing_factor + 1));
86 // trigger damage with this calculated info
92 (WEP_SHOCKWAVE.m_id | HITTYPE_SECONDARY),
93 this.weaponentity_fld,
94 (this.realowner.origin + this.realowner.view_ofs),
95 (v_forward * WEP_CVAR(shockwave, melee_force))
99 if(accuracy_isgooddamage(this.realowner, target_victim))
100 { accuracy_add(this.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
102 #ifdef DEBUG_SHOCKWAVE
104 "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.",
105 this.realowner.netname,
106 target_victim.netname,
113 // allow multiple hits with one swing, but not against the same player twice
114 if(WEP_CVAR(shockwave, melee_multihit))
116 this.swing_alreadyhit = target_victim;
117 continue; // move along to next trace
127 if(time >= this.cnt + meleetime)
137 this.nextthink = time;
141 void W_Shockwave_Melee(Weapon thiswep, entity actor, .entity weaponentity, int fire)
143 sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM);
144 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
146 entity meleetemp = new_pure(meleetemp);
147 meleetemp.owner = meleetemp.realowner = actor;
148 setthink(meleetemp, W_Shockwave_Melee_Think);
149 meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor(actor);
150 meleetemp.weaponentity_fld = weaponentity;
151 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);
154 // SHOCKWAVE ATTACK MODE
155 float W_Shockwave_Attack_CheckSpread(
157 vector nearest_on_line,
159 vector attack_endpos)
162 float distance_of_attack = vlen(sw_shotorg - attack_endpos);
163 float distance_from_line = vlen(targetorg - nearest_on_line);
165 spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
168 (WEP_CVAR(shockwave, blast_spread_min) * (1 - spreadlimit))
170 (WEP_CVAR(shockwave, blast_spread_max) * spreadlimit)
174 (spreadlimit && (distance_from_line <= spreadlimit))
176 ((vlen(normalize(targetorg - sw_shotorg) - normalize(attack_endpos - sw_shotorg)) * RAD2DEG) <= 90)
178 { return bound(0, (distance_from_line / spreadlimit), 1); }
183 float W_Shockwave_Attack_IsVisible(
186 vector nearest_on_line,
188 vector attack_endpos)
190 vector nearest_to_attacker = head.WarpZone_findradius_nearest;
191 vector center = (head.origin + (head.mins + head.maxs) * 0.5);
195 // STEP ONE: Check if the nearest point is clear
196 if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
198 WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, actor);
199 if(trace_fraction == 1) { return true; } // yes, the nearest point is clear and we can allow the damage
202 // STEP TWO: Check if shotorg to center point is clear
203 if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
205 WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, actor);
206 if(trace_fraction == 1) { return true; } // yes, the center point is clear and we can allow the damage
209 // STEP THREE: Check each corner to see if they are clear
212 corner = get_corner_position(head, i);
213 if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
215 WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, actor);
216 if(trace_fraction == 1) { return true; } // yes, this corner is clear and we can allow the damage
223 float W_Shockwave_Attack_CheckHit(
229 if(!head) { return false; }
232 for(i = 0; i <= queue; ++i)
234 if(shockwave_hit[i] == head)
236 if(vlen2(final_force) > vlen2(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
237 if(final_damage > shockwave_hit_damage[i]) { shockwave_hit_damage[i] = final_damage; }
242 shockwave_hit[queue] = head;
243 shockwave_hit_force[queue] = final_force;
244 shockwave_hit_damage[queue] = final_damage;
248 void W_Shockwave_Send(entity actor)
250 WriteHeader(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
251 WriteVector(MSG_BROADCAST, w_shotorg);
252 WriteVector(MSG_BROADCAST, w_shotdir);
253 WriteShort(MSG_BROADCAST, WEP_CVAR(shockwave, blast_distance));
254 WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_max), 255));
255 WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_min), 255));
256 WriteByte(MSG_BROADCAST, etof(actor));
259 void W_Shockwave_Attack(Weapon thiswep, entity actor, .entity weaponentity)
262 float multiplier, multiplier_from_accuracy, multiplier_from_distance;
264 vector final_force, center, vel;
269 // set up the shot direction
270 W_SetupShot(actor, weaponentity, true, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage), thiswep.m_id);
271 vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
272 WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, actor);
273 vector attack_hitpos = trace_endpos;
274 float distance_to_end = vlen(w_shotorg - attack_endpos);
275 float distance_to_hit = vlen(w_shotorg - attack_hitpos);
276 //entity transform = WarpZone_trace_transform;
278 // do the firing effect now
279 W_Shockwave_Send(actor);
282 WEP_CVAR(shockwave, blast_splash_damage),
283 WEP_CVAR(shockwave, blast_splash_edgedamage),
284 WEP_CVAR(shockwave, blast_splash_radius),
285 w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
291 // splash damage/jumping trace
292 head = WarpZone_FindRadius(
295 WEP_CVAR(shockwave, blast_splash_radius),
296 WEP_CVAR(shockwave, blast_jump_radius)
301 float lag = ((IS_REAL_CLIENT(actor)) ? ANTILAG_LATENCY(actor) : 0);
302 bool noantilag = ((IS_CLIENT(actor)) ? CS_CVAR(actor).cvar_cl_noantilag : false);
305 if(autocvar_g_antilag == 0 || noantilag)
306 lag = 0; // only do hitscan, but no antilag
308 antilag_takeback_all(actor, lag);
314 float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
316 if((head == actor) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
318 // ========================
319 // BLAST JUMP CALCULATION
320 // ========================
322 // calculate importance of distance and accuracy for this attack
323 multiplier_from_accuracy = (1 -
325 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_jump_radius)))
330 multiplier_from_distance = (1 -
332 min(1, (distance_to_hit / distance_to_end))
339 WEP_CVAR(shockwave, blast_jump_multiplier_min),
341 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_jump_multiplier_accuracy))
343 (multiplier_from_distance * WEP_CVAR(shockwave, blast_jump_multiplier_distance))
347 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
350 (WEP_CVAR(shockwave, blast_jump_damage) * multiplier)
352 (WEP_CVAR(shockwave, blast_jump_edgedamage) * (1 - multiplier))
355 // figure out the direction of force
356 vel = normalize(vec2(head.velocity));
359 bound(0, (vlen(vel) / autocvar_sv_maxspeed), 1)
361 WEP_CVAR(shockwave, blast_jump_force_velocitybias)
363 final_force = normalize((CENTER_OR_VIEWOFS(head) - attack_hitpos) + vel);
365 // now multiply the direction by force units
366 final_force *= (WEP_CVAR(shockwave, blast_jump_force) * multiplier);
367 final_force.z *= WEP_CVAR(shockwave, blast_jump_force_zscale);
369 // trigger damage with this calculated info
381 #ifdef DEBUG_SHOCKWAVE
383 "SELF HIT: multiplier = %f, damage = %f, force = %f... "
384 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
388 multiplier_from_accuracy,
389 multiplier_from_distance
393 else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
395 // ==========================
396 // BLAST SPLASH CALCULATION
397 // ==========================
399 // calculate importance of distance and accuracy for this attack
400 multiplier_from_accuracy = (1 -
402 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_splash_radius)))
407 multiplier_from_distance = (1 -
409 min(1, (distance_to_hit / distance_to_end))
416 WEP_CVAR(shockwave, blast_splash_multiplier_min),
418 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_splash_multiplier_accuracy))
420 (multiplier_from_distance * WEP_CVAR(shockwave, blast_splash_multiplier_distance))
424 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
427 (WEP_CVAR(shockwave, blast_splash_damage) * multiplier)
429 (WEP_CVAR(shockwave, blast_splash_edgedamage) * (1 - multiplier))
432 // figure out the direction of force
433 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias));
434 final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force));
435 //te_lightning2(NULL, attack_hitpos, (attack_hitpos + (final_force * 200)));
437 // now multiply the direction by force units
438 final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier);
439 final_force.z *= WEP_CVAR(shockwave, blast_force_zscale);
441 // queue damage with this calculated info
442 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
444 #ifdef DEBUG_SHOCKWAVE
446 "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
447 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
451 multiplier_from_accuracy,
452 multiplier_from_distance
461 head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), false);
464 if((head != actor) && head.takedamage)
466 // ========================
467 // BLAST CONE CALCULATION
468 // ========================
470 // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in damage.qc)
471 center = CENTER_OR_VIEWOFS(head);
473 // find the closest point on the enemy to the center of the attack
474 float h; // hypotenuse, which is the distance between attacker to head
475 float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
477 h = vlen(center - actor.origin);
478 a = h * (normalize(center - actor.origin) * w_shotdir);
479 // WEAPONTODO: replace with simpler method
481 vector nearest_on_line = (w_shotorg + a * w_shotdir);
482 vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
484 if((vdist(head.WarpZone_findradius_dist, <=, WEP_CVAR(shockwave, blast_distance)))
485 && (W_Shockwave_Attack_IsVisible(actor, head, nearest_on_line, w_shotorg, attack_endpos)))
487 // calculate importance of distance and accuracy for this attack
488 multiplier_from_accuracy = (1 -
489 W_Shockwave_Attack_CheckSpread(
496 multiplier_from_distance = (1 -
498 min(1, (vlen(head.WarpZone_findradius_dist) / distance_to_end))
505 WEP_CVAR(shockwave, blast_multiplier_min),
507 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_multiplier_accuracy))
509 (multiplier_from_distance * WEP_CVAR(shockwave, blast_multiplier_distance))
513 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
516 (WEP_CVAR(shockwave, blast_damage) * multiplier)
518 (WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier))
521 // figure out the direction of force
522 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
523 final_force = normalize(center - (nearest_on_line - final_force));
524 //te_lightning2(NULL, nearest_on_line, (attack_hitpos + (final_force * 200)));
526 // now multiply the direction by force units
527 final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
528 final_force.z *= WEP_CVAR(shockwave, blast_force_zscale);
530 // queue damage with this calculated info
531 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
533 #ifdef DEBUG_SHOCKWAVE
535 "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
536 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
540 multiplier_from_accuracy,
541 multiplier_from_distance
549 for(i = 1; i <= queue; ++i)
551 head = shockwave_hit[i-1];
552 final_force = shockwave_hit_force[i-1];
553 final_damage = shockwave_hit_damage[i-1];
566 if(accuracy_isgooddamage(actor, head))
567 accuracy_add(actor, thiswep, 0, final_damage);
569 #ifdef DEBUG_SHOCKWAVE
571 "SHOCKWAVE by %s: damage = %f, force = %f.",
578 shockwave_hit[i-1] = NULL;
579 shockwave_hit_force[i-1] = '0 0 0';
580 shockwave_hit_damage[i-1] = 0;
584 antilag_restore_all(actor);
587 METHOD(Shockwave, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
589 if(vdist(actor.origin - actor.enemy.origin, <=, WEP_CVAR(shockwave, melee_range)))
590 { PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); }
592 { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); }
594 METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
598 if(time >= actor.(weaponentity).shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary
600 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(shockwave, blast_animtime)))
602 W_Shockwave_Attack(thiswep, actor, weaponentity);
603 actor.(weaponentity).shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor(actor);
604 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
610 //if(actor.clip_load >= 0) // we are not currently reloading
611 if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(shockwave, melee_refire)))
613 // attempt forcing playback of the anim by switching to another anim (that we never play) here...
614 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, W_Shockwave_Melee);
618 METHOD(Shockwave, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
620 return true; // infinite ammo
622 METHOD(Shockwave, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
624 // shockwave has infinite ammo
627 METHOD(Shockwave, wr_suicidemessage, Notification(entity thiswep))
629 return WEAPON_THINKING_WITH_PORTALS;
631 METHOD(Shockwave, wr_killmessage, Notification(entity thiswep))
633 if(w_deathtype & HITTYPE_SECONDARY)
634 return WEAPON_SHOCKWAVE_MURDER_SLAP;
636 return WEAPON_SHOCKWAVE_MURDER;
641 // WEAPONTODO: add client side settings for these
642 const float SW_MAXALPHA = 0.5;
643 const float SW_FADETIME = 0.4;
644 const float SW_DISTTOMIN = 200;
645 void Draw_Shockwave(entity this)
647 // fading/removal control
648 float a = bound(0, (SW_MAXALPHA - ((time - this.sw_time) / SW_FADETIME)), SW_MAXALPHA);
649 if(a < ALPHA_MIN_VISIBLE) { delete(this); }
651 // WEAPONTODO: save this only once when creating the entity
652 vector sw_color = entcs_GetColor(this.sv_entnum - 1); // Team_ColorRGB(entcs_GetTeam(this.sv_entnum));
654 // WEAPONTODO: trace to find what we actually hit
655 vector endpos = (this.sw_shotorg + (this.sw_shotdir * this.sw_distance));
657 vector _forward, right, up;
658 VECTOR_VECTORS(this.sw_shotdir, _forward, right, up);
660 // WEAPONTODO: combine and simplify these calculations
661 vector min_end = ((this.sw_shotorg + (this.sw_shotdir * SW_DISTTOMIN)) + (up * this.sw_spread_min));
662 vector max_end = (endpos + (up * this.sw_spread_max));
663 float spread_to_min = vlen(normalize(min_end - this.sw_shotorg) - this.sw_shotdir);
664 float spread_to_max = vlen(normalize(max_end - min_end) - this.sw_shotdir);
666 vector first_min_end = '0 0 0', prev_min_end = '0 0 0', new_min_end = '0 0 0';
667 vector first_max_end = '0 0 0', prev_max_end = '0 0 0', new_max_end = '0 0 0';
668 float new_max_dist, new_min_dist;
670 vector deviation, angle = '0 0 0';
671 float counter, divisions = 20;
672 for(counter = 0; counter < divisions; ++counter)
674 // perfect circle effect lines
675 makevectors('0 360 0' * (0.75 + (counter - 0.5) / divisions));
676 angle.y = v_forward.x;
677 angle.z = v_forward.y;
679 // first do the spread_to_min effect
680 deviation = angle * spread_to_min;
681 deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
682 new_min_dist = SW_DISTTOMIN;
683 new_min_end = (this.sw_shotorg + (deviation * new_min_dist));
684 //te_lightning2(NULL, new_min_end, this.sw_shotorg);
686 // then calculate spread_to_max effect
687 deviation = angle * spread_to_max;
688 deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
689 new_max_dist = vlen(new_min_end - endpos);
690 new_max_end = (new_min_end + (deviation * new_max_dist));
691 //te_lightning2(NULL, new_end, prev_min_end);
696 first_min_end = new_min_end;
697 first_max_end = new_max_end;
702 // draw from shot origin to min spread radius
703 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
704 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
705 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
706 R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a);
709 // draw from min spread radius to max spread radius
710 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
711 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
712 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
713 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
714 R_PolygonVertex(new_max_end, '0 0 0', sw_color, a);
718 prev_min_end = new_min_end;
719 prev_max_end = new_max_end;
721 // last division only
722 if((counter + 1) == divisions)
724 // draw from shot origin to min spread radius
725 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
726 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
727 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
728 R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a);
731 // draw from min spread radius to max spread radius
732 R_BeginPolygon("", DRAWFLAG_NORMAL, false);
733 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
734 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
735 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
736 R_PolygonVertex(first_max_end, '0 0 0', sw_color, a);
742 NET_HANDLE(TE_CSQC_SHOCKWAVEPARTICLE, bool isNew)
744 Net_ReadShockwaveParticle();
748 void Net_ReadShockwaveParticle()
750 entity shockwave = new(shockwave_cone);
751 shockwave.draw = Draw_Shockwave;
752 IL_PUSH(g_drawables, shockwave);
754 shockwave.sw_shotorg = ReadVector();
755 shockwave.sw_shotdir = ReadVector();
757 shockwave.sw_distance = ReadShort();
758 shockwave.sw_spread_max = ReadByte();
759 shockwave.sw_spread_min = ReadByte();
761 shockwave.sv_entnum = ReadByte();
763 shockwave.sw_time = time;
766 METHOD(Shockwave, wr_impacteffect, void(entity thiswep, entity actor))
768 // handled by Net_ReadShockwaveParticle
770 //org2 = w_org + w_backoff * 2;
771 //pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);