]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_vaporizer.qc
Some balance fixes for arc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_vaporizer.qc
index 66510bc1c24a673cb75a405af90f935b32678265..7ad1e1dd8fe4544519cc763a38685b4af87a3fa9 100644 (file)
@@ -1,15 +1,18 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
-/* WEP_##id */ VAPORIZER,
-/* function */ W_Vaporizer,
-/* ammotype */ ammo_cells,
-/* impulse  */ 7,
-/* flags    */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
-/* rating   */ BOT_PICKUP_RATING_HIGH,
-/* color       */ '0.5 1 1',
-/* model    */ "minstanex",
-/* netname  */ "minstanex",
-/* fullname */ _("Vaporizer")
+/* WEP_##id  */ VAPORIZER,
+/* function  */ W_Vaporizer,
+/* ammotype  */ ammo_cells,
+/* impulse   */ 7,
+/* flags     */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
+/* rating    */ BOT_PICKUP_RATING_HIGH,
+/* color     */ '0.5 1 1',
+/* modelname */ "minstanex",
+/* simplemdl */ "foobar",
+/* crosshair */ "gfx/crosshairminstanex 0.4",
+/* wepimg    */ "weaponminstanex",
+/* refname   */ "vaporizer",
+/* wepname   */ _("Vaporizer")
 );
 
 #define VAPORIZER_SETTINGS(w_cvar,w_prop) VAPORIZER_SETTINGS_LIST(w_cvar, w_prop, VAPORIZER, vaporizer)
@@ -35,7 +38,8 @@ REGISTER_WEAPON(
        w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
        w_prop(id, sn, string, weaponreplace, weaponreplace) \
        w_prop(id, sn, float,  weaponstart, weaponstart) \
-       w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride)
+       w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride) \
+       w_prop(id, sn, float,  weaponthrowable, weaponthrowable)
 
 #ifdef SVQC
 VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
@@ -44,19 +48,19 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #else
 #ifdef SVQC
-void spawnfunc_weapon_vaporizer (void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
-void spawnfunc_weapon_minstanex () { spawnfunc_weapon_vaporizer(); }
+void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
 
-void W_Vaporizer_Attack (void)
+void W_Vaporizer_Attack(void)
 {
        float flying;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
-       W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
+       W_SetupShot(self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
 
        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, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
@@ -122,7 +126,7 @@ float W_Vaporizer(float req)
        {
                case WR_AIM:
                {
-                       if(self.WEP_AMMO(WEP_VAPORIZER) > 0)
+                       if(self.WEP_AMMO(VAPORIZER) > 0)
                                self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
                        else
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), FALSE); // WEAPONTODO: replace with proper vaporizer cvars
@@ -136,18 +140,18 @@ float W_Vaporizer(float req)
                                WEP_ACTION(self.weapon, WR_RELOAD);
                        else if(WEP_CVAR(vaporizer, reload_ammo) && self.clip_load < vaporizer_ammo) // forced reload
                                WEP_ACTION(self.weapon, WR_RELOAD);
-                       else if (self.BUTTON_ATCK)
+                       else if(self.BUTTON_ATCK)
                        {
-                               if (weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
+                               if(weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
                                {
                                        W_Vaporizer_Attack();
                                        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
                                }
                        }
-                       else if (self.BUTTON_ATCK2)
+                       else if(self.BUTTON_ATCK2)
                        {
-                               if (self.jump_interval <= time)
-                               if (weapon_prepareattack(1, -1))
+                               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)
                                        self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor();
@@ -157,10 +161,8 @@ float W_Vaporizer(float req)
                                                W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
 
                                        // ugly minstagib hack to reuse the fire mode of the laser
-                                       float w;
-                                       w = self.weapon;
-                                       self.weapon = WEP_BLASTER;
                                        W_Blaster_Attack(
+                                               WEP_VAPORIZER | HITTYPE_SECONDARY,
                                                WEP_CVAR_SEC(vaporizer, shotangle),
                                                WEP_CVAR_SEC(vaporizer, damage),
                                                WEP_CVAR_SEC(vaporizer, edgedamage),
@@ -171,7 +173,6 @@ float W_Vaporizer(float req)
                                                WEP_CVAR_SEC(vaporizer, delay),
                                                WEP_CVAR_SEC(vaporizer, lifetime)
                                        );
-                                       self.weapon = w;
                                        
                                        // now do normal refire
                                        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
@@ -191,18 +192,18 @@ float W_Vaporizer(float req)
                        precache_sound("weapons/nexwhoosh2.wav");
                        precache_sound("weapons/nexwhoosh3.wav");
                        //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
-                       VAPORIZER_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
+                       VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
                        return TRUE;
                }
                case WR_SETUP:
                {
-                       self.ammo_field = WEP_AMMO(WEP_VAPORIZER);
+                       self.ammo_field = WEP_AMMO(VAPORIZER);
                        self.vaporizer_lasthit = 0;
                        return TRUE;
                }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.WEP_AMMO(WEP_VAPORIZER) >= vaporizer_ammo;
+                       ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo;
                        ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo;
                        return ammo_amount;
                }
@@ -210,7 +211,7 @@ float W_Vaporizer(float req)
                {
                        if(!WEP_CVAR_SEC(vaporizer, ammo))
                                return TRUE;
-                       ammo_amount = self.WEP_AMMO(WEP_VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
+                       ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
                        ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
                        return ammo_amount;
                }
@@ -244,7 +245,7 @@ float W_Vaporizer(float req)
                        return WEAPON_VAPORIZER_MURDER;
                }
        }
-       return TRUE;
+       return FALSE;
 }
 #endif
 #ifdef CSQC
@@ -256,14 +257,21 @@ float W_Vaporizer(float req)
                {
                        vector org2;
                        org2 = w_org + w_backoff * 6;
-                       pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
-                       if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-                               
+                       if(w_deathtype & HITTYPE_SECONDARY)
+                       {
+                               pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+                               if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
+                       }
+                       else
+                       {
+                               pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+                               if(!w_issilent) { sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); }
+                       }
                        return TRUE;
                }
                case WR_INIT:
                {
+                       precache_sound("weapons/laserimpact.wav");
                        precache_sound("weapons/neximpact.wav");
                        if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
                        {
@@ -285,7 +293,7 @@ float W_Vaporizer(float req)
                        }
                }
        }
-       return TRUE;
+       return FALSE;
 }
 #endif
 #endif