]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_vaporizer.qc
Merge branches 'TimePath/weaponsys' and 'Mario/modpack'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_vaporizer.qc
index b67056f7e2257926c58cfdcc29bf7e1510da82b1..da94149009fc835cc1e09b6ffea1a66d42aa4c46 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef REGISTER_WEAPON
+#ifndef IMPLEMENTATION
 REGISTER_WEAPON(
 /* WEP_##id  */ VAPORIZER,
 /* function  */ W_Vaporizer,
@@ -46,9 +46,10 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 .float vaporizer_lasthit;
 .float jump_interval;
 #endif
-#else
+#endif
+#ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER.m_id); }
 void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
 
 void W_Vaporizer_Attack(void)
@@ -63,7 +64,7 @@ void W_Vaporizer_Attack(void)
 
        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.m_id);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
@@ -75,7 +76,7 @@ void W_Vaporizer_Attack(void)
 
        self.vaporizer_lasthit = damage_goodhits;
 
-       pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+       Send_Effect("nex_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        // teamcolor / hit beam effect
        vector v;
@@ -84,33 +85,33 @@ void W_Vaporizer_Attack(void)
        {
                case NUM_TEAM_1:   // Red
                        if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3RED_HIT", w_shotorg, v, 1);
                        else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3RED", w_shotorg, v, 1);
                        break;
                case NUM_TEAM_2:   // Blue
                        if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3BLUE_HIT", w_shotorg, v, 1);
                        else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3BLUE", w_shotorg, v, 1);
                        break;
                case NUM_TEAM_3:   // Yellow
                        if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3YELLOW_HIT", w_shotorg, v, 1);
                        else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3YELLOW", w_shotorg, v, 1);
                        break;
                case NUM_TEAM_4:   // Pink
                        if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3PINK_HIT", w_shotorg, v, 1);
                        else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3PINK", w_shotorg, v, 1);
                        break;
                default:
                        if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3_HIT"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3_HIT", w_shotorg, v, 1);
                        else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
+                               Send_Effect("TE_TEI_G3", w_shotorg, v, 1);
                        break;
        }
 
@@ -165,9 +166,9 @@ float W_Vaporizer(float req)
 
                                        // ugly instagib hack to reuse the fire mode of the laser
                                        int oldwep = self.weapon; // we can't avoid this hack
-                                       self.weapon = WEP_BLASTER;
+                                       self.weapon = WEP_BLASTER.m_id;
                                        W_Blaster_Attack(
-                                               WEP_BLASTER | HITTYPE_SECONDARY,
+                                               WEP_BLASTER.m_id | HITTYPE_SECONDARY,
                                                WEP_CVAR_SEC(vaporizer, shotangle),
                                                WEP_CVAR_SEC(vaporizer, damage),
                                                WEP_CVAR_SEC(vaporizer, edgedamage),
@@ -210,7 +211,7 @@ float W_Vaporizer(float req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo;
-                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo;
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -218,7 +219,7 @@ float W_Vaporizer(float req)
                        if(!WEP_CVAR_SEC(vaporizer, ammo))
                                return true;
                        ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
-                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG: