if (e.classname == "plasma")
{
// change owner to whoever caused the combo explosion
- e.owner = own;
+ e.realowner = own;
e.takedamage = DAMAGE_NO;
e.classname = "plasma_chain";
e.think = W_Plasma_Explode_Combo;
{
if(other.takedamage == DAMAGE_AIM)
if(other.classname == "player")
- if(IsDifferentTeam(self.owner, other))
+ if(IsDifferentTeam(self.realowner, other))
if(other.deadflag == DEAD_NO)
if(IsFlying(other))
- AnnounceTo(self.owner, "electrobitch");
+ AnnounceTo(self.realowner, "electrobitch");
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
if (self.movetype == MOVETYPE_BOUNCE)
{
- RadiusDamage (self, self.owner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other);
+ RadiusDamage (self, self.realowner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other);
}
else
{
- W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_primary_comboradius, self.owner);
- RadiusDamage (self, self.owner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other);
+ W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_primary_comboradius, self.realowner);
+ RadiusDamage (self, self.realowner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other);
}
remove (self);
void W_Plasma_Explode_Combo (void)
{
- W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.owner);
+ W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.realowner);
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
+ RadiusDamage (self, self.realowner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
remove (self);
}
if (inflictor.classname == "plasma_chain" || inflictor.classname == "plasma_prim")
{
// change owner to whoever caused the combo explosion
- self.owner = inflictor.owner;
+ self.realowner = inflictor.realowner;
self.classname = "plasma_chain";
self.think = W_Plasma_Explode_Combo;
self.nextthink = time + min(autocvar_g_balance_electro_combo_radius, vlen(self.origin - inflictor.origin)) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler
proj = spawn ();
proj.classname = "plasma_prim";
- proj.owner = self;
+ proj.owner = proj.realowner = self;
proj.bot_dodge = TRUE;
proj.bot_dodgerating = autocvar_g_balance_electro_primary_damage;
proj.use = W_Plasma_Explode;
proj = spawn ();
proj.classname = "plasma";
- proj.owner = self;
+ proj.owner = proj.realowner = self;
proj.use = W_Plasma_Explode;
proj.think = adaptor_think2use_hittype_splash;
proj.bot_dodge = TRUE;
{
WriteByte(MSG_ENTITY, ENT_CLIENT_LGBEAM);
sf = sf & 0x7F;
- if(sound_allowed(MSG_BROADCAST, self.owner))
+ if(sound_allowed(MSG_BROADCAST, self.realowner))
sf |= 0x80;
WriteByte(MSG_ENTITY, sf);
if(sf & 1)
{
- WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+ WriteByte(MSG_ENTITY, num_for_edict(self.realowner));
WriteCoord(MSG_ENTITY, autocvar_g_balance_electro_primary_range);
}
if(sf & 2)
.float prevlgfire;
float lgbeam_checkammo()
{
- if(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO)
return TRUE;
else if(autocvar_g_balance_electro_reload_ammo)
- return self.owner.clip_load > 0;
+ return self.realowner.clip_load > 0;
else
- return self.owner.ammo_cells > 0;
+ return self.realowner.ammo_cells > 0;
}
+entity lgbeam_owner_ent;
void lgbeam_think()
{
entity owner_player;
- owner_player = self.owner;
+ owner_player = self.realowner;
owner_player.prevlgfire = time;
if (self != owner_player.lgbeam)
}
W_SetupShot_Range(owner_player, TRUE, 0, "", 0, autocvar_g_balance_electro_primary_damage * dt, autocvar_g_balance_electro_primary_range);
- WarpZone_traceline_antilag(owner_player, w_shotorg, w_shotend, MOVE_NORMAL, owner_player, ANTILAG_LATENCY(owner_player));
+ if(!lgbeam_owner_ent)
+ {
+ lgbeam_owner_ent = spawn();
+ lgbeam_owner_ent.classname = "lgbeam_owner_ent";
+ }
+ WarpZone_traceline_antilag(lgbeam_owner_ent, w_shotorg, w_shotend, MOVE_NORMAL, lgbeam_owner_ent, ANTILAG_LATENCY(owner_player));
// apply the damage
if(trace_ent)
beam.classname = "lgbeam";
beam.solid = SOLID_NOT;
beam.think = lgbeam_think;
- beam.owner = self;
+ beam.owner = beam.realowner = self;
beam.movetype = MOVETYPE_NONE;
beam.shot_spread = 0;
beam.bot_dodge = TRUE;