From: morosophos Date: Mon, 7 Jan 2019 13:27:33 +0000 (+0200) Subject: Add g_balance_crylink_swap_attacks cvar X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F627%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Add g_balance_crylink_swap_attacks cvar --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 45a75349b..9ceb54ee9 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -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 "" diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index b1a83000f..93b5b17a7 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -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 "" diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 1816f3f2e..a2d5f23a4 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -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 "" diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 13bdc529a..76714558a 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -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 "" diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 5c6ace7ab..4a9ad61d7 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -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 "" diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg index a5438d1b7..145889be3 100644 --- a/bal-wep-xpm.cfg +++ b/bal-wep-xpm.cfg @@ -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 "" diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 064668ca6..2c919c52f 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -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) { diff --git a/qcsrc/common/weapons/weapon/crylink.qh b/qcsrc/common/weapons/weapon/crylink.qh index 77e0b734e..ed9c4c8fa 100644 --- a/qcsrc/common/weapons/weapon/crylink.qh +++ b/qcsrc/common/weapons/weapon/crylink.qh @@ -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) \