]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_vaporizer.qc
Make vaporizer deal 150 damage in most configs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_vaporizer.qc
index 7ad1e1dd8fe4544519cc763a38685b4af87a3fa9..f55342f923e1151a548960a8a33648774eb5c8a7 100644 (file)
@@ -19,6 +19,7 @@ REGISTER_WEAPON(
 #define VAPORIZER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
        w_cvar(id, sn, PRI, ammo) \
        w_cvar(id, sn, PRI, animtime) \
+       w_cvar(id, sn, PRI, damage) \
        w_cvar(id, sn, PRI, refire) \
        w_cvar(id, sn, SEC, ammo) \
        w_cvar(id, sn, SEC, animtime) \
@@ -53,14 +54,18 @@ void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
 
 void W_Vaporizer_Attack(void)
 {
-       float flying;
+       float flying, vaporizer_damage;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+       vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000);
 
-       W_SetupShot(self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
+       W_SetupShot(self, TRUE, 0, "", CH_WEAPON_A, vaporizer_damage);
+       // handle sound separately so we can change the volume
+       // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
+       sound (self, CH_WEAPON_A, "weapons/minstanexfire.wav", VOL_BASE * 0.8, ATTEN_NORM);
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
+       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
@@ -111,7 +116,7 @@ void W_Vaporizer_Attack(void)
                        break;
        }
        
-       W_DecreaseAmmo(((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
+       W_DecreaseAmmo(((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
 }
 
 float W_Vaporizer(float req)
@@ -120,7 +125,7 @@ float W_Vaporizer(float req)
        float vaporizer_ammo;
 
        // now multiple WR_s use this
-       vaporizer_ammo = ((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
+       vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
 
        switch(req)
        {
@@ -153,14 +158,14 @@ float W_Vaporizer(float req)
                                if(self.jump_interval <= time)
                                if(weapon_prepareattack(1, -1))
                                {
-                                       // handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib)
+                                       // handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib)
                                        self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor();
                                        
                                        // decrease ammo for the laser?
                                        if(WEP_CVAR_SEC(vaporizer, ammo))
                                                W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
 
-                                       // ugly minstagib hack to reuse the fire mode of the laser
+                                       // ugly instagib hack to reuse the fire mode of the laser
                                        W_Blaster_Attack(
                                                WEP_VAPORIZER | HITTYPE_SECONDARY,
                                                WEP_CVAR_SEC(vaporizer, shotangle),