vortex_charge = STAT(VORTEX_CHARGE);
vortex_chargepool = STAT(VORTEX_CHARGEPOOL);
+ float okvortex_charge, okvortex_chargepool;
+ okvortex_charge = STAT(OVERKILL_VORTEX_CHARGE);
+ okvortex_chargepool = STAT(OVERKILL_VORTEX_CHARGEPOOL);
+
float arc_heat = STAT(ARC_HEAT);
if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
entity wepent = viewmodels[0]; // TODO: unhardcode
// handle the values
- if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_VORTEX || wepent.activeweapon == WEP_OVERKILL_VORTEX) && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
+ if (autocvar_crosshair_ring && wepent.activeweapon == WEP_VORTEX && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
{
if (vortex_chargepool || use_vortex_chargepool) {
use_vortex_chargepool = 1;
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring_nexgun.tga";
}
+ else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_VORTEX) && okvortex_charge && autocvar_crosshair_ring_vortex)
+ {
+ if (okvortex_chargepool || use_vortex_chargepool) {
+ use_vortex_chargepool = 1;
+ ring_inner_value = okvortex_chargepool;
+ } else {
+ vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * okvortex_charge;
+ ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (okvortex_charge - vortex_charge_movingavg), 1);
+ }
+
+ ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
+ ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
+ ring_inner_image = "gfx/crosshair_ring_inner.tga";
+
+ // draw the outer ring to show the current charge of the weapon
+ ring_value = okvortex_charge;
+ ring_alpha = autocvar_crosshair_ring_vortex_alpha;
+ ring_rgb = wcross_color;
+ ring_image = "gfx/crosshair_ring_nexgun.tga";
+ }
else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
{
ring_value = bound(0, STAT(LAYED_MINES) / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
METHOD(OverkillVortex, wr_glow, vector(OverkillVortex this, entity actor, entity wepent))
{
if (!WEP_CVAR(okvortex, charge)) return '0 0 0';
- float charge = wepent.vortex_charge;
+ float charge = wepent.okvortex_charge;
float animlimit = WEP_CVAR(okvortex, charge_animlimit);
vector g;
g.x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, charge / animlimit);
xyspeed = min(xyspeed, WEP_CVAR(okvortex, charge_maxspeed));
float f = (xyspeed - WEP_CVAR(okvortex, charge_minspeed)) / (WEP_CVAR(okvortex, charge_maxspeed) - WEP_CVAR(okvortex, charge_minspeed));
// add the extra charge
- player.(weaponentity).vortex_charge = min(1, player.(weaponentity).vortex_charge + WEP_CVAR(okvortex, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
+ player.(weaponentity).okvortex_charge = min(1, player.(weaponentity).okvortex_charge + WEP_CVAR(okvortex, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
}
}
}
if(WEP_CVAR(okvortex, charge))
{
- charge = WEP_CVAR(okvortex, charge_mindmg) / mydmg + (1 - WEP_CVAR(okvortex, charge_mindmg) / mydmg) * actor.(weaponentity).vortex_charge;
- actor.(weaponentity).vortex_charge *= WEP_CVAR(okvortex, charge_shot_multiplier); // do this AFTER setting mydmg/myforce
+ charge = WEP_CVAR(okvortex, charge_mindmg) / mydmg + (1 - WEP_CVAR(okvortex, charge_mindmg) / mydmg) * actor.(weaponentity).okvortex_charge;
+ actor.(weaponentity).okvortex_charge *= WEP_CVAR(okvortex, charge_shot_multiplier); // do this AFTER setting mydmg/myforce
// O RLY? -- divVerent
// YA RLY -- FruitieX
}
METHOD(OverkillVortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
- if(WEP_CVAR(okvortex, charge) && actor.(weaponentity).vortex_charge < WEP_CVAR(okvortex, charge_limit))
- actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(okvortex, charge_rate) * frametime / W_TICSPERFRAME);
+ if(WEP_CVAR(okvortex, charge) && actor.(weaponentity).okvortex_charge < WEP_CVAR(okvortex, charge_limit))
+ actor.(weaponentity).okvortex_charge = min(1, actor.(weaponentity).okvortex_charge + WEP_CVAR(okvortex, charge_rate) * frametime / W_TICSPERFRAME);
if(weaponslot(weaponentity) == 0)
- actor.vortex_charge = actor.(weaponentity).vortex_charge;
+ actor.okvortex_charge = actor.(weaponentity).okvortex_charge;
if(WEP_CVAR_SEC(okvortex, chargepool))
- if(actor.(weaponentity).vortex_chargepool_ammo < 1)
+ if(actor.(weaponentity).okvortex_chargepool_ammo < 1)
{
if(actor.okvortex_chargepool_pauseregen_finished < time)
- actor.(weaponentity).vortex_chargepool_ammo = min(1, actor.(weaponentity).vortex_chargepool_ammo + WEP_CVAR_SEC(okvortex, chargepool_regen) * frametime / W_TICSPERFRAME);
+ actor.(weaponentity).okvortex_chargepool_ammo = min(1, actor.(weaponentity).okvortex_chargepool_ammo + WEP_CVAR_SEC(okvortex, chargepool_regen) * frametime / W_TICSPERFRAME);
actor.pauseregen_finished = max(actor.pauseregen_finished, time + WEP_CVAR_SEC(okvortex, chargepool_pause_regen));
}
if(weaponslot(weaponentity) == 0)
- actor.vortex_chargepool_ammo = actor.(weaponentity).vortex_chargepool_ammo;
+ actor.okvortex_chargepool_ammo = actor.(weaponentity).okvortex_chargepool_ammo;
if(autocvar_g_balance_vortex_reload_ammo && actor.(weaponentity).clip_load < min(WEP_CVAR_PRI(okvortex, ammo), WEP_CVAR_SEC(okvortex, ammo))) { // forced reload
thiswep.wr_reload(thiswep, actor, weaponentity);
{
if(WEP_CVAR(okvortex, charge))
{
- actor.(weaponentity).vortex_charge_rottime = time + WEP_CVAR(okvortex, charge_rot_pause);
+ actor.(weaponentity).okvortex_charge_rottime = time + WEP_CVAR(okvortex, charge_rot_pause);
float dt = frametime / W_TICSPERFRAME;
- if(actor.(weaponentity).vortex_charge < 1)
+ if(actor.(weaponentity).okvortex_charge < 1)
{
if(WEP_CVAR_SEC(okvortex, chargepool))
{
if(WEP_CVAR_SEC(okvortex, ammo))
{
// always deplete if secondary is held
- actor.vortex_chargepool_ammo = max(0, actor.vortex_chargepool_ammo - WEP_CVAR_SEC(okvortex, ammo) * dt);
+ actor.okvortex_chargepool_ammo = max(0, actor.okvortex_chargepool_ammo - WEP_CVAR_SEC(okvortex, ammo) * dt);
- dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(okvortex, charge_rate));
+ dt = min(dt, (1 - actor.(weaponentity).okvortex_charge) / WEP_CVAR(okvortex, charge_rate));
actor.okvortex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(okvortex, chargepool_pause_regen);
- dt = min(dt, actor.vortex_chargepool_ammo);
+ dt = min(dt, actor.okvortex_chargepool_ammo);
dt = max(0, dt);
- actor.(weaponentity).vortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
+ actor.(weaponentity).okvortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
}
}
{
if(fire & 2) // only eat ammo when the button is pressed
{
- dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(okvortex, charge_rate));
+ dt = min(dt, (1 - actor.(weaponentity).okvortex_charge) / WEP_CVAR(okvortex, charge_rate));
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
}
}
}
- actor.(weaponentity).vortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
+ actor.(weaponentity).okvortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
}
}
else
{
- dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(okvortex, charge_rate));
- actor.(weaponentity).vortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
+ dt = min(dt, (1 - actor.(weaponentity).okvortex_charge) / WEP_CVAR(okvortex, charge_rate));
+ actor.(weaponentity).okvortex_charge += dt * WEP_CVAR(okvortex, charge_rate);
}
}
}
{
if (WEP_CVAR(okvortex, charge)) {
if (WEP_CVAR_SEC(okvortex, chargepool)) {
- actor.vortex_chargepool_ammo = 1;
+ actor.okvortex_chargepool_ammo = 1;
}
- actor.vortex_charge = WEP_CVAR(okvortex, charge_start);
+ actor.okvortex_charge = WEP_CVAR(okvortex, charge_start);
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
- actor.(weaponentity).vortex_charge = WEP_CVAR(okvortex, charge_start);
+ actor.(weaponentity).okvortex_charge = WEP_CVAR(okvortex, charge_start);
if (WEP_CVAR_SEC(okvortex, chargepool))
- actor.(weaponentity).vortex_chargepool_ammo = 1;
+ actor.(weaponentity).okvortex_chargepool_ammo = 1;
}
}
actor.okvortex_lasthit = 0;
#include "../lib/warpzone/server.qh"
+#include <common/mutators/mutator/overkill/okvortex.qh>
+
STATIC_METHOD(Client, Add, void(Client this, int _team))
{
ClientConnect(this);
this.weapons = spectatee.weapons;
this.vortex_charge = spectatee.vortex_charge;
this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
+ this.okvortex_charge = spectatee.okvortex_charge;
+ this.okvortex_chargepool_ammo = spectatee.okvortex_chargepool_ammo;
this.hagar_load = spectatee.hagar_load;
this.arc_heat_percent = spectatee.arc_heat_percent;
this.minelayer_mines = spectatee.minelayer_mines;
{
.entity weaponentity = weaponentities[slot];
if (WEP_CVAR(vortex, charge_rot_rate) && this.(weaponentity).vortex_charge > WEP_CVAR(vortex, charge_limit) && this.(weaponentity).vortex_charge_rottime < time)
+ {
this.(weaponentity).vortex_charge = bound(WEP_CVAR(vortex, charge_limit), this.(weaponentity).vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
+ }
+ if (WEP_CVAR(okvortex, charge_rot_rate) && this.(weaponentity).okvortex_charge > WEP_CVAR(okvortex, charge_limit) && this.(weaponentity).okvortex_charge_rottime < time)
+ {
+ this.(weaponentity).okvortex_charge = bound(WEP_CVAR(okvortex, charge_limit), this.(weaponentity).okvortex_charge - WEP_CVAR(okvortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
+ }
}
if (frametime) player_anim(this);