]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move def's of muzzle_flash & uzi_bulletrcounter to defs.qh rename uzi_bulletcounter...
authortzork <jakob_mg@hotmail.com>
Tue, 28 Dec 2010 15:01:32 +0000 (16:01 +0100)
committertzork <jakob_mg@hotmail.com>
Tue, 28 Dec 2010 15:01:32 +0000 (16:01 +0100)
qcsrc/server/defs.qh
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_uzi.qc

index 96bc87cd3a905acc5d2e02228ffc579eed6cef2e..bbd554f5e375697c29dace35b7ab1abcf79fd3d7 100644 (file)
@@ -660,3 +660,6 @@ float serverflags;
 .float freezetag_frozen;
 .float freezetag_beginrevive_time;
 .float freezetag_revive_progress;
+
+.entity muzzle_flash;
+.float misc_bulletcounter;     // replaces uzi & hlac bullet counter.
index 5d37db4929d115b40b30d0b634162066e0d005b4..d1d48c46cdb82b4f5d90746ea7ab8c5d42afe041 100644 (file)
@@ -618,16 +618,16 @@ void walker_attack()
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
-    if (self.uzi_bulletcounter == 2)
+    if (self.misc_bulletcounter == 2)
     {
 
                UziFlash();
                setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 
-        self.uzi_bulletcounter = 0;
+        self.misc_bulletcounter = 0;
     }
 
-    self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+    self.misc_bulletcounter = self.misc_bulletcounter + 1;
     self.tur_head.frame    = self.tur_head.frame + 1;
 }
 
index fa0781fa786519e736ef39d86fa7a9da1d7d7730..6743f73d2305aeffc3ae4b66c623945bcd5c06e6 100644 (file)
@@ -255,17 +255,17 @@ void spiderbot_miniguns_do()
         {
             // Fire bullets, alternating trails left<->right
             self = self.owner;
-            if(self.uzi_bulletcounter == 1)
+            if(self.misc_bulletcounter == 1)
             {
                 spiderbot_minigun_fire(self.vehicle.gun1, 0);
                 spiderbot_minigun_fire(self.vehicle.gun2, 1);
-                self.uzi_bulletcounter = 0;
+                self.misc_bulletcounter = 0;
             }
             else
             {
                 spiderbot_minigun_fire(self.vehicle.gun1, 1);
                 spiderbot_minigun_fire(self.vehicle.gun2, 0);
-                self.uzi_bulletcounter += 1;
+                self.misc_bulletcounter += 1;
             }
 
             self = self.vehicle;
index e3d3cb991883e1f209cb666712a89a3110f3693e..a07d54c2283e330741d84697ac72b50a7b33126d 100644 (file)
@@ -2,25 +2,17 @@
 REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
 #else
 #ifdef SVQC
-.float HLAC_bulletcounter;
-void W_HLAC_Touch (void)
-{
-       PROJECTILE_TOUCH;
 
-       self.event_damage = SUB_Null;
-
-    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
-
-       remove (self);
-}
-
-void W_HLAC_Touch2 (void)
+void W_HLAC_Touch (void)
 {
        PROJECTILE_TOUCH;
 
        self.event_damage = SUB_Null;
-
-    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+       
+       if(self.projectiledeathtype & HITTYPE_SECONDARY)
+               RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+       else
+               RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -35,7 +27,7 @@ void W_HLAC_Attack (void)
         self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_primary_ammo;
     }
 
-    spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.HLAC_bulletcounter);
+    spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
     spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
     if(self.crouch)
         spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
@@ -51,7 +43,6 @@ void W_HLAC_Attack (void)
        missile = spawn ();
        missile.owner = self;
        missile.classname = "hlacbolt";
-       // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
     missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
