Merge remote branch 'refs/remotes/origin/fruitiex/ca_nodmg_after_round'
authorRudolf Polzer <divverent@alientrap.org>
Sun, 24 Oct 2010 12:14:49 +0000 (14:14 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 24 Oct 2010 12:14:49 +0000 (14:14 +0200)
12 files changed:
balanceXonotic.cfg
defaultXonotic.cfg
gfx/crosshair_ring.tga
gfx/rifle_ring_1.tga [deleted file]
gfx/rifle_ring_2.tga [deleted file]
gfx/rifle_ring_3.tga [deleted file]
gfx/rifle_ring_4.tga [deleted file]
qcsrc/server/g_triggers.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/w_uzi.qc

index be8d75bcf3708f51efaec001139f793aba1da9fb..0dcdac942024c96ab403a0deb8f205d66c116be4 100644 (file)
@@ -579,12 +579,12 @@ set g_balance_campingrifle_primary_damage 75
 set g_balance_campingrifle_primary_headshotaddeddamage 75
 set g_balance_campingrifle_primary_spread 0
 set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
+set g_balance_campingrifle_primary_speed 40000
 set g_balance_campingrifle_primary_lifetime 5
 set g_balance_campingrifle_primary_refire 1.5
 set g_balance_campingrifle_primary_animtime 1.4
 set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
 set g_balance_campingrifle_primary_burstcost 0
 set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
 set g_balance_campingrifle_secondary 1
@@ -593,12 +593,12 @@ set g_balance_campingrifle_secondary_damage 50
 set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
 set g_balance_campingrifle_secondary_spread 0
 set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 15000
+set g_balance_campingrifle_secondary_speed 20000
 set g_balance_campingrifle_secondary_lifetime 5
 set g_balance_campingrifle_secondary_refire 1.5
 set g_balance_campingrifle_secondary_animtime 1.4
 set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 10.3qu
+set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
 set g_balance_campingrifle_secondary_burstcost 0
 set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
index edefdf3c3fc5818b4591f32d10194a4a7ab16792..0ba520e135aefda888f97c0f42965804ecceb915 100644 (file)
@@ -211,7 +211,7 @@ seta crosshair_fireball_color_green 1.0     "crosshair color green component to disp
 seta crosshair_fireball_color_blue 0.2 "crosshair color blue component to display when wielding the fireball"
 seta crosshair_fireball_color_alpha 1  "crosshair alpha value to display when wielding the fireball"
 seta crosshair_fireball_size 1 "crosshair size when wielding the fireball"
-seta crosshair_ring_size 3     "bullet counter ring size for Rifle, velocity ring for Nex"
+seta crosshair_ring_size 2     "bullet counter ring size for Rifle, velocity ring for Nex"
 seta crosshair_campingrifle_bulletcounter_alpha 0.15
 seta crosshair_nexvelocity_alpha 0.15
 seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
index 970ba1562c179bbf58dc4d6fd853505dea5aaae6..f574012e6bc33934178f8986efce51c25c9fe65e 100644 (file)
Binary files a/gfx/crosshair_ring.tga and b/gfx/crosshair_ring.tga differ
diff --git a/gfx/rifle_ring_1.tga b/gfx/rifle_ring_1.tga
deleted file mode 100644 (file)
index 914de35..0000000
Binary files a/gfx/rifle_ring_1.tga and /dev/null differ
diff --git a/gfx/rifle_ring_2.tga b/gfx/rifle_ring_2.tga
deleted file mode 100644 (file)
index db0a808..0000000
Binary files a/gfx/rifle_ring_2.tga and /dev/null differ
diff --git a/gfx/rifle_ring_3.tga b/gfx/rifle_ring_3.tga
deleted file mode 100644 (file)
index 20348c2..0000000
Binary files a/gfx/rifle_ring_3.tga and /dev/null differ
diff --git a/gfx/rifle_ring_4.tga b/gfx/rifle_ring_4.tga
deleted file mode 100644 (file)
index 07975e2..0000000
Binary files a/gfx/rifle_ring_4.tga and /dev/null differ
index 8ded34feae4e6fae28e931a5a18f85868c6dc8e0..4a66f229380ea9c505962ae4e5aa0abe9674d171 100644 (file)
@@ -416,6 +416,10 @@ void trigger_hurt_touch()
        if (self.active != ACTIVE_ACTIVE) 
                return;
 
+       if(self.team)
+               if((self.spawnflags & 4 == 0) == (self.team != other.team))
+                       return;
+
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
        if (other.iscreature)
        {
@@ -1012,6 +1016,8 @@ void misc_laser_think()
 {
        vector o;
        entity oldself;
+       entity hitent;
+       vector hitloc;
 
        self.nextthink = time;
 
@@ -1032,20 +1038,18 @@ void misc_laser_think()
                o = self.origin + v_forward * 32768;
        }
 
-       if(self.dmg)
+       if(self.dmg || self.enemy.target != "")
        {
-               if(self.dmg < 0)
-                       FireRailgunBullet(self.origin, o, 100000, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
-               else
-                       FireRailgunBullet(self.origin, o, self.dmg * frametime, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
+               traceline(self.origin, o, MOVE_NORMAL, self);
        }
+       hitent = trace_ent;
+       hitloc = trace_endpos;
 
        if(self.enemy.target != "") // DETECTOR laser
        {
-               traceline(self.origin, o, MOVE_NORMAL, self);
                if(trace_ent.iscreature)
                {
-                       self.pusher = trace_ent;
+                       self.pusher = hitent;
                        if(!self.count)
                        {
                                self.count = 1;
@@ -1071,6 +1075,15 @@ void misc_laser_think()
                        }
                }
        }
+
+       if(self.dmg)
+       {
+               if(self.team)
+                       if((self.spawnflags & 8 == 0) == (self.team != hitent.team))
+                               return;
+               if(hitent.takedamage)
+                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
+       }
 }
 
 float laser_SendEntity(entity to, float fl)
index 4777722da86223327ccf145b01219422817e6ab1..c9a37416b6cdd581edff7b5eb317f734368aaec5 100644 (file)
@@ -5,9 +5,6 @@ void turret_machinegun_attack();
 //.float bulletcounter;
 void turret_machinegun_attack()
 {
-
-    entity flash;
-
     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, cvar("g_balance_uzi_bulletconstant"));
     endFireBallisticBullet();
@@ -15,16 +12,8 @@ void turret_machinegun_attack()
     //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
     te_smallflash(self.tur_shotorg);
 
-    // muzzle flash for 3rd person view
-    flash = spawn();
-    setmodel(flash, "models/uziflash.md3"); // precision set below
-    setattachment(flash, self.tur_head, "tag_fire");
-    flash.think = W_Uzi_Flash_Go;
-    flash.nextthink = time + 0.02;
-    flash.frame = 2;
-    flash.angles_z = flash.v_angle_z + random() * 180;
-    flash.alpha = 1;
-    flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+    UziFlash();
+    setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 }
 
 
index e12bbb83025b944179770233667eccb6f1393824..59aaf653de3750a80540b616fdd41ca5df20e081 100644 (file)
@@ -615,26 +615,14 @@ void walker_postthink()
 
 void walker_attack()
 {
-    entity flash;
-
     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, cvar("g_balance_uzi_bulletconstant"));
     endFireBallisticBullet();
     if (self.uzi_bulletcounter == 2)
     {
 
-        flash = spawn();
-
-        setmodel(flash, "models/uziflash.md3");
-        setattachment(flash, self.tur_head, "tag_fire");
-
-        flash.scale     = 3;
-        flash.think     = W_Uzi_Flash_Go;
-        flash.nextthink = time + 0.02;
-        flash.frame     = 2;
-        flash.angles_z  = flash.v_angle_z + random() * 180;
-        flash.alpha     = 1;
-        flash.effects   = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+               UziFlash();
+               setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 
         self.uzi_bulletcounter = 0;
     }
index ba4360550ebe161c4736eba5ec5d22fa0a331142..056249ed53a6bc5f276da85ecbfc38532ab6ace6 100644 (file)
@@ -188,6 +188,7 @@ void spiderbot_rocket_do()
     self.gun2.cnt = time + self.attack_finished_single;
 }
 
+/*
 void spiderbot_minigun_fire_Flash_Go() {
        if (self.frame > 10)
        {
@@ -201,12 +202,12 @@ void spiderbot_minigun_fire_Flash_Go() {
        self.scale -= 0.01;
        self.nextthink = time + 0.02;
 }
+*/
 
-void spiderbot_minigun_fire(entity gun,float trail)
+void spiderbot_minigun_fire(entity gun, float trail)
 {
-
-    entity flash;
     vector v;
+    
     v = gettaginfo(gun,gettagindex(gun,"barrels"));
     v_forward = normalize(v_forward);
 
@@ -215,22 +216,9 @@ void spiderbot_minigun_fire(entity gun,float trail)
     fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
         cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
 
-    if not (gun.enemy)
-    {
-        gun.enemy = spawn();
-        setattachment(gun.enemy , gun, "barrels");
-        setorigin(gun.enemy ,gun.enemy.origin + '52 0 0');
-    }
 
-    flash = gun.enemy;
-    setmodel(flash, "models/uziflash.md3");
-    flash.think = spiderbot_minigun_fire_Flash_Go;
-    flash.nextthink = time + 0.02;
-    flash.frame = 2;
-    flash.angles_z = flash.v_angle_z + random() * 180;
-    flash.alpha = 1;
-    flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-    flash.scale = 1;
+       UziFlash();
+       setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 
     if(trail)
         trailparticles(self, particleeffectnum("EF_MGTURRETTRAIL"), v, trace_endpos);
index d9197412b98287e9805d0736220ee97bbfc4cfb4..788c9880fe7c4f57df428a9ccc17afbbdc2e7138 100644 (file)
@@ -2,26 +2,49 @@
 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 W_Uzi_Flash_Go() {
-       if (self.alpha >= 0)
-       {
-               setmodel(self, "");
-               return;
-       }
+void Uzi_Flash_Go() 
+{      
        self.frame = self.frame + 2;
        self.scale = self.scale * 0.5;
        self.alpha = self.alpha - 0.25;
-       self.think = W_Uzi_Flash_Go;
        self.nextthink = time + 0.05;
-};
+
+       if (self.alpha <= 0)
+       {
+               self.think = SUB_Remove;
+               self.nextthink = time;
+               self.owner.muzzle_flash = world;
+               return;
+       }
+       
+}
+
+void UziFlash()
+{      
+       if (self.muzzle_flash == world)
+               self.muzzle_flash = spawn();    
+       
+       // muzzle flash for 1st person view
+       setmodel(self.muzzle_flash, "models/uziflash.md3"); // precision set below
+       
+       self.muzzle_flash.scale = 0.75;
+       self.muzzle_flash.think = Uzi_Flash_Go;
+       self.muzzle_flash.nextthink = time + 0.02;
+       self.muzzle_flash.frame = 2;
+       self.muzzle_flash.alpha = 0.75;
+       self.muzzle_flash.angles_z = random() * 180;
+       self.muzzle_flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+       self.muzzle_flash.owner = self;
+       
+       
+}
 
 .float uzi_bulletcounter;
-.entity muzzleflash;
 void W_Uzi_Attack (float deathtype)
 {
-       local entity flash;
-
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if (self.uzi_bulletcounter == 1)
@@ -47,20 +70,8 @@ void W_Uzi_Attack (float deathtype)
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
-       if ((self.muzzleflash == world) || wasfreed(self.muzzleflash))
-               self.muzzleflash = spawn();
-       
-       // muzzle flash for 1st person view
-       setmodel(self.muzzleflash, "models/uziflash.md3"); // precision set below
-       //SUB_SetFade(flash, time + 0.06, 0);
-       self.muzzleflash.scale = 0.75;
-       self.muzzleflash.think = W_Uzi_Flash_Go;
-       self.muzzleflash.nextthink = time + 0.02;
-       self.muzzleflash.frame = 2;
-       self.muzzleflash.alpha = 0.75;
-       self.muzzleflash.angles_z = random() * 180;
-       self.muzzleflash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(self.muzzleflash, '5 0 0');
+       UziFlash();
+       W_AttachToShotorg(self.muzzle_flash, '5 0 0');
 
        // casing code
        if (cvar("g_casings") >= 2)