set g_balance_electro_secondary_force 50
set g_balance_electro_secondary_health 5
set g_balance_electro_secondary_lifetime 4
+set g_balance_electro_secondary_limit 0
set g_balance_electro_secondary_radius 150
set g_balance_electro_secondary_refire 0.2
set g_balance_electro_secondary_refire2 1.6
set g_balance_electro_secondary_force 200
set g_balance_electro_secondary_health 5
set g_balance_electro_secondary_lifetime 5
+set g_balance_electro_secondary_limit 0
set g_balance_electro_secondary_radius 150
set g_balance_electro_secondary_refire 0.3
set g_balance_electro_secondary_refire2 0
set g_balance_electro_secondary_force 50
set g_balance_electro_secondary_health 5
set g_balance_electro_secondary_lifetime 4
+set g_balance_electro_secondary_limit 0
set g_balance_electro_secondary_radius 150
set g_balance_electro_secondary_refire 0.2
set g_balance_electro_secondary_refire2 1.6
set g_balance_electro_secondary_force 200
set g_balance_electro_secondary_health 5
set g_balance_electro_secondary_lifetime 3
+set g_balance_electro_secondary_limit 0
set g_balance_electro_secondary_radius 150
set g_balance_electro_secondary_refire 0.2
set g_balance_electro_secondary_refire2 1.5
set g_balance_electro_secondary_force 50
set g_balance_electro_secondary_health 5
set g_balance_electro_secondary_lifetime 4
+set g_balance_electro_secondary_limit 0
set g_balance_electro_secondary_radius 150
set g_balance_electro_secondary_refire 0.2
set g_balance_electro_secondary_refire2 1.6
#include <common/effects/qc/globalsound.qc>
#include <common/effects/qc/lightningarc.qc>
#include <common/effects/qc/modeleffects.qc>
+#include <common/effects/qc/rubble.qc>
#include <common/effects/qc/globalsound.qh>
#include <common/effects/qc/lightningarc.qh>
#include <common/effects/qc/modeleffects.qh>
+#include <common/effects/qc/rubble.qh>
--- /dev/null
+#include "rubble.qh"
+
+#ifdef GAMEQC
+void RubbleLimit(string cname, int limit, void(entity) deleteproc)
+{
+ // remove rubble of the same type if it's at the limit
+ // remove multiple rubble if the limit has been decreased
+ while (1)
+ {
+ // walk the list and count the entities, find the oldest
+ // initialize our search with the first entity
+ int c = 0;
+ entity oldest = NULL;
+ float oldesttime = 0;
+ // compare to all other matching entities
+ IL_EACH(g_rubble, it.classname == cname,
+ {
+ ++c;
+ if(!oldest || oldesttime > it.creationtime)
+ {
+ oldest = it;
+ oldesttime = it.creationtime;
+ }
+ });
+
+ // stop if there are less than the limit already
+ if (c <= limit) break;
+
+ // delete this oldest one and search again
+ deleteproc(oldest);
+ }
+}
+
+entity RubbleNew(entity e)
+{
+ e.creationtime = time;
+ IL_PUSH(g_rubble, e);
+ return e;
+}
+#endif
#pragma once
-#ifdef CSQC
-
+#ifdef GAMEQC
entityclass(Rubble);
classfield(Rubble).float creationtime;
IntrusiveList g_rubble;
STATIC_INIT(g_rubble) { g_rubble = IL_NEW(); }
-void RubbleLimit(string cname, int limit, void(entity) deleteproc)
-{
- // remove rubble of the same type if it's at the limit
- // remove multiple rubble if the limit has been decreased
- while (1)
- {
- // walk the list and count the entities, find the oldest
- // initialize our search with the first entity
- int c = 0;
- entity oldest = NULL;
- float oldesttime = 0;
- // compare to all other matching entities
- IL_EACH(g_rubble, it.classname == cname,
- {
- ++c;
- if(!oldest || oldesttime > it.creationtime)
- {
- oldest = it;
- oldesttime = it.creationtime;
- }
- });
-
- // stop if there are less than the limit already
- if (c <= limit) break;
-
- // delete this oldest one and search again
- deleteproc(oldest);
- }
-}
-
-entity RubbleNew(entity e)
-{
- e.creationtime = time;
- IL_PUSH(g_rubble, e);
- return e;
-}
+void RubbleLimit(string cname, int limit, void(entity) deleteproc);
+entity RubbleNew(entity e);
#endif
#include "electro.qh"
#ifdef SVQC
+#include <common/effects/qc/_mod.qh>
void W_Electro_TriggerCombo(vector org, float rad, entity own)
{
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)
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);
P(class, prefix, force, float, BOTH) \
P(class, prefix, health, float, SEC) \
P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, limit, float, SEC) \
P(class, prefix, midaircombo_enemy, bool, PRI) \
P(class, prefix, midaircombo_explode, float, PRI) \
P(class, prefix, midaircombo_interval, float, PRI) \