#include "teamplay.qh"
#include "playerdemo.qh"
#include "spawnpoints.qh"
+#include "resources.qh"
#include "g_damage.qh"
#include "g_hook.qh"
#include "command/common.qh"
#include "../lib/warpzone/server.qh"
+#include <common/mutators/mutator/overkill/okvortex.qh>
+
STATIC_METHOD(Client, Add, void(Client this, int _team))
{
ClientConnect(this);
regen_health_stable = M_ARGV(9, float);
regen_health_rotstable = M_ARGV(10, float);
-
if(!mutator_returnvalue)
if(!STAT(FROZEN, this))
{
float mina, maxa, limith, limita;
maxa = autocvar_g_balance_armor_rotstable;
mina = autocvar_g_balance_armor_regenstable;
- limith = autocvar_g_balance_health_limit;
- limita = autocvar_g_balance_armor_limit;
+ limith = GetResourceLimit(this, RESOURCE_HEALTH);
+ limita = GetResourceLimit(this, RESOURCE_ARMOR);
regen_health_rotstable = regen_health_rotstable * max_mod;
regen_health_stable = regen_health_stable * max_mod;
maxf = autocvar_g_balance_fuel_rotstable;
minf = autocvar_g_balance_fuel_regenstable;
- limitf = autocvar_g_balance_fuel_limit;
+ limitf = GetResourceLimit(this, RESOURCE_FUEL);
this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
}
+ // Ugly hack to make sure the health and armor don't go beyond hard limit.
+ // TODO: Remove this hack when all code uses GivePlayerHealth and
+ // GivePlayerArmor.
+ if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
+ {
+ this.health = RESOURCE_AMOUNT_HARD_LIMIT;
+ }
+ if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
+ {
+ this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
+ }
+ // End hack.
}
bool zoomstate_set;
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;