Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_nexball.qh File Reference
#include "weapon.qh"
Include dependency graph for sv_nexball.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void DropBall (entity ball, vector org, vector vel)
void nb_Initialize ()
 REGISTER_MUTATOR (nb, false)

Variables

float autocvar_g_nexball_basketball_delay_hold
float autocvar_g_nexball_basketball_delay_hold_forteam
float autocvar_g_nexball_basketball_effects_default
float autocvar_g_nexball_basketball_teamsteal
float autocvar_g_nexball_delay_idle
float autocvar_g_nexball_football_boost_forward
float autocvar_g_nexball_football_boost_up
float autocvar_g_nexball_football_physics
float autocvar_g_nexball_meter_period
const vector BALL_ATTACHORG = '3 0 16'
const float BALL_BASKET = 2
const float BALL_EFFECTMASK = 1229
const float BALL_FOOT = 1
const vector BALL_MAXS = '16 16 16'
const vector BALL_MINS = '-16 -16 -16'
float ball_scale
float balls
float g_nexball_meter_period
const float GOAL_FAULT = -1
const float GOAL_OUT = -2
const float GOAL_TOUCHPLAYER = 1
entity nb_dropper
float nb_droptime
float nb_teams

Function Documentation

◆ DropBall()

void DropBall ( entity ball,
vector org,
vector vel )

Definition at line 202 of file sv_nexball.qc.

203{
205 ball.effects &= ~EF_NOSHADOW;
207
208 setattachment(ball, NULL, "");
209 setorigin(ball, org);
211 UNSET_ONGROUND(ball);
212 ball.scale = ball_scale;
213 ball.velocity = vel;
214 ball.nb_droptime = time;
216 setthink(ball, ResetBall);
217 ball.nextthink = min(time + autocvar_g_nexball_delay_idle, ball.lifetime);
218
219 if(STAT(NB_METERSTART, ball.owner))
220 {
221 STAT(NB_METERSTART, ball.owner) = 0;
222 .entity weaponentity = ball.weaponentity_fld;
223 ball.owner.(weaponentity).state = WS_READY;
224 }
225
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); // no health bar please
228 WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
229
230 entity e = ball.owner; ball.owner = NULL;
231 e.ballcarried = NULL;
232 GameRules_scoring_vip(e, false);
233}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float time
const float EF_NOSHADOW
int state
#define STAT(...)
Definition stats.qh:82
float min(float f,...)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
#define UNSET_ONGROUND(s)
Definition movetypes.qh:18
const int MOVETYPE_BOUNCE
Definition movetypes.qh:139
#define NULL
Definition post.qh:14
#define setthink(e, f)
vector org
Definition self.qh:92
#define settouch(e, f)
Definition self.qh:73
void basketball_touch(entity this, entity toucher)
void ResetBall(entity this)
float ball_scale
Definition sv_nexball.qh:48
float autocvar_g_nexball_basketball_effects_default
Definition sv_nexball.qh:43
float autocvar_g_nexball_delay_idle
Definition sv_nexball.qh:40
#define GameRules_scoring_vip(player, value)
Definition sv_rules.qh:78
void WaypointSprite_Kill(entity wp)
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)
void WaypointSprite_UpdateRule(entity e, float t, float r)
const int SPRITERULE_DEFAULT
entity waypointsprite_attachedforcarrier
const int WS_READY
idle frame
Definition weapon.qh:41

References autocvar_g_nexball_basketball_effects_default, autocvar_g_nexball_delay_idle, ball_scale, basketball_touch(), EF_NOSHADOW, entity(), GameRules_scoring_vip, min(), MOVETYPE_BOUNCE, NULL, org, ResetBall(), set_movetype(), setthink, settouch, SPRITERULE_DEFAULT, STAT, state, time, UNSET_ONGROUND, vector, waypointsprite_attachedforcarrier, WaypointSprite_Kill(), WaypointSprite_Spawn(), WaypointSprite_UpdateRule(), and WS_READY.

Referenced by ball_restart(), DropOwner(), GoalTouch(), MUTATOR_HOOKFUNCTION(), nb_DropBall(), nexball_setstatus(), W_Nexball_Attack(), and W_Nexball_Attack2().

◆ nb_Initialize()

void nb_Initialize ( )

Definition at line 944 of file sv_nexball.qc.

945{
948 g_nexball_meter_period = 2; // avoid division by zero etc. due to silly users
949 g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
950
951 // General settings
952 /*
953 CVTOV(g_nexball_football_boost_forward); //100
954 CVTOV(g_nexball_football_boost_up); //200
955 CVTOV(g_nexball_delay_idle); //10
956 CVTOV(g_nexball_football_physics); //0
957 */
959
960 GameRules_teams(true);
963
965}
const int INITPRIO_GAMETYPE
Definition constants.qh:94
bool radar_showenemies
Definition ent_cs.qh:50
float rint(float f)
bool autocvar_g_nexball_radar_showallplayers
Definition sv_nexball.qc:29
int autocvar_g_nexball_goalleadlimit
Definition sv_nexball.qc:13
void nb_delayedinit(entity this)
float autocvar_g_nexball_goallimit
Definition sv_nexball.qc:14
float g_nexball_meter_period
Definition sv_nexball.qh:54
float autocvar_g_nexball_meter_period
Definition sv_nexball.qh:45
void GameRules_limit_score(int limit)
Definition sv_rules.qc:23
void GameRules_teams(bool value)
Definition sv_rules.qc:3
void GameRules_limit_lead(int limit)
Definition sv_rules.qc:33
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2209

