]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Midair combos
authorMario <mario.mario@y7mail.com>
Sun, 8 Dec 2013 06:41:48 +0000 (17:41 +1100)
committerMario <mario.mario@y7mail.com>
Sun, 8 Dec 2013 06:41:48 +0000 (17:41 +1100)
balanceXonotic.cfg
qcsrc/common/weapons/w_electro.qc

index e01b2e41b5a5c2a8140bef115f7bb075464392f0..fa56aaa67471c643624290b88fcc08106222dece 100644 (file)
@@ -428,6 +428,7 @@ set g_balance_electro_primary_force 200
 set g_balance_electro_primary_force_up 0
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_comboradius 300
+set g_balance_electro_primary_midaircombo_interval 0.3
 set g_balance_electro_primary_speed 2500
 set g_balance_electro_primary_spread 0
 set g_balance_electro_primary_lifetime 5
index 2f16f8a11813f4f549828f49d4ec1154fd51ecd7..af9a542914e39924bb04112d8435c503b685e18c 100644 (file)
@@ -23,6 +23,7 @@ REGISTER_WEAPON(
        w_cvar(WEP_ELECTRO, electro, MO_BOTH, spread) \
        w_cvar(WEP_ELECTRO, electro, MO_BOTH, lifetime) \
        w_cvar(WEP_ELECTRO, electro, MO_PRI,  comboradius) \
+       w_cvar(WEP_ELECTRO, electro, MO_PRI,  midaircombo_interval) \
        w_cvar(WEP_ELECTRO, electro, MO_SEC,  bouncefactor) \
        w_cvar(WEP_ELECTRO, electro, MO_SEC,  bouncestop) \
        w_cvar(WEP_ELECTRO, electro, MO_SEC,  count) \
@@ -212,6 +213,19 @@ void W_Plasma_Damage(entity inflictor, entity attacker, float damage, float deat
        }
 }
 
+void W_Plasma_Think()
+{
+       self.nextthink = time + WEP_CVAR_PRI(electro, midaircombo_interval);
+       
+       if(time >= self.ltime)
+       {
+               self.use();
+               return;
+       }
+       
+       W_Plasma_TriggerCombo(self.origin, WEP_CVAR_PRI(electro, comboradius), self.realowner);
+}
+
 void W_Electro_Attack_Bolt(void)
 {
        entity proj;
@@ -228,8 +242,9 @@ void W_Electro_Attack_Bolt(void)
        proj.bot_dodge = TRUE;
        proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
        proj.use = W_Plasma_Explode;
-       proj.think = adaptor_think2use_hittype_splash;
-       proj.nextthink = time + WEP_CVAR_PRI(electro, lifetime);
+       proj.think = W_Plasma_Think;
+       proj.nextthink = time;
+       proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_ELECTRO;
        setorigin(proj, w_shotorg);