// }}}
// {{{ electro // TODO
set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 2
+set g_balance_electro_primary_damage 120
set g_balance_electro_primary_edgedamage 0
-set g_balance_electro_primary_force 13
-set g_balance_electro_primary_force_up 100
+set g_balance_electro_primary_force 780
+set g_balance_electro_primary_force_up 6000
set g_balance_electro_primary_radius 850
set g_balance_electro_primary_comboradius 0
set g_balance_electro_primary_speed 0
set g_balance_electro_primary_lifetime 0
set g_balance_electro_primary_refire 0
set g_balance_electro_primary_animtime 0
-set g_balance_electro_primary_ammo 0.66
+set g_balance_electro_primary_ammo 40
set g_balance_electro_primary_range 800
-set g_balance_electro_primary_velocityfactor 0.75
+set g_balance_electro_primary_velocityfactor 45
set g_balance_electro_secondary_damage 50
set g_balance_electro_secondary_spread 0.05
set g_balance_electro_secondary_edgedamage 0
// }}}
// {{{ electro // TODO
set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 2
+set g_balance_electro_primary_damage 120
set g_balance_electro_primary_edgedamage 0
-set g_balance_electro_primary_force 13
-set g_balance_electro_primary_force_up 100
+set g_balance_electro_primary_force 780
+set g_balance_electro_primary_force_up 6000
set g_balance_electro_primary_radius 850
set g_balance_electro_primary_comboradius 0
set g_balance_electro_primary_speed 0
set g_balance_electro_primary_lifetime 0
set g_balance_electro_primary_refire 0
set g_balance_electro_primary_animtime 0
-set g_balance_electro_primary_ammo 0.66
+set g_balance_electro_primary_ammo 40
set g_balance_electro_primary_range 800
-set g_balance_electro_primary_velocityfactor 0.75
+set g_balance_electro_primary_velocityfactor 45
set g_balance_electro_secondary_damage 50
set g_balance_electro_secondary_spread 0.05
set g_balance_electro_secondary_edgedamage 0
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
}
+.entity lgbeam, exteriorlgbeam;
void lgbeam_think()
{
+ if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self != self.owner.lgbeam)
+ {
+ remove(self);
+ return;
+ }
+
self.nextthink = time;
makevectors(self.owner.v_angle);
void exteriorlgbeam_think()
{
- if (!self.owner.BUTTON_ATCK || self.owner.ammo_cells <= 0) // || (self.ammo_cells <= 0 && !(self.items & IT_UNLIMITED_WEAPON_AMMO)))
+ if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self != self.owner.exteriorlgbeam)
{
sound (self, CHAN_PROJECTILE, "sound/misc/null.wav", VOL_BASE, ATTN_NORM);
remove(self);
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo");
+ self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime;
self.nextthink = time;
Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * frametime, WEP_ELECTRO, trace_endpos, force * frametime);
}
+ self.angles = '0 0 0';
self.scale = vlen(gettaginfo(self, 0) - trace_endpos) / 256 * (0.75 + 0.75 * random());
- gettaginfo(self, 0);
// v_forward, v_right, v_up now are the ACTUAL directions
- // express self.angles in terms of them!
+ // express self.angles in terms of them to aim at target!
self.angles = vectoangles('1 0 0' * (angle * v_forward) + '0 -1 0' * (angle * v_right) + '0 0 1' * (angle * v_up));
}
// experimental lightning gun
void W_Electro_Attack3 (void)
{
- entity beam;
+ entity beam, oldself;
- beam = spawn();
+ self.lgbeam = beam = spawn();
setmodel(beam,"models/turrets/phaser_beam.md3");
beam.effects = EF_LOWPRECISION;
beam.solid = SOLID_NOT;
beam.think = lgbeam_think;
- beam.scale = cvar("g_balance_electro_primary_range") / 256;
- beam.nextthink = time;
beam.owner = self;
beam.movetype = MOVETYPE_NONE;
if(gettagindex(self.weaponentity, "shot"))
else
setattachment(beam, self.weaponentity, "tag_shot");
- beam = spawn();
- beam.ticrate = autocvar_sys_ticrate;
+ oldself = self;
+ self = beam;
+ self.think();
+ self = oldself;
+
+ self.exteriorlgbeam = beam = spawn();
setmodel(beam,"models/turrets/phaser_beam.md3");
beam.effects = EF_LOWPRECISION;
beam.solid = SOLID_NOT;
beam.think = exteriorlgbeam_think;
- beam.scale = cvar("g_balance_electro_primary_range") / 256;
- beam.nextthink = time;
beam.owner = self;
beam.movetype = MOVETYPE_NONE;
- beam.viewmodelforclient = self;
+ //beam.viewmodelforclient = self;
if(self.weaponentity.oldorigin_x > 0)
{
setattachment(beam, self.exteriorweaponentity, "");
beam.shot_spread = 0;
beam.bot_dodge = TRUE;
- beam.bot_dodgerating = cvar("g_balance_electro_primary_damage")/autocvar_sys_ticrate;
+ beam.bot_dodgerating = cvar("g_balance_electro_primary_damage");
+
+ oldself = self;
+ self = beam;
+ self.think();
+ self = oldself;
}
void spawnfunc_weapon_electro (void)