-/* ammotype */ ATTRIB(Arc, ammo_field, .int, ammo_cells)
-/* impulse */ ATTRIB(Arc, impulse, int, 3)
+/* ammotype */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Arc, impulse, int, 3);
/* flags */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_NORMAL);
/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
/* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
/* modelname */ ATTRIB(Arc, mdl, string, "arc");
/* flags */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_NORMAL);
/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
/* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
/* modelname */ ATTRIB(Arc, mdl, string, "arc");
/* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
#endif
/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
/* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
#endif
/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
// - The owner client has no use for beam start position or directions,
// it always figures this information out for itself with csqc code.
// - Spectating the owner also truncates this information.
// - The owner client has no use for beam start position or directions,
// it always figures this information out for itself with csqc code.
// - Spectating the owner also truncates this information.
if(drawlocal) { sf &= ~ARC_SF_LOCALMASK; }
WriteByte(MSG_ENTITY, sf);
if(drawlocal) { sf &= ~ARC_SF_LOCALMASK; }
WriteByte(MSG_ENTITY, sf);
- WriteCoord(MSG_ENTITY, self.beam_start.x);
- WriteCoord(MSG_ENTITY, self.beam_start.y);
- WriteCoord(MSG_ENTITY, self.beam_start.z);
+ WriteCoord(MSG_ENTITY, this.beam_start.x);
+ WriteCoord(MSG_ENTITY, this.beam_start.y);
+ WriteCoord(MSG_ENTITY, this.beam_start.z);
- WriteCoord(MSG_ENTITY, self.beam_wantdir.x);
- WriteCoord(MSG_ENTITY, self.beam_wantdir.y);
- WriteCoord(MSG_ENTITY, self.beam_wantdir.z);
+ WriteCoord(MSG_ENTITY, this.beam_wantdir.x);
+ WriteCoord(MSG_ENTITY, this.beam_wantdir.y);
+ WriteCoord(MSG_ENTITY, this.beam_wantdir.z);
- WriteCoord(MSG_ENTITY, self.beam_dir.x);
- WriteCoord(MSG_ENTITY, self.beam_dir.y);
- WriteCoord(MSG_ENTITY, self.beam_dir.z);
+ WriteCoord(MSG_ENTITY, this.beam_dir.x);
+ WriteCoord(MSG_ENTITY, this.beam_dir.y);
+ WriteCoord(MSG_ENTITY, this.beam_dir.z);
- if (!player.arc_beam) {
- return;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(!player.(weaponentity).arc_beam)
+ continue;
+ player.(weaponentity).arc_beam.beam_dir = forward;
+ player.(weaponentity).arc_beam.beam_teleporttime = time;
-void W_Arc_Bolt_Explode()
-{SELFPARAM();
- self.event_damage = func_null;
- RadiusDamage(self, self.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), world, world, WEP_CVAR(arc, bolt_force), self.projectiledeathtype, other);
+void W_Arc_Bolt_Explode(entity this, entity directhitentity)
+{
+ this.event_damage = func_null;
+ 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, directhitentity);
}
void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
}
void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-void W_Arc_Bolt_Touch()
-{SELFPARAM();
- PROJECTILE_TOUCH;
- self.use(this, NULL, NULL);
+void W_Arc_Bolt_Touch(entity this, entity toucher)
+{
+ PROJECTILE_TOUCH(this, toucher);
+ this.use(this, NULL, toucher);
- W_DecreaseAmmo(thiswep, self, WEP_CVAR(arc, bolt_ammo));
+ W_DecreaseAmmo(thiswep, actor, WEP_CVAR(arc, bolt_ammo));
- W_SetupShot(self, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage));
+ W_SetupShot(actor, weaponentity, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage));
Send_Effect(EFFECT_ARC_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
missile = new(missile);
Send_Effect(EFFECT_ARC_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
missile = new(missile);
missile.bot_dodgerating = WEP_CVAR(arc, bolt_damage);
missile.takedamage = DAMAGE_YES;
missile.bot_dodgerating = WEP_CVAR(arc, bolt_damage);
missile.takedamage = DAMAGE_YES;
missile.damageforcescale = WEP_CVAR(arc, bolt_damageforcescale);
missile.event_damage = W_Arc_Bolt_Damage;
missile.damagedbycontents = true;
missile.damageforcescale = WEP_CVAR(arc, bolt_damageforcescale);
missile.event_damage = W_Arc_Bolt_Damage;
missile.damagedbycontents = true;
missile.nextthink = time + WEP_CVAR(arc, bolt_lifetime);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_ARC.m_id | HITTYPE_SECONDARY;
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.nextthink = time + WEP_CVAR(arc, bolt_lifetime);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_ARC.m_id | HITTYPE_SECONDARY;
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjVelocity_PRE(missile, arc, bolt_);
missile.angles = vectoangles(missile.velocity);
W_SetupProjVelocity_PRE(missile, arc, bolt_);
missile.angles = vectoangles(missile.velocity);
CSQCProjectile(missile, true, PROJECTILE_ARC_BOLT, true);
CSQCProjectile(missile, true, PROJECTILE_ARC_BOLT, true);
)
{
if ( WEP_CVAR(arc, cooldown) > 0 )
{
float cooldown_speed = 0;
)
{
if ( WEP_CVAR(arc, cooldown) > 0 )
{
float cooldown_speed = 0;
- if ( WEP_CVAR(arc, cooldown_release) || (WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max)) )
- self.owner.arc_overheat = time + self.beam_heat / cooldown_speed;
- self.owner.arc_cooldown = cooldown_speed;
+ if ( WEP_CVAR(arc, cooldown_release) || (WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >= WEP_CVAR(arc, overheat_max)) )
+ this.owner.arc_overheat = time + this.beam_heat / cooldown_speed;
+ this.owner.arc_cooldown = cooldown_speed;
- self.beam_start, self.beam_wantdir, 1 );
- sound(self, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
+ this.beam_start, this.beam_wantdir, 1 );
+ sound(this, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
- if(!w.wr_checkammo1(w) && !w.wr_checkammo2(w))
- if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!w.wr_checkammo1(w, own) && !w.wr_checkammo2(w, own))
+ if(!(own.items & IT_UNLIMITED_WEAPON_AMMO))
- coefficient = min(coefficient, self.owner.(thiswep.ammo_field) / rootammo);
- self.owner.(thiswep.ammo_field) = max(0, self.owner.(thiswep.ammo_field) - (rootammo * frametime));
+ coefficient = min(coefficient, this.owner.(thiswep.ammo_field) / rootammo);
+ this.owner.(thiswep.ammo_field) = max(0, this.owner.(thiswep.ammo_field) - (rootammo * frametime));
// might have to make some special accomodation so that it only uses view_right and view_up
// note that if we do this, it'll always be corrected to a maximum angle by beam_maxangle handling
float segments;
// might have to make some special accomodation so that it only uses view_right and view_up
// note that if we do this, it'll always be corrected to a maximum angle by beam_maxangle handling
float segments;
{
// calculate how much we're going to move the end of the beam to the want position
// WEAPONTODO (server and client):
// blendfactor never actually becomes 0 in this situation, which is a problem
{
// calculate how much we're going to move the end of the beam to the want position
// WEAPONTODO (server and client):
// blendfactor never actually becomes 0 in this situation, which is a problem
// eachother, however they never actually become the same value with this method.
// Perhaps we should do some form of rounding/snapping?
// eachother, however they never actually become the same value with this method.
// Perhaps we should do some form of rounding/snapping?
if(angle && (angle > WEP_CVAR(arc, beam_maxangle)))
{
// if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
if(angle && (angle > WEP_CVAR(arc, beam_maxangle)))
{
// if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
(1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
min(WEP_CVAR(arc, beam_maxangle) / angle, 1)
);
(1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
min(WEP_CVAR(arc, beam_maxangle) / angle, 1)
);
vector beam_controlpoint = w_shotorg + w_shotdir * (WEP_CVAR(arc, beam_range) * (1 - WEP_CVAR(arc, beam_tightness)));
float i;
vector beam_controlpoint = w_shotorg + w_shotdir * (WEP_CVAR(arc, beam_range) * (1 - WEP_CVAR(arc, beam_tightness)));
float i;
- if(time - self.beam_prev > 1)
- sound(self, CH_WEAPON_A, SND_ARC_FIRE, VOL_BASE, ATTN_NORM);
+ if(time - actor.beam_prev > 1)
+ sound(actor, CH_WEAPON_A, SND_ARC_FIRE, VOL_BASE, ATTN_NORM);
- beam.think = W_Arc_Beam_Think;
- beam.owner = self;
- beam.movetype = MOVETYPE_NONE;
+ setthink(beam, W_Arc_Beam_Think);
+ beam.owner = actor;
+ set_movetype(beam, MOVETYPE_NONE);
beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
beam.beam_bursting = burst;
Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
beam.beam_bursting = burst;
Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
+void Arc_Smoke(entity actor, .entity weaponentity)
+{
+ makevectors(actor.v_angle);
+ W_SetupShot_Range(actor,weaponentity,true,0,SND_Null,0,0,0);
-void Arc_Smoke()
-{SELFPARAM();
- makevectors(self.v_angle);
- W_SetupShot_Range(self,true,0,SND_Null,0,0,0);
-
- vector smoke_origin = w_shotorg + self.velocity*frametime;
- if ( self.arc_overheat > time )
+ vector smoke_origin = w_shotorg + actor.velocity*frametime;
+ if ( actor.arc_overheat > time )
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
{
Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
{
Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
- self.arc_smoke_sound = 1;
- sound(self, CH_SHOTS_SINGLE, SND_ARC_LOOP_OVERHEAT, VOL_BASE, ATTN_NORM);
+ actor.arc_smoke_sound = 1;
+ sound(actor, CH_SHOTS_SINGLE, SND_ARC_LOOP_OVERHEAT, VOL_BASE, ATTN_NORM);
- else if ( self.arc_beam && WEP_CVAR(arc, overheat_max) > 0 &&
- self.arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
+ else if ( actor.(weaponentity).arc_beam && WEP_CVAR(arc, overheat_max) > 0 &&
+ actor.(weaponentity).arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
}
( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
}
- if ( self.arc_smoke_sound && ( self.arc_overheat <= time ||
- !( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) ) ) || PS(self).m_switchweapon != WEP_ARC )
+ if ( actor.arc_smoke_sound && ( actor.arc_overheat <= time ||
+ !( PHYS_INPUT_BUTTON_ATCK(actor) || PHYS_INPUT_BUTTON_ATCK2(actor) ) ) || PS(actor).m_switchweapon != WEP_ARC )
- self.arc_smoke_sound = 0;
- sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
+ actor.arc_smoke_sound = 0;
+ sound(actor, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
WEP_CVAR(arc, beam_botaimspeed),
0,
WEP_CVAR(arc, beam_botaimlifetime),
WEP_CVAR(arc, beam_botaimspeed),
0,
WEP_CVAR(arc, beam_botaimlifetime),
}
METHOD(Arc, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
}
METHOD(Arc, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, WEP_CVAR(arc, beam_animtime), w_ready);
}
weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, WEP_CVAR(arc, beam_animtime), w_ready);
}
{
if(weapon_prepareattack(thiswep, actor, weaponentity, boolean(beam_fire2), 0))
{
{
if(weapon_prepareattack(thiswep, actor, weaponentity, boolean(beam_fire2), 0))
{
{
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
{
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(arc, bolt_refire)))
{
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(arc, bolt_refire)))
{
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, bolt_refire), w_ready);
}
}
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, bolt_refire), w_ready);
}
}
{
sound(actor, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
{
sound(actor, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
- int slot = weaponslot(weaponentity);
- ATTACK_FINISHED(actor, slot) = time + WEP_CVAR(arc, beam_refire) * W_WeaponRateFactor();
+ ATTACK_FINISHED(actor, slot) = time + WEP_CVAR(arc, beam_refire) * W_WeaponRateFactor(actor);
W_Arc_Attack2();
actor.arc_count = autocvar_g_balance_arc_secondary_count;
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_arc_secondary_animtime, w_arc_checkattack);
W_Arc_Attack2();
actor.arc_count = autocvar_g_balance_arc_secondary_count;
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_arc_secondary_animtime, w_arc_checkattack);
arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 4);
}
}
arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 4);
}
}
-METHOD(Arc, wr_checkammo1, bool(entity thiswep))
+METHOD(Arc, wr_checkammo1, bool(entity thiswep, entity actor))
-METHOD(Arc, wr_checkammo2, bool(entity thiswep))
+METHOD(Arc, wr_checkammo2, bool(entity thiswep, entity actor))
- float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(arc, bolt_ammo);
- ammo_amount += self.(weapon_load[WEP_ARC.m_id]) >= WEP_CVAR(arc, bolt_ammo);
+ float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(arc, bolt_ammo);
+ ammo_amount += actor.(weapon_load[WEP_ARC.m_id]) >= WEP_CVAR(arc, bolt_ammo);
-METHOD(Arc, wr_drop, void(entity thiswep))
+METHOD(Arc, wr_drop, void(entity thiswep, entity actor))
- SELFPARAM();
- weapon_dropevent_item.arc_overheat = self.arc_overheat;
- weapon_dropevent_item.arc_cooldown = self.arc_cooldown;
- self.arc_overheat = 0;
- self.arc_cooldown = 0;
+ weapon_dropevent_item.arc_overheat = actor.arc_overheat;
+ weapon_dropevent_item.arc_cooldown = actor.arc_cooldown;
+ actor.arc_overheat = 0;
+ actor.arc_cooldown = 0;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ actor.arc_BUTTON_ATCK_prev[slot] = false;
-METHOD(Arc, wr_pickup, void(entity thiswep))
+METHOD(Arc, wr_pickup, void(entity thiswep, entity actor))
- SELFPARAM();
- if ( !client_hasweapon(self, thiswep, false, false) &&
+ if ( !client_hasweapon(actor, thiswep, false, false) &&
- self.arc_overheat = weapon_dropevent_item.arc_overheat;
- self.arc_cooldown = weapon_dropevent_item.arc_cooldown;
+ actor.arc_overheat = weapon_dropevent_item.arc_overheat;
+ actor.arc_cooldown = weapon_dropevent_item.arc_cooldown;
+METHOD(Arc, wr_resetplayer, void(entity thiswep, entity actor))
+{
+ actor.arc_overheat = 0;
+ actor.arc_cooldown = 0;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ actor.arc_BUTTON_ATCK_prev[slot] = false;
+}
+METHOD(Arc, wr_playerdeath, void(entity thiswep, entity actor, .entity weaponentity))
+{
+ actor.arc_overheat = 0;
+ actor.arc_cooldown = 0;
+ int slot = weaponslot(weaponentity);
+ actor.arc_BUTTON_ATCK_prev[slot] = false;
+}
-METHOD(Arc, wr_impacteffect, void(entity thiswep))
+METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
if(w_deathtype & HITTYPE_SECONDARY)
{
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_ARC_BOLT_EXPLODE, org2, w_backoff * 1000, 1);
if(w_deathtype & HITTYPE_SECONDARY)
{
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_ARC_BOLT_EXPLODE, org2, w_backoff * 1000, 1);
- if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
+ if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
Draw_ArcBeam_callback_last_thickness = 0;
Draw_ArcBeam_callback_last_top = '0 0 0';
Draw_ArcBeam_callback_last_bottom = '0 0 0';
Draw_ArcBeam_callback_last_thickness = 0;
Draw_ArcBeam_callback_last_top = '0 0 0';
Draw_ArcBeam_callback_last_bottom = '0 0 0';
sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
}
sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
}
- self.draw = Draw_ArcBeam;
- self.entremove = Remove_ArcBeam;
- self.move_time = time;
- loopsound(self, CH_SHOTS_SINGLE, SND(ARC_LOOP), VOL_BASE, ATTEN_NORM);
+ this.draw = Draw_ArcBeam;
+ IL_PUSH(g_drawables, this);
+ this.entremove = Remove_ArcBeam;
+ this.move_time = time;
+ loopsound(this, CH_SHOTS_SINGLE, SND(ARC_LOOP), VOL_BASE, ATTEN_NORM);
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT;
flash.drawmask = MASK_NORMAL;
flash.solid = SOLID_NOT;
flash.avelocity_z = 5000;
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT;
flash.drawmask = MASK_NORMAL;
flash.solid = SOLID_NOT;
flash.avelocity_z = 5000;
- self.beam_degreespersegment = ReadShort();
- self.beam_distancepersegment = ReadShort();
- self.beam_maxangle = ReadShort();
- self.beam_range = ReadCoord();
- self.beam_returnspeed = ReadShort();
- self.beam_tightness = (ReadByte() / 10);
+ this.beam_degreespersegment = ReadShort();
+ this.beam_distancepersegment = ReadShort();
+ this.beam_maxangle = ReadShort();
+ this.beam_range = ReadCoord();
+ this.beam_returnspeed = ReadShort();
+ this.beam_tightness = (ReadByte() / 10);
- // self.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work?
- self.iflags = IFLAG_ORIGIN;
+ // this.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work?
+ this.iflags = IFLAG_ORIGIN;
- self.origin_x = ReadCoord();
- self.origin_y = ReadCoord();
- self.origin_z = ReadCoord();
+ this.origin_x = ReadCoord();
+ this.origin_y = ReadCoord();
+ this.origin_z = ReadCoord();
- self.v_angle_x = ReadCoord();
- self.v_angle_y = ReadCoord();
- self.v_angle_z = ReadCoord();
+ this.v_angle_x = ReadCoord();
+ this.v_angle_y = ReadCoord();
+ this.v_angle_z = ReadCoord();
- self.angles_x = ReadCoord();
- self.angles_y = ReadCoord();
- self.angles_z = ReadCoord();
+ this.angles_x = ReadCoord();
+ this.angles_y = ReadCoord();
+ this.angles_z = ReadCoord();
- vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(stof(getplayerkeyvalue(self.sv_entnum - 1, "colors")) & 0x0F, true) : '1 1 1');
- switch(self.beam_type)
+ vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(entcs_GetClientColors(this.sv_entnum - 1) & 0x0F, true) : '1 1 1');
+ switch(this.beam_type)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 8;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 8;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 8;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 8;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 8;
- self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
- self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 8;
+ this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
+ this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 8;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 20;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 0;
- self.beam_hitlight[3] = 0;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 50;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 0;
- self.beam_muzzlelight[3] = 0;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 8;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 20;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 0;
+ this.beam_hitlight[3] = 0;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 50;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 0;
+ this.beam_muzzlelight[3] = 0;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 14;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 14;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 14;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 14;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 14;
- self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
- self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 14;
+ this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
+ this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = beamcolor;
- self.beam_alpha = 0.5;
- self.beam_thickness = 14;
- self.beam_traileffect = (EFFECT_ARC_BEAM);
- self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = beamcolor;
+ this.beam_alpha = 0.5;
+ this.beam_thickness = 14;
+ this.beam_traileffect = (EFFECT_ARC_BEAM);
+ this.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)
- self.beam_color = randomvec();
- self.beam_alpha = 1;
- self.beam_thickness = 8;
- self.beam_traileffect = NULL;
- self.beam_hiteffect = NULL;
- self.beam_hitlight[0] = 0;
- self.beam_hitlight[1] = 1;
- self.beam_hitlight[2] = 1;
- self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
- self.beam_muzzlelight[0] = 0;
- self.beam_muzzlelight[1] = 1;
- self.beam_muzzlelight[2] = 1;
- self.beam_muzzlelight[3] = 1;
- self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect)
+ this.beam_color = randomvec();
+ this.beam_alpha = 1;
+ this.beam_thickness = 8;
+ this.beam_traileffect = NULL;
+ this.beam_hiteffect = NULL;
+ this.beam_hitlight[0] = 0;
+ this.beam_hitlight[1] = 1;
+ this.beam_hitlight[2] = 1;
+ this.beam_hitlight[3] = 1;
+ this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
+ this.beam_muzzlelight[0] = 0;
+ this.beam_muzzlelight[1] = 1;
+ this.beam_muzzlelight[2] = 1;
+ this.beam_muzzlelight[3] = 1;
+ this.beam_image = "particles/lgbeam";
+ if(this.beam_muzzleeffect)