]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
shotgun melee should be easier to hit now, (tracing for hit until end of swing in...
authorFruitieX <rasse@rasse-lappy.localdomain>
Tue, 20 Jul 2010 23:55:33 +0000 (02:55 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Tue, 20 Jul 2010 23:55:33 +0000 (02:55 +0300)
balance.cfg
balance25.cfg
balanceFruit.cfg
balanceSamual.cfg
balanceXPM.cfg
qcsrc/server/w_shotgun.qc

index c96b82870f2c230c3bccffc44aadaa1e3f053df2..1db210ec1b14f5e218c467388cb23062c32057a3 100644 (file)
@@ -245,7 +245,8 @@ set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee 0 // ew, bad! Still uses the melee anim!
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
 set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_size 50
+set g_balance_shotgun_secondary_melee_swing 50
+set g_balance_shotgun_secondary_melee_time 0.4
 set g_balance_shotgun_secondary_bullets 6
 set g_balance_shotgun_secondary_damage 9
 set g_balance_shotgun_secondary_force 60
index 12c356dfc60ec0f89fff334e285e5f1af7efc515..bc415cac7af9e4b0ec6c3d7ff9fa3dfbc44cb227 100644 (file)
@@ -245,7 +245,8 @@ set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee 0 // ew, bad! Still uses the melee anim!
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
 set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_size 50
+set g_balance_shotgun_secondary_melee_swing 50
+set g_balance_shotgun_secondary_melee_time 0.4
 set g_balance_shotgun_secondary_bullets 6
 set g_balance_shotgun_secondary_damage 9
 set g_balance_shotgun_secondary_force 60
index 5d1aae9f1857deadba92f9116ca189347a4cfaa6..6b9a708410e0da61f1a0b50d69461294807d8612 100644 (file)
@@ -245,7 +245,8 @@ set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee 1
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
 set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_size 50
+set g_balance_shotgun_secondary_melee_swing 50
+set g_balance_shotgun_secondary_melee_time 0.4
 set g_balance_shotgun_secondary_bullets 6 // one more per shot than 15/3 (primary bullets/amount of shots = 3)
 set g_balance_shotgun_secondary_damage 115
 set g_balance_shotgun_secondary_force 150
index 40a82f37a1747ba05a55afb19c4237c807af6e7d..d9ae5ecb6c512ce029a17adbb5f476e8ffc15cf8 100644 (file)
@@ -245,7 +245,8 @@ set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee 0 // ew, bad! Still uses the melee anim!
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
 set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_size 50
+set g_balance_shotgun_secondary_melee_swing 50
+set g_balance_shotgun_secondary_melee_time 0.4
 set g_balance_shotgun_secondary_bullets 6
 set g_balance_shotgun_secondary_damage 8
 set g_balance_shotgun_secondary_force 15
index ba0a23c014f614d72f1a3840fb2adf3988516299..9033e42630db57ecaac3b230a291c3a81d2dd223 100644 (file)
@@ -245,7 +245,8 @@ set g_balance_shotgun_secondary 0
 set g_balance_shotgun_secondary_melee 0 // ew, bad! Still uses the melee anim!
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
 set g_balance_shotgun_secondary_melee_range 60
-set g_balance_shotgun_secondary_melee_size 50
+set g_balance_shotgun_secondary_melee_swing 50
+set g_balance_shotgun_secondary_melee_time 0.4
 set g_balance_shotgun_secondary_bullets 6 // one more per shot than 15/3 (primary bullets/amount of shots = 3)
 set g_balance_shotgun_secondary_damage 7
 set g_balance_shotgun_secondary_force 20
index e126787713a1a2fde315f651ff45b670f752e8d9..319f743e3558aff0cb31c8930ec2ced6b382f27e 100644 (file)
@@ -91,22 +91,34 @@ void W_Shotgun_Attack2 (void)
 
 void shotgun_meleethink (void)
 {
+       // store time when we started swinging down inside self.cnt
+       if(!self.cnt)
+               self.cnt = time;
+
        makevectors(self.owner.v_angle);
        vector angle;
        angle = v_forward;
 
-       // broken? fix, needs to be easier to hit
+       // broken? fix, needs to be easier to hit EDIT: maybe not :)
        //WarpZone_tracebox_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range") - (v_right + v_up) * cvar("g_balance_shotgun_secondary_melee_size"), self.owner.origin + self.owner.view_ofs + (v_right + v_up) * cvar("g_balance_shotgun_secondary_melee_size"), self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner));
-       WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner));
+       float f;
+       f = (self.cnt + cvar("g_balance_shotgun_secondary_melee_time") - time) / cvar("g_balance_shotgun_secondary_melee_time") * 2 - 1;
+       vector targpos;
+       targpos = self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range") + v_right * f * cvar("g_balance_shotgun_secondary_melee_swing") + v_up * f * cvar("g_balance_shotgun_secondary_melee_swing");
+       WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, targpos, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
 
-       // apply the damage
+       // apply the damage, also remove self
        if(trace_fraction < 1)
        {
                vector force;
                force = angle * cvar("g_balance_shotgun_secondary_force");
-               Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage"), WEP_SHOTGUN, self.owner.origin + self.owner.view_ofs, force);
+               Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage") * ((f + 1) / 2), WEP_SHOTGUN, self.owner.origin + self.owner.view_ofs, force);
+               remove(self);
        }
-       remove(self);
+       else if(time >= self.cnt + cvar("g_balance_shotgun_secondary_melee_time")) // missed, remove ent
+               remove(self);
+       else // continue swinging the weapon in hope of hitting someone :)
+               self.nextthink = time;
 }
 
 void W_Shotgun_Attack3 (void)