]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add g_balance_crylink_swap_attacks cvar morosophos/2184-crylink-buttons-swap 627/head
authormorosophos <morosophos@teichisma.info>
Mon, 7 Jan 2019 13:27:33 +0000 (15:27 +0200)
committermorosophos <morosophos@teichisma.info>
Mon, 7 Jan 2019 13:27:33 +0000 (15:27 +0200)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/crylink.qh

index 45a75349be2cfba6658cd4199f6a25aba847350c..9ceb54ee90169d2d0758cc572da28252ff436968 100644 (file)
@@ -281,6 +281,7 @@ set g_balance_crylink_secondary_shots 5
 set g_balance_crylink_secondary_speed 7000
 set g_balance_crylink_secondary_spread 0.08
 set g_balance_crylink_secondary_spreadtype 0
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0.2
 set g_balance_crylink_switchdelay_raise 0.2
 set g_balance_crylink_weaponreplace ""
index b1a83000f6f41d18345045cfd9d7b44c9c41442f..93b5b17a77443ab1e066d62e350f989661414b49 100644 (file)
@@ -281,6 +281,7 @@ set g_balance_crylink_secondary_shots 7
 set g_balance_crylink_secondary_speed 7000
 set g_balance_crylink_secondary_spread 0.08
 set g_balance_crylink_secondary_spreadtype 0
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0.15
 set g_balance_crylink_switchdelay_raise 0.15
 set g_balance_crylink_weaponreplace ""
index 1816f3f2e921ce4de93ceabcc2bad978861fcdd4..a2d5f23a4808fd0664cb893e8b658e7207c9212e 100644 (file)
@@ -347,6 +347,7 @@ set g_balance_crylink_secondary_shots 5
 set g_balance_crylink_secondary_speed 3000
 set g_balance_crylink_secondary_spread 0.01
 set g_balance_crylink_secondary_spreadtype 1
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0.2
 set g_balance_crylink_switchdelay_raise 0.2
 set g_balance_crylink_weaponreplace ""
index 13bdc529a9f7364e36ce66ec85b596732e2b0f7b..76714558abbfa34648bc6419db7dead9587aa69c 100644 (file)
@@ -281,6 +281,7 @@ set g_balance_crylink_secondary_shots 1
 set g_balance_crylink_secondary_speed 2000
 set g_balance_crylink_secondary_spread 0
 set g_balance_crylink_secondary_spreadtype 1
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0
 set g_balance_crylink_switchdelay_raise 0
 set g_balance_crylink_weaponreplace ""
index 5c6ace7abd7c6649f82b9998570e562154431a8e..4a9ad61d7b397278e364e4cdaa3ae8c29a7fb45f 100644 (file)
@@ -281,6 +281,7 @@ set g_balance_crylink_secondary_shots 5
 set g_balance_crylink_secondary_speed 3000
 set g_balance_crylink_secondary_spread 0.01
 set g_balance_crylink_secondary_spreadtype 1
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0.2
 set g_balance_crylink_switchdelay_raise 0.2
 set g_balance_crylink_weaponreplace ""
index a5438d1b7c65a39ebe33f27da62dfb47e3c5e359..145889be3e38f2d1ffecb9dbab3b980f91f1520e 100644 (file)
@@ -281,6 +281,7 @@ set g_balance_crylink_secondary_shots 5
 set g_balance_crylink_secondary_speed 3000
 set g_balance_crylink_secondary_spread 0.01
 set g_balance_crylink_secondary_spreadtype 1
+set g_balance_crylink_swap_attacks 0
 set g_balance_crylink_switchdelay_drop 0.2
 set g_balance_crylink_switchdelay_raise 0.2
 set g_balance_crylink_weaponreplace ""
index 064668ca6cafa443c2260cf00c11d8e9ce51c643..2c919c52f5396c1f323a215ad557dcc6c48b7baa 100644 (file)
@@ -526,7 +526,11 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit
         thiswep.wr_reload(thiswep, actor, weaponentity);
     }
 
-    if(fire & 1)
+    // attack swapping is useful for emulating BFG behavior in XDF
+    int primary_fire = autocvar_g_balance_crylink_swap_attacks ? fire & 2 : fire & 1;
+    int secondary_fire = autocvar_g_balance_crylink_swap_attacks ? fire & 1 : fire & 2;
+
+    if(primary_fire)
     {
         if(actor.(weaponentity).crylink_waitrelease != 1)
         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(crylink, refire)))
@@ -536,7 +540,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit
         }
     }
 
-    if((fire & 2) && autocvar_g_balance_crylink_secondary)
+    if((secondary_fire) && autocvar_g_balance_crylink_secondary)
     {
         if(actor.(weaponentity).crylink_waitrelease != 2)
         if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(crylink, refire)))
@@ -546,7 +550,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit
         }
     }
 
-    if((actor.(weaponentity).crylink_waitrelease == 1 && !(fire & 1)) || (actor.(weaponentity).crylink_waitrelease == 2 && !(fire & 2)))
+    if((actor.(weaponentity).crylink_waitrelease == 1 && !(primary_fire)) || (actor.(weaponentity).crylink_waitrelease == 2 && !(secondary_fire)))
     {
         if(!actor.(weaponentity).crylink_lastgroup || time > actor.(weaponentity).crylink_lastgroup.teleport_time)
         {
index 77e0b734e2e7e2c1009ee42fb400691a9bca8ed1..ed9c4c8fa295eb2c9687e3268e60958f5404603b 100644 (file)
@@ -47,6 +47,7 @@ CLASS(Crylink, Weapon)
         P(class, prefix, speed, float, BOTH) \
         P(class, prefix, spreadtype, float, SEC) \
         P(class, prefix, spread, float, BOTH) \
+        P(class, prefix, swap_attacks, float, NONE) \
         P(class, prefix, switchdelay_drop, float, NONE) \
         P(class, prefix, switchdelay_raise, float, NONE) \
         P(class, prefix, weaponreplace, string, NONE) \