const float ST_NEXBALL_GOALS = 1;
void nb_ScoreRules(int teams)
{
- ScoreRules_basics(teams, 0, 0, true);
- ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, 0, 0, {
+ field_team(ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ field(SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ field(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
+ });
}
void LogNB(string mode, entity actor)
tracebox(this.origin, BALL_MINS, BALL_MAXS, this.origin, true, this);
if(trace_startsolid)
{
- vector o;
- o = this.origin;
- if(!move_out_of_solid(this))
+ vector o = this.origin;
+ if (!move_out_of_solid(this)) {
objerror(this, "could not get out of solid at all!");
- LOG_INFO("^1NOTE: this map needs FIXING. ", this.classname, " at ", vtos(o - '0 0 1'));
- LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
- LOG_INFO(" ", ftos(this.origin.y - o.y));
- LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+ }
+ LOG_INFOF(
+ "^1NOTE: this map needs FIXING. %s at %s needs to be moved out of solid, e.g. by %s",
+ this.classname,
+ vtos(o - '0 0 1'),
+ vtos(this.origin - o)
+ );
this.origin = o;
}
}
void InitBall(entity this)
{
- if(gameover) return;
+ if(game_stopped) return;
UNSET_ONGROUND(this);
set_movetype(this, MOVETYPE_BOUNCE);
if(this.classname == "nexball_basketball")
float isclient, pscore, otherteam;
string pname;
- if(gameover) return;
+ if(game_stopped) return;
if((this.spawnflags & GOAL_TOUCHPLAYER) && toucher.ballcarried)
ball = toucher.ballcarried;
else
LogNB("stole", attacker);
_sound(toucher, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
- if(SAME_TEAM(attacker, toucher) && time > attacker.teamkill_complain)
+ if(SAME_TEAM(attacker, toucher) && time > CS(attacker).teamkill_complain)
{
- attacker.teamkill_complain = time + 5;
- attacker.teamkill_soundtime = time + 0.4;
- attacker.teamkill_soundsource = toucher;
+ CS(attacker).teamkill_complain = time + 5;
+ CS(attacker).teamkill_soundtime = time + 0.4;
+ CS(attacker).teamkill_soundsource = toucher;
}
GiveBall(attacker, toucher.ballcarried);
//weapon_setup(WEP_PORTO.m_id);
}
+METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
+{
+ TC(BallStealer, this);
+}
+
METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
{
TC(BallStealer, this);
InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE);
WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- ActivateTeamplay();
- SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_g_nexball_goallimit);
+ GameRules_limit_lead(autocvar_g_nexball_goalleadlimit);
}
MUTATOR_ONROLLBACK_OR_REMOVE