The weapon aliases created obviously aren't unique, they are only in Overkill where only the Overkill weapons are allowed.
Thanks to this change the Ball Stealer alias has been restored and 2 impulses are now free.
/* spawnfunc */ ATTRIB(OverkillMachineGun, m_canonical_spawnfunc, string, "weapon_okmachinegun");
/* ammotype */ ATTRIB(OverkillMachineGun, ammo_type, Resource, RES_BULLETS);
/* impulse */ ATTRIB(OverkillMachineGun, impulse, int, 3);
+/* unique imp*/ ATTRIB(OverkillMachineGun, m_unique_impulse, int, 3); // same as impulse to avoid running out of impulses
/* flags */ ATTRIB(OverkillMachineGun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_MUTATORBLOCKED);
/* rating */ ATTRIB(OverkillMachineGun, bot_pickupbasevalue, float, 7000);
/* color */ ATTRIB(OverkillMachineGun, m_color, vector, '0.678 0.886 0.267');
/* spawnfunc */ ATTRIB(OverkillNex, m_canonical_spawnfunc, string, "weapon_oknex");
/* ammotype */ ATTRIB(OverkillNex, ammo_type, Resource, RES_CELLS);
/* impulse */ ATTRIB(OverkillNex, impulse, int, 7);
+/* unique imp*/ ATTRIB(OverkillNex, m_unique_impulse, int, 7); // same as impulse to avoid running out of impulses
/* flags */ ATTRIB(OverkillNex, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
/* rating */ ATTRIB(OverkillNex, bot_pickupbasevalue, float, 8000);
/* color */ ATTRIB(OverkillNex, m_color, vector, '0.459 0.765 0.835');
/* spawnfunc */ ATTRIB(OverkillShotgun, m_canonical_spawnfunc, string, "weapon_okshotgun");
/* ammotype */ ATTRIB(OverkillShotgun, ammo_type, Resource, RES_SHELLS);
/* impulse */ ATTRIB(OverkillShotgun, impulse, int, 2);
+/* unique imp*/ ATTRIB(OverkillShotgun, m_unique_impulse, int, 2); // same as impulse to avoid running out of impulses
/* flags */ ATTRIB(OverkillShotgun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
/* rating */ ATTRIB(OverkillShotgun, bot_pickupbasevalue, float, 6000);
/* color */ ATTRIB(OverkillShotgun, m_color, vector, '0.518 0.608 0.659');
if (it.spawnflags & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set;
if (it == WEP_Null) continue;
if (it.spawnflags & WEP_FLAG_SPECIALATTACK) continue;
- // TODO: this exists to filter out the Ball Stealer, otherwise we run out of impulses
- if ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_TYPE_OTHER)) continue;
+
+ if ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && it.m_unique_impulse)
+ {
+ // this mutator weapon recycles an impulse of a weapon group to reduce the number of impulses used,
+ // which are very limited. The impulse number must be unique in the mutator
+ localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, it.m_unique_impulse));
+ continue;
+ }
it.m_unique_impulse = imp;
if (imp <= WEP_IMPULSE_END)