82 s =
strcat(
":nexball:", mode);
97 STAT(OBJECTIVE_STATUS,
this) &= ~NB_CARRYING;
102 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO,
APP_TEAM_NUM(this.
team, INFO_NEXBALL_RETURN_HELD));
108 STAT(OBJECTIVE_STATUS,
this) |= NB_CARRYING;
119 objerror(
this,
"could not get out of solid at all!");
122 "^1NOTE: this map needs FIXING. %s at %s needs to be moved out of solid, e.g. by %s",
135 DropBall(
this, ownr.origin, ownr.velocity);
137 ownr.velocity += (
'0 0 0.75' -
v_forward) * 1000;
148 ownr.ballcarried =
NULL;
150 if(STAT(NB_METERSTART, ownr))
152 STAT(NB_METERSTART, ownr) = 0;
155 WaypointSprite_Kill(ownr.waypointsprite_attachedforcarrier);
159 WaypointSprite_Kill(ball.waypointsprite_attachedforcarrier);
163 setorigin(ball, plyr.origin + plyr.view_ofs);
165 if(ball.team != plyr.team)
168 ball.owner = ball.pusher = plyr;
169 ball.weaponentity_fld = weaponentity;
170 ball.team = plyr.team;
171 plyr.ballcarried = ball;
173 ball.nb_dropper = plyr;
178 ball.velocity =
'0 0 0';
184 WaypointSprite_AttachCarrier(WP_NbBall, plyr, RADARICON_FLAGCARRIER);
185 WaypointSprite_UpdateRule(plyr.waypointsprite_attachedforcarrier, 0,
SPRITERULE_DEFAULT);
193 STAT(WEAPONS, plyr.(weaponentity)) = STAT(WEAPONS, plyr);
194 plyr.m_switchweapon = plyr.(weaponentity).m_weapon;
195 STAT(WEAPONS, plyr) =
WEPSET(NEXBALL);
197 w.wr_resetplayer(w, plyr);
198 plyr.(weaponentity).m_switchweapon = WEP_NEXBALL;
208 setattachment(ball,
NULL,
"");
214 ball.nb_droptime =
time;
219 if(STAT(NB_METERSTART, ball.owner))
221 STAT(NB_METERSTART, ball.owner) = 0;
222 .entity weaponentity = ball.weaponentity_fld;
226 WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
227 WaypointSprite_Spawn(WP_NbBall, 0, 0, ball,
'0 0 64',
NULL, ball.team, ball, waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
228 WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0,
SPRITERULE_DEFAULT);
231 e.ballcarried =
NULL;
237 if(game_stopped)
return;
240 if(this.
classname ==
"nexball_basketball")
242 else if(this.
classname ==
"nexball_football")
251 WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
260 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO,
APP_TEAM_NUM(this.
team, INFO_NEXBALL_RETURN_HELD));
270 else if(this.
cnt < 4)
281 LOG_TRACE(
"The ball moved too far away from its spawn origin.\nOffset: ",
312 this.
team = toucher.team;
339 if(toucher.ballcarried)
348 LogNB(
"caught", toucher);
362 float isclient, pscore, otherteam;
365 if(game_stopped)
return;
367 ball = toucher.ballcarried;
370 if(ball.classname !=
"nexball_basketball")
371 if(ball.classname !=
"nexball_football")
373 if((!ball.pusher &&
this.team !=
GOAL_OUT) || ball.cnt)
384 pname = ball.pusher.netname;
386 pname =
"Someone (?)";
388 if(ball.team ==
this.team)
390 LogNB(
"owngoal", ball.pusher);
391 bprint(
"Boo! ", pname,
"^7 scored a goal against their own team!\n");
396 LogNB(
"fault", ball.pusher);
405 LogNB(
"out", ball.pusher);
406 if((this.
spawnflags & GOAL_TOUCHPLAYER) && ball.owner)
407 bprint(pname,
"^7 went out of bounds.\n");
409 bprint(
"The ball was returned.\n");
421 if(ball.team && pscore)
437 DropBall(ball, ball.owner.origin, ball.owner.velocity);
439 WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
443 if(ball.classname ==
"nexball_basketball")
465 e.netname = teamname;
473 bool t_red =
false, t_blue =
false, t_yellow =
false, t_pink =
false;
535 this.
model =
"models/nexball/ball.md3";
539 precache_model(this.
model);
540 _setmodel(
this, this.
model);
545 this.spawnorigin = this.
origin;
562 else if(this.
noise ==
"")
575 WaypointSprite_AttachCarrier(WP_NbBall,
this, RADARICON_FLAGCARRIER);
618 entity e = WaypointSprite_getviewentity(client);
620 if(
SAME_TEAM(e, wp_owner)) {
return false; }
640 this.
noise =
"ctf/respawn.wav";
688 spawnfunc_nexball_football(
this);
692 spawnfunc_nexball_football(
this);
696 spawnfunc_nexball_basketball(
this);
701 spawnfunc_nexball_bluegoal(
this);
705 spawnfunc_nexball_redgoal(
this);
709 spawnfunc_nexball_fault(
this);
713 spawnfunc_nexball_out(
this);
726 if(client == this.
owner)
746 DropBall(player.ballcarried, player.origin, player.velocity);
778 if(player.ballcarried)
781 player.ballcarried.velocity = player.velocity;
784 vector org = player.origin + player.view_ofs +
793 if(player.ballcarried.wait <
time && player.ballcarried.enemy)
796 player.ballcarried.enemy =
NULL;
824 if(STAT(WEAPONS, player.(weaponentity)))
826 STAT(WEAPONS, player) = STAT(WEAPONS, player.(weaponentity));
828 w.wr_resetplayer(w, player);
829 player.(weaponentity).m_switchweapon = player.m_switchweapon;
830 W_SwitchWeapon(player, player.(weaponentity).m_switchweapon, weaponentity);
832 STAT(WEAPONS, player.(weaponentity)) =
'0 0 0';
847 STAT(NB_METERSTART, client) = STAT(NB_METERSTART, spectatee);
854 STAT(NB_METERSTART, player) = 0;
858 STAT(WEAPONS, player.(weaponentity)) =
'0 0 0';
862 STAT(WEAPONS, player) |=
WEPSET(NEXBALL);
864 STAT(WEAPONS, player) =
'0 0 0';
874 if(player.ballcarried)
883 return wepent.m_weapon == WEP_NEXBALL;
891 return wep == WEP_MORTAR.m_id;
899 if(item.weapon == WEP_NEXBALL.m_id)
910 if(item.weapon && toucher.ballcarried)
918 M_ARGV(1,
string) =
"nexball_team";
932 if(frag_target.ballcarried)
933 DropBall(frag_target.ballcarried, frag_target.origin, frag_target.velocity);
void InitBall(entity this)
float autocvar_g_nexball_football_boost_up
#define APP_TEAM_NUM(num, prefix)
#define GameRules_scoring(teams, spprio, stprio, fields)
float autocvar_g_balance_nexball_secondary_speed
void SpectateCopy(entity this, entity spectatee)
void DropBall(entity ball, vector org, vector vel)
void ball_restart(entity this)
void relocate_nexball(entity this)
float autocvar_g_nexball_football_boost_forward
float g_nexball_meter_period
#define EXACTTRIGGER_INIT
vector autocvar_g_nexball_viewmodel_offset
void football_touch(entity this, entity toucher)
const int SPRITERULE_DEFAULT
vector Team_ColorRGB(int teamid)
#define EXACTTRIGGER_TOUCH(e, t)
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
void GameRules_scoring_vip(entity player, bool value)
Mark a player as being 'important' (flag carrier, ball carrier, etc)
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit)
#define GameRules_scoring_add(client, fld, value)
bool autocvar_g_nexball_basketball_meter
void SpawnBall(entity this)
void GameRules_limit_score(int limit)
bool autocvar_g_nexball_basketball_jumppad
const int SFL_SORT_PRIO_PRIMARY
float autocvar_g_nexball_basketball_meter_maxpower
void basketball_touch(entity this, entity toucher)
float autocvar_g_nexball_tackling
void GiveBall(entity plyr, entity ball)
float DPCONTENTS_PLAYERCLIP
float autocvar_g_nexball_delay_idle
float autocvar_g_balance_nexball_secondary_animtime
float autocvar_g_nexball_basketball_meter_minpower
const int WS_READY
idle frame
bool autocvar_g_nexball_playerclip_collisions
#define UNSET_ONGROUND(s)
void PlayerPreThink(entity this)
#define move_out_of_solid(e)
void SpawnGoal(entity this)
const int SFL_LOWER_IS_BETTER
Lower scores are better (e.g.
float autocvar_g_balance_nexball_secondary_force
void crosshair_trace(entity pl)
bool ball_customize(entity this, entity client)
int autocvar_g_nexball_goalleadlimit
float autocvar_g_nexball_safepass_turnrate
const int ST_NEXBALL_GOALS
float autocvar_g_nexball_viewmodel_scale
float autocvar_g_nexball_safepass_maxdist
float autocvar_g_nexball_basketball_effects_default
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
bool autocvar_g_nexball_radar_showallplayers
int autocvar_g_nexball_trail_color
float autocvar_g_balance_nexball_primary_refire
bool autocvar_g_nexball_sound_bounce
float autocvar_g_balance_nexball_primary_speed
void GameRules_teams(bool value)
float autocvar_g_balance_nexball_secondary_lifetime
float autocvar_g_nexball_delay_collect
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
const int MAX_WEAPONSLOTS
float autocvar_g_nexball_basketball_bouncefactor
void nb_DropBall(entity player)
bool autocvar_g_nexball_football_jumppad
float autocvar_g_nexball_delay_goal
bool nb_Goal_Customize(entity this, entity client)
void nb_spawnteam(string teamname, float teamcolor)
void DropOwner(entity this)
void GameLogEcho(string s)
float autocvar_g_nexball_basketball_carrier_highspeed
const float GOAL_TOUCHPLAYER
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void nexball_setstatus(entity this)
MUTATOR_HOOKFUNCTION(nb, ClientDisconnect)
float autocvar_g_balance_nexball_secondary_refire
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void InitializeEntity(entity e, void(entity this) func, int order)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const float BALL_EFFECTMASK
void nb_ScoreRules(int teams)
float autocvar_g_nexball_basketball_bouncestop
#define _sound(e, c, s, v, a)
void ResetBall(entity this)
const float SOLID_TRIGGER
bool W_SwitchWeapon(entity this, Weapon w,.entity weaponentity)
void GameRules_limit_lead(int limit)
entity weaponentities[MAX_WEAPONSLOTS]
#define new_pure(class)
purely logical entities (.origin doesn't work)
bool Item_IsLoot(entity item)
Returns whether the item is loot.
void LogNB(string mode, entity actor)
float autocvar_g_nexball_basketball_delay_hold
void nb_delayedinit(entity this)
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
bool autocvar_sv_eventlog
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float autocvar_g_nexball_meter_period
float autocvar_g_balance_nexball_primary_animtime
#define Team_ColoredFullName(teamid)
float autocvar_g_nexball_delay_start
float autocvar_g_nexball_goallimit
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
void set_movetype(entity this, int mt)
float autocvar_g_nexball_football_bouncefactor
float autocvar_g_nexball_football_physics
float autocvar_g_nexball_safepass_holdtime
float autocvar_g_nexball_football_bouncestop
void GoalTouch(entity this, entity toucher)
float autocvar_g_nexball_basketball_delay_hold_forteam