set g_balance_minelayer_speed 0
set g_balance_minelayer_speedstart 750
set g_balance_minelayer_lifetime 60
-set g_balance_minelayer_refire 2
+set g_balance_minelayer_refire 1.5
set g_balance_minelayer_animtime 0.4
set g_balance_minelayer_ammo 5
set g_balance_minelayer_health 10
+set g_balance_minelayer_limit 4 // 0 disables the limit
set g_balance_minelayer_damageforcescale 0
set g_balance_minelayer_detonatedelay -1 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
set g_balance_minelayer_remote_damage 45
#else
#ifdef SVQC
.float minelayer_detonate;
+.float mine_number;
void spawnfunc_weapon_minelayer (void)
{
local entity mine;
local entity flash;
+ // scan how many mines we placed, and return if we reached our limit
+ if(cvar("g_balance_minelayer_limit"))
+ {
+ entity min;
+ self.mine_number = 0;
+ for(min = world; (min = find(min, classname, "mine")); )
+ if(min.owner == self)
+ self.mine_number += 1;
+
+ if(self.mine_number >= cvar("g_balance_minelayer_limit"))
+ return;
+ }
+
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_minelayer_ammo");