]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option (off by default) to allow the vortex to charge even while not in hand
authorMario <mario@smbclan.net>
Sun, 18 Aug 2019 10:40:27 +0000 (20:40 +1000)
committerMario <mario@smbclan.net>
Sun, 18 Aug 2019 10:40:27 +0000 (20:40 +1000)
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/vortex.qc
qcsrc/common/weapons/weapon/vortex.qh
qcsrc/server/client.qc

index 69ea36568146943aa7c5518bc860aa0b496216dc..8ae104ae86f76cff2296623343a755a988e2f852 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index ccf1a7de960d28f6a6e1e6efe0e676b0a050af00..95b62730c953f5b6bffbf479674def840eefa576 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index 4549f99c70365d8a02f30f95eceebac59b564b1d..109c3d8f84fe5a5dddfa20e0717cb61bcee3f8c8 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index 62d1cbb44a9620e15770f17c9d73bad6616f5c28..aaf3124617ba8eff319c3fe54671a692f9105325 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 0
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index bf33f599a8a555fae6545240573675fae2c5a9d9..7d552e56b98a35a77370d09f0e54ab335bedb1d8 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index 5152579ab327ed8db95d1609c3c778bcb90742e5..14a8159c03e090cc66c1855b59d566c5ca44aaad 100644 (file)
@@ -290,6 +290,7 @@ set g_balance_crylink_weaponthrowable 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
 // }}}
 // {{{ #8: Vortex
 set g_balance_vortex_charge 1
+set g_balance_vortex_charge_always 0
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
 set g_balance_vortex_charge_animlimit 0.5
 set g_balance_vortex_charge_limit 1
 set g_balance_vortex_charge_maxspeed 800
index fec4d756e97b5e3a5b1c672dc54a5521f8bd1d65..af7fac624195caa439ff0b54266f12ac80186353 100644 (file)
@@ -159,6 +159,12 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
 
 .float vortex_chargepool_pauseregen_finished;
 
 
 .float vortex_chargepool_pauseregen_finished;
 
+void W_Vortex_Charge(entity actor, .entity weaponentity, float dt)
+{
+    if(WEP_CVAR(vortex, charge) && actor.(weaponentity).vortex_charge < WEP_CVAR(vortex, charge_limit))
+        actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(vortex, charge_rate) * dt / W_TICSPERFRAME);
+}
+
 METHOD(Vortex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 {
     if(bot_aim(actor, weaponentity, 1000000, 0, 1, false))
 METHOD(Vortex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 {
     if(bot_aim(actor, weaponentity, 1000000, 0, 1, false))
@@ -171,8 +177,8 @@ METHOD(Vortex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 }
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
-    if(WEP_CVAR(vortex, charge) && actor.(weaponentity).vortex_charge < WEP_CVAR(vortex, charge_limit))
-        actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME);
+    if(!WEP_CVAR(vortex, charge_always))
+        W_Vortex_Charge(actor, weaponentity, frametime);
 
     if(WEP_CVAR_SEC(vortex, chargepool))
         if(actor.(weaponentity).vortex_chargepool_ammo < 1)
 
     if(WEP_CVAR_SEC(vortex, chargepool))
         if(actor.(weaponentity).vortex_chargepool_ammo < 1)
index 570464cb913e7ddbc758509323b61fb0dc97baec..783e42a8ea567d146eb1e1dae62f91d9d666d7f3 100644 (file)
@@ -27,6 +27,7 @@ CLASS(Vortex, Weapon)
                P(class, prefix, chargepool_pause_regen, float, SEC) \
                P(class, prefix, chargepool_regen, float, SEC) \
                P(class, prefix, charge, float, NONE) \
                P(class, prefix, chargepool_pause_regen, float, SEC) \
                P(class, prefix, chargepool_regen, float, SEC) \
                P(class, prefix, charge, float, NONE) \
+               P(class, prefix, charge_always, float, NONE) \
                P(class, prefix, charge_animlimit, float, NONE) \
                P(class, prefix, charge_limit, float, NONE) \
                P(class, prefix, charge_maxspeed, float, NONE) \
                P(class, prefix, charge_animlimit, float, NONE) \
                P(class, prefix, charge_limit, float, NONE) \
                P(class, prefix, charge_maxspeed, float, NONE) \
@@ -66,4 +67,6 @@ SPAWNFUNC_WEAPON(weapon_nex, WEP_VORTEX)
 
 #ifdef SVQC
 .float vortex_lasthit;
 
 #ifdef SVQC
 .float vortex_lasthit;
+
+void W_Vortex_Charge(entity actor, .entity weaponentity, float dt);
 #endif
 #endif
index 3a99e31ded5d44003bdeba1f36df6bf52083a39a..5029da7df9613f216a5ba89cedd44b70b647e801 100644 (file)
@@ -2194,6 +2194,8 @@ bool PlayerThink(entity this)
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
                        .entity weaponentity = weaponentities[slot];
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
                        .entity weaponentity = weaponentities[slot];
+                       if(WEP_CVAR(vortex, charge_always))
+                               W_Vortex_Charge(this, weaponentity, frametime);
                        W_WeaponFrame(this, weaponentity);
                }
 
                        W_WeaponFrame(this, weaponentity);
                }