]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
Add g_balance_electro_secondary_limit setting to allow controlling the maximum number...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index 10005f22e541eb41f8e472ad9ca307fe1e0cecc7..21a2f9b0128723b4d719acc46d3d20f852e2a569 100644 (file)
@@ -1,6 +1,7 @@
 #include "electro.qh"
 
 #ifdef SVQC
+#include <common/effects/qc/_mod.qh>
 
 void W_Electro_TriggerCombo(vector org, float rad, entity own)
 {
@@ -295,6 +296,13 @@ void W_Electro_Orb_Stick(entity this, entity to)
        IL_PUSH(g_projectiles, newproj);
        IL_PUSH(g_bot_dodge, newproj);
 
+       // check if limits are enabled (we can tell by checking if the original orb is listed) and push it to the list if so
+       if(IL_CONTAINS(g_rubble, this))
+       {
+               newproj.creationtime = this.creationtime;
+               IL_PUSH(g_rubble, newproj);
+       }
+
        delete(this);
 
        if(to)
@@ -413,6 +421,12 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity)
        proj.bouncestop = WEP_CVAR_SEC(electro, bouncestop);
        proj.missile_flags = MIF_SPLASH | MIF_ARC;
 
+       if(WEP_CVAR_SEC(electro, limit) > 0)
+       {
+               RubbleNew(proj);
+               RubbleLimit("electro_orb", WEP_CVAR_SEC(electro, limit), adaptor_think2use_hittype_splash);
+       }
+
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
 
        MUTATOR_CALLHOOK(EditProjectile, actor, proj);