References autocvar_g_nexball_goalleadlimit, autocvar_g_nexball_goallimit, autocvar_g_nexball_meter_period, autocvar_g_nexball_radar_showallplayers, g_nexball_meter_period, GameRules_limit_lead(), GameRules_limit_score(), GameRules_teams(), InitializeEntity(), INITPRIO_GAMETYPE, nb_delayedinit(), NULL, radar_showenemies, and rint().

Referenced by REGISTER_MUTATOR().

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( nb ,
false  )

Definition at line 7 of file sv_nexball.qh.

8{
11 {
13 WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
14 }
15
17 {
18 WEP_NEXBALL.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
19 }
20 return 0;
21}
#define MUTATOR_ONADD
Definition base.qh:309
#define MUTATOR_ONROLLBACK_OR_REMOVE
Definition base.qh:311
#define MUTATOR_STATIC()
Definition base.qh:313
void nb_Initialize()
const int WEP_FLAG_MUTATORBLOCKED
Definition weapon.qh:219

References MUTATOR_ONADD, MUTATOR_ONROLLBACK_OR_REMOVE, MUTATOR_STATIC, nb_Initialize(), and WEP_FLAG_MUTATORBLOCKED.

Variable Documentation

◆ autocvar_g_nexball_basketball_delay_hold

float autocvar_g_nexball_basketball_delay_hold

Definition at line 41 of file sv_nexball.qh.

Referenced by GiveBall().

◆ autocvar_g_nexball_basketball_delay_hold_forteam

float autocvar_g_nexball_basketball_delay_hold_forteam

Definition at line 42 of file sv_nexball.qh.

Referenced by GiveBall().

◆ autocvar_g_nexball_basketball_effects_default

float autocvar_g_nexball_basketball_effects_default

Definition at line 43 of file sv_nexball.qh.

Referenced by DropBall(), GiveBall(), and spawnfunc().

◆ autocvar_g_nexball_basketball_teamsteal

float autocvar_g_nexball_basketball_teamsteal

Definition at line 44 of file sv_nexball.qh.

Referenced by W_Nexball_Touch().

◆ autocvar_g_nexball_delay_idle

float autocvar_g_nexball_delay_idle

Definition at line 40 of file sv_nexball.qh.

Referenced by basketball_touch(), DropBall(), football_touch(), and InitBall().

◆ autocvar_g_nexball_football_boost_forward

float autocvar_g_nexball_football_boost_forward

Definition at line 37 of file sv_nexball.qh.

Referenced by football_touch().

◆ autocvar_g_nexball_football_boost_up

float autocvar_g_nexball_football_boost_up

Definition at line 38 of file sv_nexball.qh.

Referenced by football_touch().

◆ autocvar_g_nexball_football_physics

float autocvar_g_nexball_football_physics

Definition at line 39 of file sv_nexball.qh.

Referenced by football_touch().

◆ autocvar_g_nexball_meter_period

float autocvar_g_nexball_meter_period

Definition at line 45 of file sv_nexball.qh.

Referenced by nb_Initialize().

◆ BALL_ATTACHORG

const vector BALL_ATTACHORG = '3 0 16'

Definition at line 27 of file sv_nexball.qh.

◆ BALL_BASKET

const float BALL_BASKET = 2

Definition at line 29 of file sv_nexball.qh.

Referenced by spawnfunc().

◆ BALL_EFFECTMASK

const float BALL_EFFECTMASK = 1229

Definition at line 24 of file sv_nexball.qh.

Referenced by spawnfunc().

◆ BALL_FOOT

const float BALL_FOOT = 1

Definition at line 28 of file sv_nexball.qh.

Referenced by spawnfunc().

◆ BALL_MAXS

const vector BALL_MAXS = '16 16 16'

Definition at line 26 of file sv_nexball.qh.

Referenced by relocate_nexball(), SpawnBall(), and W_Nexball_Attack().

◆ BALL_MINS

const vector BALL_MINS = '-16 -16 -16'

Definition at line 25 of file sv_nexball.qh.

Referenced by relocate_nexball(), SpawnBall(), and W_Nexball_Attack().

◆ ball_scale

float ball_scale

Definition at line 48 of file sv_nexball.qh.

Referenced by DropBall(), and SpawnBall().

◆ balls

float balls

Definition at line 47 of file sv_nexball.qh.

Referenced by spawnfunc(), and spawnfunc().

◆ g_nexball_meter_period

float g_nexball_meter_period

Definition at line 54 of file sv_nexball.qh.

Referenced by ClientInit_misc(), nb_Initialize(), and W_Nexball_Attack().

◆ GOAL_FAULT

const float GOAL_FAULT = -1

Definition at line 33 of file sv_nexball.qh.

Referenced by GoalTouch(), and spawnfunc().

◆ GOAL_OUT

const float GOAL_OUT = -2

Definition at line 34 of file sv_nexball.qh.

Referenced by GoalTouch(), spawnfunc(), and SpawnGoal().

◆ GOAL_TOUCHPLAYER

const float GOAL_TOUCHPLAYER = 1

Definition at line 31 of file sv_nexball.qh.

Referenced by GoalTouch().

◆ nb_dropper

entity nb_dropper

Definition at line 51 of file sv_nexball.qh.

Referenced by basketball_touch().

◆ nb_droptime

float nb_droptime

Definition at line 52 of file sv_nexball.qh.

Referenced by basketball_touch().

◆ nb_teams

float nb_teams

Definition at line 49 of file sv_nexball.qh.

Referenced by GoalTouch(), nb_delayedinit(), and nb_spawnteams().