set g_balance_laser_secondary_shotangle 0
set g_balance_laser_secondary_delay 0
set g_balance_laser_secondary_gauntlet 0
-// }}}
+// }}
// {{{ shotgun
set g_balance_shotgun_primary_bullets 6
set g_balance_shotgun_primary_damage 9
set g_balance_grenadelauncher_primary_animtime 0.3
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 25
+set g_balance_grenadelauncher_secondary_sticky 0
set g_balance_grenadelauncher_secondary_damage 70
set g_balance_grenadelauncher_secondary_edgedamage 38
set g_balance_grenadelauncher_secondary_force 400
set g_balance_grenadelauncher_secondary_speed_z 0
set g_balance_grenadelauncher_secondary_spread 0
set g_balance_grenadelauncher_secondary_lifetime 2.5
+set g_balance_grenadelauncher_secondary_lifetime2 0
set g_balance_grenadelauncher_secondary_refire 0.7
set g_balance_grenadelauncher_secondary_animtime 0.3
set g_balance_grenadelauncher_secondary_ammo 2
set g_balance_grenadelauncher_primary_animtime 0.3
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 25
+set g_balance_grenadelauncher_secondary_sticky 0
set g_balance_grenadelauncher_secondary_damage 70
set g_balance_grenadelauncher_secondary_edgedamage 38
set g_balance_grenadelauncher_secondary_force 400
set g_balance_grenadelauncher_secondary_speed_z 0
set g_balance_grenadelauncher_secondary_spread 0
set g_balance_grenadelauncher_secondary_lifetime 2.5
+set g_balance_grenadelauncher_secondary_lifetime2 0
set g_balance_grenadelauncher_secondary_refire 0.7
set g_balance_grenadelauncher_secondary_animtime 0.3
set g_balance_grenadelauncher_secondary_ammo 2
// }}}
// {{{ mortar // TODO
set g_balance_grenadelauncher_primary2secondary 0
-set g_balance_grenadelauncher_primary_sticky 1
-set g_balance_grenadelauncher_primary_damage 100
-set g_balance_grenadelauncher_primary_edgedamage 30
-set g_balance_grenadelauncher_primary_force 300
-set g_balance_grenadelauncher_primary_radius 150
-set g_balance_grenadelauncher_primary_speed 800
-set g_balance_grenadelauncher_primary_speed_up 0
-set g_balance_grenadelauncher_primary_speed_z 350
+set g_balance_grenadelauncher_primary_sticky 0
+set g_balance_grenadelauncher_primary_damage 60
+set g_balance_grenadelauncher_primary_edgedamage 35
+set g_balance_grenadelauncher_primary_force 280
+set g_balance_grenadelauncher_primary_radius 100
+set g_balance_grenadelauncher_primary_speed 2000
+set g_balance_grenadelauncher_primary_speed_up 200
+set g_balance_grenadelauncher_primary_speed_z 0
set g_balance_grenadelauncher_primary_spread 0
set g_balance_grenadelauncher_primary_lifetime 5
set g_balance_grenadelauncher_primary_lifetime2 0.65
set g_balance_grenadelauncher_primary_animtime 0.2
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 72
+set g_balance_grenadelauncher_secondary_sticky 1
set g_balance_grenadelauncher_secondary_damage 100
set g_balance_grenadelauncher_secondary_edgedamage 30
set g_balance_grenadelauncher_secondary_force 300
set g_balance_grenadelauncher_secondary_radius 150
-set g_balance_grenadelauncher_secondary_speed 800
-set g_balance_grenadelauncher_secondary_speed_up 0
-set g_balance_grenadelauncher_secondary_speed_z 350
-set g_balance_grenadelauncher_secondary_spread 0.025
-set g_balance_grenadelauncher_secondary_lifetime 2.2
+set g_balance_grenadelauncher_secondary_speed 1000
+set g_balance_grenadelauncher_secondary_speed_up 200
+set g_balance_grenadelauncher_secondary_speed_z 0
+set g_balance_grenadelauncher_secondary_spread 0
+set g_balance_grenadelauncher_secondary_lifetime 5
+set g_balance_grenadelauncher_secondary_lifetime2 1
set g_balance_grenadelauncher_secondary_refire 0.8
set g_balance_grenadelauncher_secondary_animtime 0.2
set g_balance_grenadelauncher_secondary_ammo 2
-set g_balance_grenadelauncher_secondary_health 0
+set g_balance_grenadelauncher_secondary_health 72
set g_balance_grenadelauncher_secondary_damageforcescale 0
set g_balance_grenadelauncher_secondary_bouncefactor 0.7
set g_balance_grenadelauncher_secondary_bouncestop 0.12
set g_balance_grenadelauncher_primary_animtime 0.3
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 25
+set g_balance_grenadelauncher_secondary_sticky 0
set g_balance_grenadelauncher_secondary_damage 60
set g_balance_grenadelauncher_secondary_edgedamage 38
set g_balance_grenadelauncher_secondary_force 400
set g_balance_grenadelauncher_secondary_speed_z 0
set g_balance_grenadelauncher_secondary_spread 0
set g_balance_grenadelauncher_secondary_lifetime 1
+set g_balance_grenadelauncher_secondary_lifetime2 0
set g_balance_grenadelauncher_secondary_refire 0.7
set g_balance_grenadelauncher_secondary_animtime 0.3
set g_balance_grenadelauncher_secondary_ammo 2
set g_balance_grenadelauncher_primary_animtime 0.2
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 25
+set g_balance_grenadelauncher_secondary_sticky 0
set g_balance_grenadelauncher_secondary_damage 100
set g_balance_grenadelauncher_secondary_edgedamage 30
set g_balance_grenadelauncher_secondary_force 300
set g_balance_grenadelauncher_secondary_speed_z 200
set g_balance_grenadelauncher_secondary_spread 0
set g_balance_grenadelauncher_secondary_lifetime 1.5
+set g_balance_grenadelauncher_secondary_lifetime2 0
set g_balance_grenadelauncher_secondary_refire 0.8
set g_balance_grenadelauncher_secondary_animtime 0.2
set g_balance_grenadelauncher_secondary_ammo 2
void W_Grenade_Touch2 (void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM)
+ if(cvar("g_balance_grenadelauncher_secondary_sticky") && other.takedamage != DAMAGE_AIM)
{
- self.use ();
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+
+ // let it stick whereever it is
+ self.oldvelocity = self.velocity;
+ self.velocity = '0 0 0';
+ self.movetype = MOVETYPE_NONE; // also disables gravity
+ self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
+ UpdateCSQCProjectile(self);
+
+ // do not respond to any more touches
+ self.solid = SOLID_NOT;
+
+ self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
}
else
{
- float r;
- r = random() * 6;
- if(r < 1)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 2)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 3)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
- else if(r < 4)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
- else if(r < 5)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ if (other.takedamage == DAMAGE_AIM)
+ {
+ self.use ();
+ }
else
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
- self.projectiledeathtype |= HITTYPE_BOUNCE;
+ {
+ float r;
+ r = random() * 6;
+ if(r < 1)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 2)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 3)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 4)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 5)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ else
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ self.projectiledeathtype |= HITTYPE_BOUNCE;
+ }
}
}
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+ if(cvar("g_balance_grenadelauncher_secondary_sticky"))
+ CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
+ else
+ CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
}
void spawnfunc_weapon_grenadelauncher (void)