82 s =
strcat(
":nexball:", mode);
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;
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';
193 STAT(WEAPONS, plyr.(weaponentity)) =
STAT(WEAPONS, plyr);
194 plyr.m_switchweapon = plyr.(weaponentity).
m_weapon;
208 setattachment(ball,
NULL,
"");
209 setorigin(ball,
org);
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;
227 WaypointSprite_Spawn(WP_NbBall, 0, 0, ball,
'0 0 64',
NULL, ball.team, ball,
waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
231 e.ballcarried =
NULL;
240 if(this.
classname ==
"nexball_basketball")
242 else if(this.
classname ==
"nexball_football")
270 else if(this.
cnt < 4)
281 LOG_TRACE(
"The ball moved too far away from its spawn origin.\nOffset: ",
363 float isclient, pscore, otherteam;
371 if(ball.classname !=
"nexball_basketball")
372 if(ball.classname !=
"nexball_football")
374 if((!ball.pusher &&
this.team !=
GOAL_OUT) || ball.cnt)
385 pname = ball.pusher.netname;
387 pname =
"Someone (?)";
389 if(ball.team ==
this.team)
391 LogNB(
"owngoal", ball.pusher);
392 bprint(
"Boo! ", pname,
"^7 scored a goal against their own team!\n");
397 LogNB(
"fault", ball.pusher);
406 LogNB(
"out", ball.pusher);
408 bprint(pname,
"^7 went out of bounds.\n");
410 bprint(
"The ball was returned.\n");
422 if(ball.team && pscore)
438 DropBall(ball, ball.owner.origin, ball.owner.velocity);
444 if(ball.classname ==
"nexball_basketball")
466 e.netname = teamname;
474 bool t_red =
false, t_blue =
false, t_yellow =
false, t_pink =
false;
536 this.
model =
"models/nexball/ball.md3";
540 precache_model(this.
model);
541 _setmodel(
this, this.
model);
563 else if(this.
noise ==
"")
621 if(
SAME_TEAM(e, wp_owner)) {
return false; }
641 this.
noise =
"ctf/respawn.wav";
689 spawnfunc_nexball_football(
this);
693 spawnfunc_nexball_football(
this);
697 spawnfunc_nexball_basketball(
this);
702 spawnfunc_nexball_bluegoal(
this);
706 spawnfunc_nexball_redgoal(
this);
710 spawnfunc_nexball_fault(
this);
714 spawnfunc_nexball_out(
this);
727 if(client == this.
owner)
747 DropBall(player.ballcarried, player.origin, player.velocity);
779 if(player.ballcarried)
782 player.ballcarried.velocity = player.velocity;
785 vector org = player.origin + player.view_ofs +
789 setorigin(player.ballcarried,
org);
794 if(player.ballcarried.wait <
time && player.ballcarried.enemy)
797 player.ballcarried.enemy =
NULL;
825 if(
STAT(WEAPONS, player.(weaponentity)))
827 STAT(WEAPONS, player) =
STAT(WEAPONS, player.(weaponentity));
831 W_SwitchWeapon(player, player.(weaponentity).m_switchweapon, weaponentity);
833 STAT(WEAPONS, player.(weaponentity)) =
'0 0 0';
848 STAT(NB_METERSTART, client) =
STAT(NB_METERSTART, spectatee);
855 STAT(NB_METERSTART, player) = 0;
859 STAT(WEAPONS, player.(weaponentity)) =
'0 0 0';
865 STAT(WEAPONS, player) =
'0 0 0';
875 if(player.ballcarried)
884 return wepent.m_weapon == WEP_NEXBALL;
892 return wep == WEP_MORTAR.m_id;
900 if(item.weapon == WEP_NEXBALL.m_id)
911 if(item.weapon &&
toucher.ballcarried)
919 M_ARGV(1,
string) =
"nexball_team";
#define MUTATOR_HOOKFUNCTION(...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_resetplayer()
(SERVER) clears fields that the weapon may use
const int SFL_LOWER_IS_BETTER
Lower scores are better (e.g.
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit) NOTE: SFL_SORT_PRIO_SECONDARY value must be lo...
const int SFL_SORT_PRIO_PRIMARY
const int INITPRIO_GAMETYPE
const float SOLID_TRIGGER
float DPCONTENTS_PLAYERCLIP
void GameLogEcho(string s)
bool autocvar_sv_eventlog
#define ITEM_IS_LOOT(item)
Returns whether the item is loot.
#define EXACTTRIGGER_TOUCH(e, t)
#define EXACTTRIGGER_INIT
#define move_out_of_solid(e)
void set_movetype(entity this, int mt)
#define UNSET_ONGROUND(s)
const int MOVETYPE_NOCLIP
const int MOVETYPE_BOUNCE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
#define APP_TEAM_NUM(num, prefix)
#define new_pure(class)
purely logical entities (not linked to the area grid)
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
bool W_SwitchWeapon(entity this, Weapon w,.entity weaponentity)
void SpectateCopy(entity this, entity spectatee)
#define _sound(e, c, s, v, a)
void nexball_setstatus(entity this)
int autocvar_g_nexball_trail_color
float autocvar_g_nexball_basketball_meter_minpower
void nb_DropBall(entity player)
bool autocvar_g_nexball_playerclip_collisions
void relocate_nexball(entity this)
float autocvar_g_balance_nexball_primary_refire
bool autocvar_g_nexball_radar_showallplayers
float autocvar_g_nexball_football_bouncestop
void nb_spawnteam(string teamname, float teamcolor)
float autocvar_g_nexball_delay_goal
const int ST_NEXBALL_GOALS
bool autocvar_g_nexball_basketball_meter
float autocvar_g_balance_nexball_secondary_refire
void GoalTouch(entity this, entity toucher)
float autocvar_g_nexball_basketball_meter_maxpower
void LogNB(string mode, entity actor)
float autocvar_g_balance_nexball_primary_animtime
void SpawnGoal(entity this)
float autocvar_g_nexball_delay_collect
void InitBall(entity this)
float autocvar_g_nexball_basketball_bouncestop
bool nb_Goal_Customize(entity this, entity client)
void football_touch(entity this, entity toucher)
float autocvar_g_balance_nexball_secondary_lifetime
float autocvar_g_balance_nexball_secondary_speed
void ball_restart(entity this)
void GiveBall(entity plyr, entity ball)
float autocvar_g_nexball_basketball_carrier_highspeed
float autocvar_g_balance_nexball_primary_speed
float autocvar_g_nexball_delay_start
float autocvar_g_nexball_football_bouncefactor
void basketball_touch(entity this, entity toucher)
vector autocvar_g_nexball_viewmodel_offset
float autocvar_g_nexball_safepass_holdtime
bool autocvar_g_nexball_basketball_jumppad
float autocvar_g_nexball_safepass_maxdist
float autocvar_g_nexball_safepass_turnrate
bool autocvar_g_nexball_sound_bounce
bool autocvar_g_nexball_football_jumppad
void nb_ScoreRules(int teams)
float autocvar_g_balance_nexball_secondary_force
float autocvar_g_nexball_basketball_bouncefactor
float autocvar_g_nexball_tackling
int autocvar_g_nexball_goalleadlimit
void DropBall(entity ball, vector org, vector vel)
float autocvar_g_nexball_viewmodel_scale
bool ball_customize(entity this, entity client)
void nb_delayedinit(entity this)
float autocvar_g_nexball_goallimit
void ResetBall(entity this)
float autocvar_g_balance_nexball_secondary_animtime
void SpawnBall(entity this)
void DropOwner(entity this)
float autocvar_g_nexball_basketball_effects_default
float autocvar_g_nexball_delay_idle
float g_nexball_meter_period
float autocvar_g_nexball_meter_period
float autocvar_g_nexball_football_physics
float autocvar_g_nexball_basketball_delay_hold_forteam
float autocvar_g_nexball_football_boost_forward
float autocvar_g_nexball_football_boost_up
const float GOAL_TOUCHPLAYER
float autocvar_g_nexball_basketball_delay_hold
const float BALL_EFFECTMASK
void GameRules_limit_score(int limit)
void GameRules_teams(bool value)
void GameRules_limit_lead(int limit)
#define GameRules_scoring_vip(player, value)
#define GameRules_scoring_add(client, fld, value)
#define GameRules_scoring(teams, spprio, stprio, fields)
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
vector Team_ColorRGB(int teamid)
#define Team_ColoredFullName(teamid)
void crosshair_trace(entity pl)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WaypointSprite_Kill(entity wp)
void WaypointSprite_Ping(entity e)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
entity WaypointSprite_getviewentity(entity e)
entity WaypointSprite_AttachCarrier(entity spr, entity carrier, entity icon)
entity WaypointSprite_SpawnFixed(entity spr, vector ofs, entity own,.entity ownfield, entity icon)
void WaypointSprite_UpdateRule(entity e, float t, float r)
const int SPRITERULE_DEFAULT
entity waypointsprite_attachedforcarrier
const int MAX_WEAPONSLOTS
const int WS_READY
idle frame
entity weaponentities[MAX_WEAPONSLOTS]
void InitializeEntity(entity e, void(entity this) func, int order)