#ifdef IMPLEMENTATION
#ifdef SVQC
-.float metertime;
+.float metertime = _STAT(NB_METERSTART);
int autocvar_g_nexball_goalleadlimit;
#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
GameLogEcho(s);
}
-void ball_restart(void)
-{SELFPARAM();
- if(self.owner)
- DropBall(self, self.owner.origin, '0 0 0');
+void ball_restart(entity this)
+{
+ if(this.owner)
+ DropBall(this, this.owner.origin, '0 0 0');
ResetBall();
}
-void nexball_setstatus(void)
+void nexball_setstatus()
{SELFPARAM();
self.items &= ~IT_KEY1;
if(self.ballcarried)
}
}
-void relocate_nexball(void)
+void relocate_nexball()
{SELFPARAM();
tracebox(self.origin, BALL_MINS, BALL_MAXS, self.origin, true, self);
if(trace_startsolid)
}
}
-void DropOwner(void)
+void DropOwner()
{SELFPARAM();
entity ownr;
ownr = self.owner;
ball.owner = world;
}
-void InitBall(void)
+void InitBall()
{SELFPARAM();
if(gameover) return;
self.flags &= ~FL_ONGROUND;
LogNB("init", world);
}
-void ResetBall(void)
+void ResetBall()
{SELFPARAM();
if(self.cnt < 2) // step 1
{
}
}
-void football_touch(void)
+void football_touch()
{SELFPARAM();
if(other.solid == SOLID_BSP)
{
self.avelocity = -250 * v_forward; // maybe there is a way to make it look better?
}
-void basketball_touch(void)
+void basketball_touch()
{SELFPARAM();
if(other.ballcarried)
{
}
}
-void GoalTouch(void)
+void GoalTouch()
{SELFPARAM();
entity ball;
float isclient, pscore, otherteam;
nb_teams += 1;
}
-void nb_spawnteams(void)
+void nb_spawnteams()
{
bool t_red = false, t_blue = false, t_yellow = false, t_pink = false;
entity e;
}
}
-void nb_delayedinit(void)
+void nb_delayedinit()
{
if(find(world, classname, "nexball_team") == world)
nb_spawnteams();
// spawnfuncs //
//=======================//
-void SpawnBall(void)
+void SpawnBall()
{SELFPARAM();
if(!g_nexball) { remove(self); return; }
return true;
}
-void SpawnGoal(void)
+void SpawnGoal()
{SELFPARAM();
if(!g_nexball) { remove(self); return; }
self.nextthink = time;
}
-void W_Nexball_Touch(void)
+void W_Nexball_Touch()
{SELFPARAM();
entity ball, attacker;
attacker = self.owner;
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
-void W_Nexball_Attack2(void)
+void W_Nexball_Attack2()
{SELFPARAM();
if(self.ballcarried.enemy)
{
W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles(missile.velocity);
missile.touch = W_Nexball_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
if(g_nexball_meter_period <= 0)
g_nexball_meter_period = 2; // avoid division by zero etc. due to silly users
g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
- addstat(STAT_NB_METERSTART, AS_FLOAT, metertime);
// General settings
/*