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

Go to the source code of this file.

Classes

class  Keepaway

Functions

void HUD_Mod_Keepaway (vector pos, vector mySize)
 REGISTER_GAMETYPE (KEEPAWAY, NEW(Keepaway))

Variables

const int KA_CARRYING = BIT(0)

Function Documentation

◆ HUD_Mod_Keepaway()

void HUD_Mod_Keepaway ( vector pos,
vector mySize )

Definition at line 13 of file cl_keepaway.qc.

14{
15 mod_active = 1; // keepaway should always show the mod HUD
16
17 float kaball_alpha = blink(0.85, 0.15, 5);
18
19 int kaball = (STAT(OBJECTIVE_STATUS) & KA_CARRYING);
20
21 if(kaball != kaball_prevstatus)
22 {
24 kaball_prevstatus = kaball;
25 }
26
27 vector kaball_pos, kaball_size;
28
29 if(mySize.x > mySize.y) {
30 kaball_pos = pos + eX * 0.25 * mySize.x;
31 kaball_size = vec2(0.5 * mySize.x, mySize.y);
32 } else {
33 kaball_pos = pos + eY * 0.25 * mySize.y;
34 kaball_size = vec2(mySize.x, 0.5 * mySize.y);
35 }
36
37 float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
38 float f = bound(0, kaball_statuschange_elapsedtime*2, 1);
39
40 if(kaball_prevstatus && f < 1)
41 drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
42
43 if(kaball)
44 drawpic_aspect_skin(pos, "keepawayball_carrying", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
45}
int kaball_prevstatus
Definition cl_keepaway.qc:7
float kaball_statuschange_time
Definition cl_keepaway.qc:8
void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
Definition draw.qc:61
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Definition draw.qh:78
ERASEABLE float blink(float base, float range, float freq)
Definition util.qc:2178
const float DRAWFLAG_NORMAL
float time
float panel_fg_alpha
Definition hud.qh:169
const int KA_CARRYING
Definition keepaway.qh:24
#define STAT(...)
Definition stats.qh:82
float bound(float min, float value, float max)
bool mod_active
Definition modicons.qh:7
vector
Definition self.qh:92
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44
#define vec2(...)
Definition vector.qh:90

References blink(), bound(), DRAWFLAG_NORMAL, drawpic_aspect_skin, drawpic_aspect_skin_expanding(), eX, eY, KA_CARRYING, kaball_prevstatus, kaball_statuschange_time, mod_active, panel_fg_alpha, STAT, time, vec2, and vector.

Referenced by Keepaway::void().

◆ REGISTER_GAMETYPE()

REGISTER_GAMETYPE ( KEEPAWAY ,
NEW(Keepaway)  )

References NEW, and REGISTER_GAMETYPE.

Variable Documentation

◆ KA_CARRYING

const int KA_CARRYING = BIT(0)

Definition at line 24 of file keepaway.qh.

Referenced by HUD_Mod_Keepaway(), and MUTATOR_HOOKFUNCTION().