#include "sv_weapon.qh"
-void W_Nexball_Attack(entity actor, .entity weaponentity, float t);
-void W_Nexball_Attack2(entity actor, .entity weaponentity);
+void W_Nexball_Attack(Weapon thiswep, entity actor, .entity weaponentity, float t);
+void W_Nexball_Attack2(Weapon thiswep, entity actor, .entity weaponentity);
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity);
METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
if(autocvar_g_nexball_basketball_meter)
{
- if(actor.ballcarried && !actor.metertime)
- actor.metertime = time;
+ if(actor.ballcarried && !STAT(NB_METERSTART, actor))
+ STAT(NB_METERSTART, actor) = time;
else
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
else
{
- W_Nexball_Attack(actor, weaponentity, -1);
+ W_Nexball_Attack(thiswep, actor, weaponentity, -1);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
if(fire & 2)
if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire))
{
- W_Nexball_Attack2(actor, weaponentity);
+ W_Nexball_Attack2(thiswep, actor, weaponentity);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
}
- if(!(fire & 1) && actor.metertime && actor.ballcarried)
+ if(!(fire & 1) && STAT(NB_METERSTART, actor) && actor.ballcarried)
{
- W_Nexball_Attack(actor, weaponentity, time - actor.metertime);
+ W_Nexball_Attack(thiswep, actor, weaponentity, time - STAT(NB_METERSTART, actor));
// DropBall or stealing will set metertime back to 0
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
- TC(BallStealer, this);
+ TC(BallStealer, thiswep);
}
METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
delete(this);
}
-void W_Nexball_Attack(entity actor, .entity weaponentity, float t)
+void W_Nexball_Attack(Weapon thiswep, entity actor, .entity weaponentity, float t)
{
entity ball;
float mul, mi, ma;
tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
if(trace_startsolid)
{
- if(actor.metertime)
- actor.metertime = 0; // Shot failed, hide the power meter
+ if(STAT(NB_METERSTART, actor))
+ STAT(NB_METERSTART, actor) = 0; // Shot failed, hide the power meter
return;
}
//TODO: use the speed_up cvar too ??
}
-void W_Nexball_Attack2(entity actor, .entity weaponentity)
+void W_Nexball_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
{
if(actor.ballcarried.enemy)
{