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

Go to the source code of this file.

Functions

void HUD_Mod_NexBall (vector pos, vector mySize, bool should_draw)
 MUTATOR_HOOKFUNCTION (cl_nb, DrawScoreboardAccuracy)
 MUTATOR_HOOKFUNCTION (cl_nb, DrawScoreboardItemStats)
 MUTATOR_HOOKFUNCTION (cl_nb, WantEventchase)
 REGISTER_MUTATOR (cl_nb, true)

Variables

int autocvar_cl_eventchase_nexball = 1

Function Documentation

◆ HUD_Mod_NexBall()

void HUD_Mod_NexBall ( vector pos,
vector mySize,
bool should_draw )

Definition at line 7 of file cl_nexball.qc.

8{
9 if (!should_draw)
10 return;
11
12 int stat_items = STAT(OBJECTIVE_STATUS);
13 float nb_pb_starttime = STAT(NB_METERSTART);
14
15 mod_active = (stat_items & NB_CARRYING);
16
17 //Manage the progress bar if any
18 if (nb_pb_starttime > 0)
19 {
20 float dt = (time - nb_pb_starttime) % nb_pb_period;
21 // one period of positive triangle
22 float p = 2 * dt / nb_pb_period;
23 if (p > 1)
24 p = 2 - p;
25
27 }
28
29 if (stat_items & NB_CARRYING)
30 drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
31}
vector autocvar_hud_progressbar_nexball_color
Definition cl_nexball.qh:3
float nb_pb_period
Definition cl_nexball.qh:7
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Definition draw.qh:78
const float DRAWFLAG_NORMAL
float time
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
Definition hud.qc:269
float autocvar_hud_progressbar_alpha
Definition hud.qh:204
float panel_fg_alpha
Definition hud.qh:169
#define STAT(...)
Definition stats.qh:82
bool mod_active
Definition modicons.qh:7
const int NB_CARRYING
Definition nexball.qh:36
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44

References autocvar_hud_progressbar_alpha, autocvar_hud_progressbar_nexball_color, DRAWFLAG_NORMAL, drawpic_aspect_skin, eX, eY, HUD_Panel_DrawProgressBar(), mod_active, NB_CARRYING, nb_pb_period, panel_fg_alpha, STAT, time, and vector.

Referenced by NexBall::void().

◆ MUTATOR_HOOKFUNCTION() [1/3]

MUTATOR_HOOKFUNCTION ( cl_nb ,
DrawScoreboardAccuracy  )

Definition at line 44 of file cl_nexball.qc.

45{
46 return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gametype
47}
#define ISGAMETYPE(NAME)
Definition main.qh:46

References ISGAMETYPE.

◆ MUTATOR_HOOKFUNCTION() [2/3]

MUTATOR_HOOKFUNCTION ( cl_nb ,
DrawScoreboardItemStats  )

Definition at line 49 of file cl_nexball.qc.

50{
51 return ISGAMETYPE(NEXBALL); // hide the item stats panel
52}

References ISGAMETYPE.

◆ MUTATOR_HOOKFUNCTION() [3/3]

MUTATOR_HOOKFUNCTION ( cl_nb ,
WantEventchase  )

Definition at line 37 of file cl_nexball.qc.

38{
40 return true;
41 return false;
42}
int autocvar_cl_eventchase_nexball
Definition cl_nexball.qc:33
WepSet WepSet_GetFromStat()
Definition all.qc:80
#define WEPSET(id)
Definition all.qh:47

References autocvar_cl_eventchase_nexball, ISGAMETYPE, WantEventchase(), WEPSET, and WepSet_GetFromStat().

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( cl_nb ,
true  )

Variable Documentation

◆ autocvar_cl_eventchase_nexball

int autocvar_cl_eventchase_nexball = 1

Definition at line 33 of file cl_nexball.qc.

Referenced by MUTATOR_HOOKFUNCTION().