From: mand1nga Date: Sat, 4 Dec 2010 17:42:08 +0000 (-0300) Subject: Added support for electro hitscan X-Git-Tag: xonotic-v0.1.0preview~65^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=85c300c2bcca827d57b586b1d8df6a039e55fb25;p=xonotic%2Fxonotic-data.pk3dir.git Added support for electro hitscan --- diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index da29a4418..ec3fb5e3c 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -62,7 +62,7 @@ void W_Plasma_Explode_Combo (void) void W_Plasma_Touch (void) { //self.velocity = self.velocity * 0.1; - + PROJECTILE_TOUCH; if (other.takedamage == DAMAGE_AIM) { W_Plasma_Explode (); @@ -178,10 +178,10 @@ void W_Electro_Attack2() proj.health = autocvar_g_balance_electro_secondary_health; proj.event_damage = W_Plasma_Damage; proj.flags = FL_PROJECTILE; - + proj.bouncefactor = autocvar_g_balance_electro_secondary_bouncefactor; proj.bouncestop = autocvar_g_balance_electro_secondary_bouncestop; - + #if 0 entity p2; p2 = spawn(); @@ -351,7 +351,14 @@ float w_electro(float req) self.bot_secondary_electromooth = 0; if(self.bot_secondary_electromooth == 0) { - if(bot_aim(autocvar_g_balance_electro_primary_speed, 0, autocvar_g_balance_electro_primary_lifetime, FALSE)) + bool shoot; + + if(autocvar_g_balance_electro_primary_speed) + shoot = bot_aim(autocvar_g_balance_electro_primary_speed, 0, autocvar_g_balance_electro_primary_lifetime, FALSE); + else + shoot = bot_aim(1000000, 0, 0.001, FALSE); + + if(shoot) { self.BUTTON_ATCK = TRUE; if(random() < 0.01) self.bot_secondary_electromooth = 1;