From 10962c1de6524f9c0be91ec26612e1536c932dcb Mon Sep 17 00:00:00 2001 From: Lyberta Date: Fri, 16 Feb 2018 11:58:43 +0300 Subject: [PATCH] OK weapons: Ported oknex to new wepent fields. --- qcsrc/client/view.qc | 12 ++++++------ qcsrc/common/mutators/mutator/overkill/oknex.qc | 11 ----------- qcsrc/common/wepent.qc | 4 ++++ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 0bde0788d..e0e3a569b 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1228,14 +1228,14 @@ void HUD_Crosshair(entity this) ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring_nexgun.tga"; } - else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge && autocvar_crosshair_ring_vortex) + else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge_ && autocvar_crosshair_ring_vortex) { - if (oknex_chargepool || use_vortex_chargepool) { + if (oknex_chargepool_ || use_vortex_chargepool) { use_vortex_chargepool = 1; - ring_inner_value = oknex_chargepool; + ring_inner_value = oknex_chargepool_; } else { - vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge; - ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge - vortex_charge_movingavg), 1); + vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge_; + ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge_ - vortex_charge_movingavg), 1); } ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha; @@ -1243,7 +1243,7 @@ void HUD_Crosshair(entity this) ring_inner_image = "gfx/crosshair_ring_inner.tga"; // draw the outer ring to show the current charge of the weapon - ring_value = oknex_charge; + ring_value = oknex_charge_; ring_alpha = autocvar_crosshair_ring_vortex_alpha; ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring_nexgun.tga"; diff --git a/qcsrc/common/mutators/mutator/overkill/oknex.qc b/qcsrc/common/mutators/mutator/overkill/oknex.qc index 31f1052fb..c4326a7b6 100644 --- a/qcsrc/common/mutators/mutator/overkill/oknex.qc +++ b/qcsrc/common/mutators/mutator/overkill/oknex.qc @@ -128,11 +128,6 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone actor.(weaponentity).oknex_charge = min(1, actor.(weaponentity).oknex_charge + WEP_CVAR(oknex, charge_rate) * frametime / W_TICSPERFRAME); } - if (weaponslot(weaponentity) == 0) - { - actor.oknex_charge = actor.(weaponentity).oknex_charge; - } - if (WEP_CVAR_SEC(oknex, chargepool)) if (actor.(weaponentity).oknex_chargepool_ammo < 1) { @@ -141,9 +136,6 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone actor.pauseregen_finished = max(actor.pauseregen_finished, time + WEP_CVAR_SEC(oknex, chargepool_pause_regen)); } - if(weaponslot(weaponentity) == 0) - actor.oknex_chargepool_ammo = actor.(weaponentity).oknex_chargepool_ammo; - if ((WEP_CVAR_SEC(oknex, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval)) { // Secondary uses it's own refire timer if refire_type is 1. @@ -343,9 +335,6 @@ METHOD(OverkillNex, wr_resetplayer, void(entity thiswep, entity actor)) { .entity weaponentity = weaponentities[slot]; actor.(weaponentity).oknex_charge = WEP_CVAR(oknex, charge_start); - - if (WEP_CVAR_SEC(oknex, chargepool)) - actor.(weaponentity).oknex_chargepool_ammo = 1; } } actor.oknex_lasthit = 0; diff --git a/qcsrc/common/wepent.qc b/qcsrc/common/wepent.qc index bd87abdfc..07511e0be 100644 --- a/qcsrc/common/wepent.qc +++ b/qcsrc/common/wepent.qc @@ -61,6 +61,10 @@ MACRO_END PROP(false, vortex_chargepool_ammo, WEPENT_SET_NORMAL, \ { WriteByte(chan, this.vortex_chargepool_ammo * 16); }, \ { (viewmodels[this.m_wepent_slot]).vortex_chargepool_ammo = ReadByte() / 16; }) \ + \ + PROP(false, oknex_chargepool_ammo, WEPENT_SET_NORMAL, \ + { WriteByte(chan, this.oknex_chargepool_ammo * 16); }, \ + { (viewmodels[this.m_wepent_slot]).oknex_chargepool_ammo = ReadByte() / 16; }) \ \ PROP(false, clip_load, WEPENT_SET_NORMAL, \ { WriteShort(chan, this.clip_load); }, \ -- 2.39.2