@@ -63,7 +54,7 @@ void W_HLAC_Attack (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
-       missile.angles = vectoangles (missile.velocity);
+       //missile.angles = vectoangles (missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
        missile.think = SUB_Remove;
@@ -95,7 +86,6 @@ void W_HLAC_Attack2f (void)
        missile = spawn ();
        missile.owner = self;
        missile.classname = "hlacbolt";
-       // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
     missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
@@ -107,9 +97,9 @@ void W_HLAC_Attack2f (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
-       missile.angles = vectoangles (missile.velocity);
+       //missile.angles = vectoangles (missile.velocity); // csqc
 
-       missile.touch = W_HLAC_Touch2;
+       missile.touch = W_HLAC_Touch;
        missile.think = SUB_Remove;
 
     missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
@@ -161,7 +151,7 @@ void HLAC_fire1_02()
 
                ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
                W_HLAC_Attack();
-               self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
+               self.misc_bulletcounter = self.misc_bulletcounter + 1;
         weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
        }
        else
@@ -184,7 +174,7 @@ float w_hlac(float req)
                if (self.BUTTON_ATCK)
                if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
                {
-                       self.HLAC_bulletcounter = 0;
+                       self.misc_bulletcounter = 0;
                        W_HLAC_Attack();
                        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
                }
index 2d50143deed1ddad0ca5623cca74363ed66ab9aa..50f59ff01e74cbce9010c7ca8b00446bf13612a8 100644 (file)
@@ -2,7 +2,6 @@
 REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
 #else
 #ifdef SVQC
-.entity muzzle_flash;
 
 // leilei's fancy muzzleflash stuff
 void Uzi_Flash_Go() 
@@ -40,17 +39,16 @@ void UziFlash()
        self.muzzle_flash.owner = self;
 }
 
-.float uzi_bulletcounter;
 void W_Uzi_Attack (float deathtype)
 {
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
-               if (self.uzi_bulletcounter == 1)
+               if (self.misc_bulletcounter == 1)
                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
                else
                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
        }
-       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
        if (!g_norecoil)
        {
                self.punchangle_x = random () - 0.5;
@@ -60,7 +58,7 @@ void W_Uzi_Attack (float deathtype)
        // this attack_finished just enforces a cooldown at the end of a burst
        ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
 
-       if (self.uzi_bulletcounter == 1)
+       if (self.misc_bulletcounter == 1)
                fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        else
                fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
@@ -92,7 +90,7 @@ void uzi_fire1_02()
                        w_ready();
                        return;
                }
-               self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+               self.misc_bulletcounter = self.misc_bulletcounter + 1;
                W_Uzi_Attack(WEP_UZI);
                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
        }
@@ -128,11 +126,11 @@ void uzi_mode1_fire_auto()
                self.punchangle_y = random () - 0.5;
        }
        
-       uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+       uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
        fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
        
-       self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+       self.misc_bulletcounter = self.misc_bulletcounter + 1;
        
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -168,13 +166,12 @@ void uzi_mode1_fire_burst()
        if (autocvar_g_casings >= 2) // casing code
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
 
-       self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
-       if (self.uzi_bulletcounter == 0)
+       self.misc_bulletcounter = self.misc_bulletcounter + 1;
+       if (self.misc_bulletcounter == 0)
                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
        else
        {
                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
-               dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
        }
                
 }
@@ -197,7 +194,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK)
                        if (weapon_prepareattack(0, 0))
                        {                               
-                               self.uzi_bulletcounter = 0;
+                               self.misc_bulletcounter = 0;
                                uzi_mode1_fire_auto();
                        }
                        
@@ -214,7 +211,7 @@ float w_uzi(float req)
                                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)   
                                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
 
-                               self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
+                               self.misc_bulletcounter = autocvar_g_balance_uzi_burst * -1;
                                uzi_mode1_fire_burst();
                        }
                }
@@ -224,7 +221,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK)
                        if (weapon_prepareattack(0, 0))
                        {
-                               self.uzi_bulletcounter = 1;
+                               self.misc_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI); // sets attack_finished
                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
                        }
@@ -232,7 +229,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
                        if (weapon_prepareattack(1, 0))
                        {
-                               self.uzi_bulletcounter = 1;
+                               self.misc_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
                        }