9 WriteHeader(MSG_ENTITY, ENT_CLIENT_ARC_BEAM);
15 float drawlocal = ((to == this.
owner) || ((to.enemy ==
this.owner) &&
IS_SPEC(to)));
16 if(drawlocal) { sf &= ~ARC_SF_LOCALMASK; }
21 if(sf & ARC_SF_SETTINGS)
35 WriteVector(MSG_ENTITY, this.beam_start);
37 if(sf & ARC_SF_WANTDIR)
39 WriteVector(MSG_ENTITY, this.beam_wantdir);
41 if(sf & ARC_SF_BEAMDIR)
43 WriteAngleVector(MSG_ENTITY, this.beam_dir);
45 if(sf & ARC_SF_BEAMTYPE)
58 if(!player.(weaponentity).arc_beam)
60 player.(weaponentity).arc_beam.beam_dir = forward;
61 player.(weaponentity).arc_beam.beam_teleporttime =
time;
65 float Arc_GetHeat_Percent(
entity player, .
entity weaponentity)
69 player.arc_overheat = 0;
73 if ( player.(weaponentity).arc_beam )
74 return player.(weaponentity).arc_beam.beam_heat/
WEP_CVAR(arc, overheat_max);
76 if ( player.arc_overheat >
time )
78 return (player.arc_overheat-
time) /
WEP_CVAR(arc, overheat_max)
79 * player.arc_cooldown;
84 void Arc_Player_SetHeat(
entity player, .
entity weaponentity)
86 player.(weaponentity).
arc_heat_percent = Arc_GetHeat_Percent(player, weaponentity);
90 void W_Arc_Bolt_Explode(
entity this,
entity directhitentity)
93 RadiusDamage(
this, this.
realowner,
WEP_CVAR(arc, bolt_damage),
WEP_CVAR(arc, bolt_edgedamage),
WEP_CVAR(arc, bolt_radius),
NULL,
NULL,
WEP_CVAR(arc, bolt_force), this.
projectiledeathtype, this.
weaponentity_fld, directhitentity);
100 W_Arc_Bolt_Explode(
this, trigger);
129 if(
WEP_CVAR(arc, bolt_bounce_explode))
130 RadiusDamage(
this, this.
realowner,
WEP_CVAR(arc, bolt_damage),
WEP_CVAR(arc, bolt_edgedamage),
WEP_CVAR(arc, bolt_radius),
NULL,
NULL,
WEP_CVAR(arc, bolt_force), this.
projectiledeathtype, this.
weaponentity_fld, toucher);
131 if(this.
cnt == 1 &&
WEP_CVAR(arc, bolt_bounce_lifetime))
142 entity missile =
new(missile);
143 missile.owner = missile.realowner = actor;
144 missile.bot_dodge =
true;
146 missile.bot_dodgerating =
WEP_CVAR(arc, bolt_damage);
150 missile.damageforcescale =
WEP_CVAR(arc, bolt_damageforcescale);
151 missile.event_damage = W_Arc_Bolt_Damage;
152 missile.damagedbycontents =
true;
155 settouch(missile, W_Arc_Bolt_Touch);
157 missile.use = W_Arc_Bolt_Explode_use;
159 missile.nextthink =
time +
WEP_CVAR(arc, bolt_lifetime);
162 missile.weaponentity_fld = weaponentity;
164 setsize(missile,
'0 0 0',
'0 0 0');
170 missile.flags = FL_PROJECTILE;
178 actor.(weaponentity).
misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
179 if(actor.(weaponentity).misc_bulletcounter == 0)
190 void W_Arc_Beam_Think(
entity this)
194 if(
this != own.(weaponentity).arc_beam)
203 if(!this.beam_bursting)
204 this.beam_bursting =
true;
205 burst = ARC_BT_BURSTMASK;
220 own.(weaponentity).m_switchweapon != WEP_ARC
226 (
WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >=
WEP_CVAR(arc, overheat_max))
231 float cooldown_speed = 0;
232 if ( this.beam_heat >
WEP_CVAR(arc, overheat_min) &&
WEP_CVAR(arc, cooldown) > 0 )
234 cooldown_speed =
WEP_CVAR(arc, cooldown);
238 cooldown_speed = this.beam_heat /
WEP_CVAR(arc, beam_refire);
241 if ( cooldown_speed )
243 if (
WEP_CVAR(arc, cooldown_release) || (
WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >=
WEP_CVAR(arc, overheat_max)) )
244 own.arc_overheat =
time + this.beam_heat / cooldown_speed;
245 own.arc_cooldown = cooldown_speed;
248 if (
WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >=
WEP_CVAR(arc, overheat_max) )
250 Send_Effect(EFFECT_ARC_OVERHEAT,
251 this.beam_start, this.beam_wantdir, 1 );
256 if(
this == own.(weaponentity).arc_beam) { own.(weaponentity).arc_beam =
NULL; }
257 if(!thiswep.wr_checkammo1(thiswep, own, weaponentity) && !(own.items & IT_UNLIMITED_AMMO))
262 own.(weaponentity).arc_BUTTON_ATCK_prev =
false;
269 if(!(own.items & IT_UNLIMITED_AMMO))
273 { rootammo =
WEP_CVAR(arc, burst_ammo); }
275 { rootammo =
WEP_CVAR(arc, beam_ammo); }
283 float heat_speed = burst ?
WEP_CVAR(arc, burst_heat) : WEP_CVAR(arc, beam_heat);
295 WEP_CVAR(arc, beam_damage) * coefficient,
308 this.SendFlags |= ARC_SF_START;
313 this.SendFlags |= ARC_SF_WANTDIR;
317 if(!this.beam_initialized)
320 this.beam_initialized =
true;
339 if(angle && (angle >
WEP_CVAR(arc, beam_maxangle)))
342 float blendfactor =
bound(
350 this.beam_dir =
normalize((
w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
355 float blendfactor =
bound(
357 (1 - (
WEP_CVAR(arc, beam_returnspeed) * frametime)),
363 this.beam_dir =
normalize((
w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
367 this.SendFlags |= ARC_SF_BEAMDIR;
370 float max_allowed_segments;
372 if(
WEP_CVAR(arc, beam_distancepersegment))
374 max_allowed_segments =
min(
379 else { max_allowed_segments = ARC_MAX_SEGMENTS; }
381 if(
WEP_CVAR(arc, beam_degreespersegment))
391 WEP_CVAR(arc, beam_degreespersegment)
396 else { segments = 1; }
398 else { segments = 1; }
404 float new_beam_type = 0;
406 for(i = 1; i <= segments; ++i)
451 float roothealth = ((burst) ?
WEP_CVAR(arc, burst_healing_hps) :
WEP_CVAR(arc, beam_healing_hps));
452 float rootarmor = ((burst) ?
WEP_CVAR(arc, burst_healing_aps) :
WEP_CVAR(arc, beam_healing_aps));
466 if(roothealth || rootarmor)
467 new_beam_type = ARC_BT_HEAL;
469 else if(
trace_ent.takedamage && (is_player || WEP_CVAR(arc, beam_nonplayerdamage)))
477 WEP_CVAR(arc, beam_falloff_mindist),
478 WEP_CVAR(arc, beam_falloff_maxdist),
479 WEP_CVAR(arc, beam_falloff_halflifedist),
487 { rootdamage =
WEP_CVAR(arc, burst_damage); }
489 { rootdamage =
WEP_CVAR(arc, beam_damage); }
492 { rootdamage =
WEP_CVAR(arc, beam_nonplayerdamage); }
500 rootdamage * coefficient * falloff
508 rootdamage * coefficient * falloff,
512 WEP_CVAR(arc, beam_force) * new_dir * coefficient * falloff
515 new_beam_type = ARC_BT_HIT;
522 new_beam_type = ARC_BT_WALL;
530 new_beam_type |= burst;
533 if(new_beam_type != this.beam_type)
535 this.SendFlags |= ARC_SF_BEAMTYPE;
536 this.beam_type = new_beam_type;
539 own.(weaponentity).beam_prev =
time;
543 void W_Arc_Beam(
float burst,
entity actor, .
entity weaponentity)
547 if(
time - actor.(weaponentity).beam_prev > 1)
550 entity beam = actor.(weaponentity).arc_beam =
new(W_Arc_Beam);
551 beam.weaponentity_fld = weaponentity;
556 beam.bot_dodge =
true;
558 beam.bot_dodgerating =
WEP_CVAR(arc, beam_damage);
559 beam.beam_bursting = burst;
560 Net_LinkEntity(beam,
false, 0, W_Arc_Beam_Send);
566 if(!actor.(weaponentity).arc_beam || wasfreed(actor.(weaponentity).arc_beam))
568 w_ready(thiswep, actor, weaponentity, fire);
576 actor.(weaponentity).wframe = WFRAME_FIRE1;
585 vector vecs = ((md.x > 0) ? md :
'0 0 0');
587 w_shotorg = actor.origin + actor.view_ofs + dv;
591 if ( actor.arc_overheat >
time )
594 Send_Effect(EFFECT_ARC_SMOKE, smoke_origin,
'0 0 0', 1 );
595 if ( (fire & 1) || (fire & 2) )
597 Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin,
w_shotdir, 1 );
598 if ( !actor.arc_smoke_sound )
600 actor.arc_smoke_sound = 1;
605 else if ( actor.(weaponentity).arc_beam &&
WEP_CVAR(arc, overheat_max) > 0 &&
606 actor.(weaponentity).arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
608 if (
random() < (actor.(weaponentity).arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
610 Send_Effect(EFFECT_ARC_SMOKE, smoke_origin,
'0 0 0', 1 );
614 bool stop_smoke_sound = actor.arc_overheat <=
time || !attacking;
615 if ((actor.arc_smoke_sound && stop_smoke_sound) || actor.(weaponentity).m_switchweapon != thiswep)
617 actor.arc_smoke_sound = 0;
649 Arc_Player_SetHeat(actor, weaponentity);
650 Arc_Smoke(thiswep, actor, weaponentity, fire);
652 bool beam_fire2 = ((fire & 2) && !
WEP_CVAR(arc, bolt));
654 if (
time >= actor.arc_overheat)
655 if ((fire & 1) || beam_fire2 || actor.(weaponentity).arc_beam.beam_bursting)
658 if(actor.(weaponentity).arc_BUTTON_ATCK_prev)
661 if(actor.animstate_startframe == actor.anim_shoot.x && actor.animstate_numframes == actor.anim_shoot.y)
662 weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, autocvar_g_balance_arc_primary_animtime,
w_ready);
669 if((!actor.(weaponentity).arc_beam) || wasfreed(actor.(weaponentity).arc_beam))
673 W_Arc_Beam(
boolean(beam_fire2), actor, weaponentity);
675 if(!actor.(weaponentity).arc_BUTTON_ATCK_prev)
677 actor.(weaponentity).wframe = WFRAME_FIRE1;
679 actor.(weaponentity).arc_BUTTON_ATCK_prev =
true;
690 if(!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
691 if(!(actor.items & IT_UNLIMITED_AMMO))
694 w_ready(thiswep, actor, weaponentity, fire);
697 float ammo_available =
GetResource(actor, thiswep.ammo_type);
700 float burst_fraction =
min(1, ammo_available /
WEP_CVAR(arc, bolt_ammo));
701 int to_shoot =
floor(
WEP_CVAR(arc, bolt_count) * burst_fraction);
704 int to_use =
min(
WEP_CVAR(arc, bolt_ammo), ammo_available);
709 W_Arc_Attack_Bolt(thiswep, actor, weaponentity, fire);
713 if(actor.(weaponentity).arc_BUTTON_ATCK_prev)
719 actor.(weaponentity).arc_BUTTON_ATCK_prev =
false;
723 if(
weapon_prepareattack(thiswep, actor, weaponentity,
true, autocvar_g_balance_arc_secondary_refire))
726 actor.arc_count = autocvar_g_balance_arc_secondary_count;
727 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_arc_secondary_animtime, w_arc_checkattack);
734 if(!arc_shotorigin[0])
751 ammo_amount += actor.(weaponentity).(
weapon_load[WEP_ARC.m_id]) >=
WEP_CVAR(arc, bolt_ammo);
755 return WEP_CVAR(arc, overheat_max) > 0 &&
761 return WEAPON_ARC_MURDER_SPRAY;
763 return WEAPON_ARC_MURDER;
769 actor.arc_overheat = 0;
770 actor.arc_cooldown = 0;
771 actor.(weaponentity).arc_BUTTON_ATCK_prev =
false;
784 actor.arc_overheat = 0;
785 actor.arc_cooldown = 0;
789 actor.(weaponentity).arc_BUTTON_ATCK_prev =
false;
794 actor.arc_overheat = 0;
795 actor.arc_cooldown = 0;
796 actor.(weaponentity).arc_BUTTON_ATCK_prev =
false;
800 bool autocvar_cl_arcbeam_teamcolor =
true;
801 bool autocvar_cl_arcbeam_simple =
true;
810 org2 = w_org + w_backoff * 6;
818 entity beam = Draw_ArcBeam_callback_entity;
819 vector transformed_view_org;
833 hitorigin = start + (Draw_ArcBeam_callback_new_dir * Draw_ArcBeam_callback_segmentdist *
trace_fraction);
845 float thickness = beam.beam_thickness;
848 vector top = hitorigin + (thickdir * thickness);
849 vector bottom = hitorigin - (thickdir * thickness);
854 if(autocvar_cl_arcbeam_simple)
855 Draw_CylindricLine(start, end, thickness, beam.beam_image, 0.25, -
time * 3, beam.beam_color, beam.beam_alpha,
DRAWFLAG_NORMAL, transformed_view_org);
861 '0 0.5 0' + (
'0 0.5 0' * (thickness / beam.beam_thickness)),
867 '0 0.5 0' + (
'0 0.5 0' * (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
873 '0 0.5 0' * (1 - (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
879 '0 0.5 0' * (1 - (thickness / beam.beam_thickness)),
890 if(beam.beam_traileffect)
896 Draw_ArcBeam_callback_last_thickness = thickness;
904 for (e =
NULL; (e =
findfloat(e, beam_usevieworigin, 1)); ) {
905 e.beam_initialized =
false;
907 for (e =
NULL; (e =
findfloat(e, beam_usevieworigin, 2)); ) {
908 e.beam_initialized =
false;
912 void Draw_ArcBeam(
entity this)
915 this.move_time =
time;
916 if(dt <= 0) {
return; }
918 if(!this.beam_usevieworigin)
932 if(this.beam_usevieworigin)
949 vector forward, right, up;
950 MAKE_VECTORS(myviewangle, forward, right, up);
956 if(this.beam_usevieworigin == 2)
961 { start_pos = this.
origin; }
966 start_pos + forward * this.beam_range,
973 if(v_shot_idx && this.beam_usevieworigin == 2)
974 start_pos =
gettaginfo(wepent, v_shot_idx) -
'0 0 2';
984 vector origin_offset =
'0 0 0';
985 if(!v_shot_idx || this.beam_usevieworigin != 2)
987 this.beam_shotorigin = wepent.movedir;
988 origin_offset = right * -this.beam_shotorigin.y + up * this.beam_shotorigin.z;
991 this.beam_shotorigin =
'0 0 0';
993 start_pos = start_pos + origin_offset;
996 traceline(start_pos, start_pos + forward * this.beam_shotorigin.x,
MOVE_NORMAL,
this);
1000 wantdir =
normalize(end_pos - start_pos);
1002 if(!this.beam_initialized)
1004 this.beam_dir = wantdir;
1005 this.beam_initialized =
true;
1010 if(this.beam_dir != wantdir)
1018 float angle =
vlen(wantdir - this.beam_dir) *
RAD2DEG;
1019 if(angle && (angle > this.beam_maxangle))
1022 float blendfactor =
bound(
1024 (1 - (this.beam_returnspeed * dt)),
1025 min(this.beam_maxangle / angle, 1)
1027 this.beam_dir =
normalize((wantdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
1032 float blendfactor =
bound(
1034 (1 - (this.beam_returnspeed * dt)),
1037 this.beam_dir =
normalize((wantdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
1041 float max_allowed_segments;
1043 if(this.beam_distancepersegment)
1045 max_allowed_segments =
min(
1047 1 + (
vlen(wantdir / this.beam_distancepersegment))
1050 else { max_allowed_segments = ARC_MAX_SEGMENTS; }
1052 if(this.beam_degreespersegment)
1062 this.beam_degreespersegment
1064 max_allowed_segments
1067 else { segments = 1; }
1069 else { segments = 1; }
1072 beamdir = this.beam_dir;
1084 if(beamdir != wantdir)
1089 float max_allowed_segments;
1091 if(this.beam_distancepersegment)
1093 max_allowed_segments =
min(
1095 1 + (
vlen(wantdir / this.beam_distancepersegment))
1098 else { max_allowed_segments = ARC_MAX_SEGMENTS; }
1100 if(this.beam_degreespersegment)
1110 this.beam_degreespersegment
1112 max_allowed_segments
1115 else { segments = 1; }
1117 else { segments = 1; }
1121 this.beam_muzzleentity.angles_z =
random() * 360;
1123 vector beam_endpos = (start_pos + (beamdir * this.beam_range));
1124 vector beam_controlpoint = start_pos + wantdir * (this.beam_range * (1 - this.beam_tightness));
1126 Draw_ArcBeam_callback_entity =
this;
1127 Draw_ArcBeam_callback_last_thickness = 0;
1128 Draw_ArcBeam_callback_last_top = start_pos;
1129 Draw_ArcBeam_callback_last_bottom = start_pos;
1131 vector last_origin = start_pos;
1132 vector original_start_pos = start_pos;
1135 for(i = 1; i <= segments; ++i)
1157 Draw_ArcBeam_callback
1174 if(this.beam_hiteffect)
1181 this.beam_hiteffect,
1187 if(this.beam_hitlight[0])
1191 this.beam_hitlight[0],
1193 this.beam_hitlight[1],
1194 this.beam_hitlight[2],
1195 this.beam_hitlight[3]
1202 this.beam_muzzleeffect,
1203 original_start_pos + wantdir * 20,
1208 if(this.beam_muzzlelight[0])
1211 original_start_pos + wantdir * 20,
1212 this.beam_muzzlelight[0],
1214 this.beam_muzzlelight[1],
1215 this.beam_muzzlelight[2],
1216 this.beam_muzzlelight[3]
1222 Draw_ArcBeam_callback_entity =
NULL;
1223 Draw_ArcBeam_callback_last_thickness = 0;
1224 Draw_ArcBeam_callback_last_top =
'0 0 0';
1225 Draw_ArcBeam_callback_last_bottom =
'0 0 0';
1228 void Remove_ArcBeam(
entity this)
1230 delete(this.beam_muzzleentity);
1236 int sf = ReadByte();
1237 int slot = ReadByte();
1240 this.beam_slot = slot;
1246 this.beam_shotorigin = arc_shotorigin[gunalign];
1249 this.draw = Draw_ArcBeam;
1251 this.entremove = Remove_ArcBeam;
1252 this.move_time =
time;
1255 flash =
new(arc_flash);
1260 flash.avelocity_z = 5000;
1261 setattachment(flash,
this,
"");
1264 this.beam_muzzleentity = flash;
1268 flash = this.beam_muzzleentity;
1271 if(sf & ARC_SF_SETTINGS)
1273 this.beam_degreespersegment = ReadShort();
1274 this.beam_distancepersegment = ReadShort();
1275 this.beam_maxangle = ReadShort();
1276 this.beam_range = ReadCoord();
1277 this.beam_returnspeed = ReadShort();
1278 this.beam_tightness = (ReadByte() / 10);
1286 this.beam_usevieworigin = 0;
1292 if(!this.beam_usevieworigin)
1300 if(sf & ARC_SF_START)
1302 this.
origin = ReadVector();
1304 else if(this.beam_usevieworigin)
1306 if(this.beam_usevieworigin == 2)
1320 if(sf & ARC_SF_WANTDIR)
1325 if(sf & ARC_SF_BEAMDIR)
1327 this.
angles = ReadAngleVector();
1330 if(sf & ARC_SF_BEAMTYPE)
1332 this.beam_type = ReadByte();
1335 switch(this.beam_type)
1340 this.beam_alpha = 0.5;
1341 this.beam_thickness = 8;
1342 this.beam_traileffect = (EFFECT_ARC_BEAM);
1343 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1344 this.beam_hitlight[0] = 0;
1345 this.beam_hitlight[1] = 1;
1346 this.beam_hitlight[2] = 1;
1347 this.beam_hitlight[3] = 1;
1348 this.beam_muzzleeffect = EFFECT_Null;
1349 this.beam_muzzlelight[0] = 0;
1350 this.beam_muzzlelight[1] = 1;
1351 this.beam_muzzlelight[2] = 1;
1352 this.beam_muzzlelight[3] = 1;
1353 this.beam_image =
"particles/lgbeam";
1356 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1357 flash.alpha = this.beam_alpha;
1366 this.beam_alpha = 0.5;
1367 this.beam_thickness = 8;
1368 this.beam_traileffect = (EFFECT_ARC_BEAM);
1369 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1370 this.beam_hitlight[0] = 0;
1371 this.beam_hitlight[1] = 1;
1372 this.beam_hitlight[2] = 1;
1373 this.beam_hitlight[3] = 1;
1374 this.beam_muzzleeffect = EFFECT_Null;
1375 this.beam_muzzlelight[0] = 0;
1376 this.beam_muzzlelight[1] = 1;
1377 this.beam_muzzlelight[2] = 1;
1378 this.beam_muzzlelight[3] = 1;
1379 this.beam_image =
"particles/lgbeam";
1382 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1383 flash.alpha = this.beam_alpha;
1392 this.beam_alpha = 0.5;
1393 this.beam_thickness = 8;
1394 this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
1395 this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT);
1396 this.beam_hitlight[0] = 0;
1397 this.beam_hitlight[1] = 1;
1398 this.beam_hitlight[2] = 1;
1399 this.beam_hitlight[3] = 1;
1400 this.beam_muzzleeffect = EFFECT_Null;
1401 this.beam_muzzlelight[0] = 0;
1402 this.beam_muzzlelight[1] = 1;
1403 this.beam_muzzlelight[2] = 1;
1404 this.beam_muzzlelight[3] = 1;
1405 this.beam_image =
"particles/lgbeam";
1408 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1409 flash.alpha = this.beam_alpha;
1418 this.beam_alpha = 0.5;
1419 this.beam_thickness = 8;
1420 this.beam_traileffect = (EFFECT_ARC_BEAM);
1421 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1422 this.beam_hitlight[0] = 20;
1423 this.beam_hitlight[1] = 1;
1424 this.beam_hitlight[2] = 0;
1425 this.beam_hitlight[3] = 0;
1426 this.beam_muzzleeffect = EFFECT_Null;
1427 this.beam_muzzlelight[0] = 50;
1428 this.beam_muzzlelight[1] = 1;
1429 this.beam_muzzlelight[2] = 0;
1430 this.beam_muzzlelight[3] = 0;
1431 this.beam_image =
"particles/lgbeam";
1434 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1435 flash.alpha = this.beam_alpha;
1441 case ARC_BT_BURST_MISS:
1444 this.beam_alpha = 0.5;
1445 this.beam_thickness = 14;
1446 this.beam_traileffect = (EFFECT_ARC_BEAM);
1447 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1448 this.beam_hitlight[0] = 0;
1449 this.beam_hitlight[1] = 1;
1450 this.beam_hitlight[2] = 1;
1451 this.beam_hitlight[3] = 1;
1452 this.beam_muzzleeffect = EFFECT_Null;
1453 this.beam_muzzlelight[0] = 0;
1454 this.beam_muzzlelight[1] = 1;
1455 this.beam_muzzlelight[2] = 1;
1456 this.beam_muzzlelight[3] = 1;
1457 this.beam_image =
"particles/lgbeam";
1460 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1461 flash.alpha = this.beam_alpha;
1467 case ARC_BT_BURST_WALL:
1470 this.beam_alpha = 0.5;
1471 this.beam_thickness = 14;
1472 this.beam_traileffect = (EFFECT_ARC_BEAM);
1473 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1474 this.beam_hitlight[0] = 0;
1475 this.beam_hitlight[1] = 1;
1476 this.beam_hitlight[2] = 1;
1477 this.beam_hitlight[3] = 1;
1478 this.beam_muzzleeffect = EFFECT_Null;
1479 this.beam_muzzlelight[0] = 0;
1480 this.beam_muzzlelight[1] = 1;
1481 this.beam_muzzlelight[2] = 1;
1482 this.beam_muzzlelight[3] = 1;
1483 this.beam_image =
"particles/lgbeam";
1486 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1487 flash.alpha = this.beam_alpha;
1493 case ARC_BT_BURST_HEAL:
1496 this.beam_alpha = 0.5;
1497 this.beam_thickness = 14;
1498 this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
1499 this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2);
1500 this.beam_hitlight[0] = 0;
1501 this.beam_hitlight[1] = 1;
1502 this.beam_hitlight[2] = 1;
1503 this.beam_hitlight[3] = 1;
1504 this.beam_muzzleeffect = EFFECT_Null;
1505 this.beam_muzzlelight[0] = 0;
1506 this.beam_muzzlelight[1] = 1;
1507 this.beam_muzzlelight[2] = 1;
1508 this.beam_muzzlelight[3] = 1;
1509 this.beam_image =
"particles/lgbeam";
1512 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1513 flash.alpha = this.beam_alpha;
1519 case ARC_BT_BURST_HIT:
1522 this.beam_alpha = 0.5;
1523 this.beam_thickness = 14;
1524 this.beam_traileffect = (EFFECT_ARC_BEAM);
1525 this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
1526 this.beam_hitlight[0] = 0;
1527 this.beam_hitlight[1] = 1;
1528 this.beam_hitlight[2] = 1;
1529 this.beam_hitlight[3] = 1;
1530 this.beam_muzzleeffect = EFFECT_Null;
1531 this.beam_muzzlelight[0] = 0;
1532 this.beam_muzzlelight[1] = 1;
1533 this.beam_muzzlelight[2] = 1;
1534 this.beam_muzzlelight[3] = 1;
1535 this.beam_image =
"particles/lgbeam";
1538 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1539 flash.alpha = this.beam_alpha;
1550 this.beam_alpha = 1;
1551 this.beam_thickness = 8;
1552 this.beam_traileffect =
NULL;
1553 this.beam_hiteffect =
NULL;
1554 this.beam_hitlight[0] = 0;
1555 this.beam_hitlight[1] = 1;
1556 this.beam_hitlight[2] = 1;
1557 this.beam_hitlight[3] = 1;
1558 this.beam_muzzleeffect = EFFECT_Null;
1559 this.beam_muzzlelight[0] = 0;
1560 this.beam_muzzlelight[1] = 1;
1561 this.beam_muzzlelight[2] = 1;
1562 this.beam_muzzlelight[3] = 1;
1563 this.beam_image =
"particles/lgbeam";
1566 setmodel(flash, MDL_ARC_MUZZLEFLASH);
1567 flash.alpha = this.beam_alpha;
1576 if(!this.beam_usevieworigin)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float autocvar_g_balance_pause_armor_rot
void InterpolateOrigin_Note(entity this)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
float weapon_load[REGISTRY_MAX(Weapons)]
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
ERASEABLE float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d)
#define PROJECTILE_MAKETRIGGER(e)
void InterpolateOrigin_Undo(entity this)
snap origin to iorigin2 (actual origin)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
float trace_dphitq3surfaceflags
vector warpzone_save_view_angles
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
#define w_getbestweapon(ent, wepent)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
entity viewmodels[MAX_WEAPONSLOTS]
IntrusiveList g_damagedbycontents
#define W_SetupShot_Range(ent, wepent, antilag, recoil, snd, chan, maxdamage, range, deathtype)
vector WarpZone_TransformOrigin(entity wz, vector v)
float MOVETYPE_BOUNCEMISSILE
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define NET_HANDLE(id, param)
#define WEP_CVAR(wepname, name)
void loopsound(entity e, int ch, Sound samp, float vol, float attn)
bool weapon_prepareattack_check(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
int W_GunAlign(entity this, int preferred_align)
#define W_SetupProjVelocity_PRE(ent, wepname, prefix)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
ERASEABLE vector bezier_quadratic_getpoint(vector a, vector b, vector c, float t)
vector warpzone_save_view_origin
IntrusiveList g_bot_dodge
bool autocvar_cl_lockview
void WarpZone_traceline_antilag(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
vector WarpZone_UnTransformOrigin(entity wz, vector v)
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
int weaponslot(.entity weaponentity)
#define PROJECTILE_TOUCH(e, t)
#define setmodel(this, m)
const float EF_FULLBRIGHT
const float MOVE_NOMONSTERS
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int PROJECTILE_ARC_BOLT
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
const int MAX_WEAPONSLOTS
Resource ammo_type
M: ammotype : main ammo type.
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
entity weapon_dropevent_item
const float DRAWFLAG_NORMAL
#define PHYS_INPUT_BUTTON_ATCK(s)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
bool Heal(entity targ, entity inflictor, float amount, float limit)
const int HITTYPE_SECONDARY
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
float Q3SURFACEFLAG_NOIMPACT
vector WarpZone_TransformVelocity(entity wz, vector v)
vector CL_Weapon_GetShotOrg(int wpn)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity WarpZone_trace_transform
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool autocvar_r_drawviewmodel
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void accuracy_add(entity this, Weapon w, float fired, float hit)
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
entity Notification
always last
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
bool accuracy_isgooddamage(entity attacker, entity targ)
#define MUTATOR_CALLHOOK(id,...)
entity weaponentities[MAX_WEAPONSLOTS]
#define ANTILAG_LATENCY(e)
#define ATTACK_FINISHED(ent, w)
void adaptor_think2use_hittype_splash(entity this)
const int CH_SHOTS_SINGLE
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
int autocvar_chase_active
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
bool client_hasweapon(entity this, Weapon wpn,.entity weaponentity, float andammo, bool complain)
float W_WeaponRateFactor(entity this)
void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
void InterpolateOrigin_Do(entity this)
set origin based on iorigin1 (old pos), iorigin2 (desired pos), and time
IntrusiveList g_drawables
void set_movetype(entity this, int mt)
#define colormapPaletteColor(c, isPants)