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

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (cl_ons, CustomizeEventchase)
 MUTATOR_HOOKFUNCTION (cl_ons, WantEventchase)
 NET_HANDLE (ENT_ONSCAMERA, bool isnew)
 REGISTER_MUTATOR (cl_ons, true)

Variables

float autocvar_cl_eventchase_generator_distance = 400
vector autocvar_cl_eventchase_generator_viewoffset = '0 0 80'
entity generator_camera
vector generator_origin
float ons_roundlost

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/2]

MUTATOR_HOOKFUNCTION ( cl_ons ,
CustomizeEventchase  )

Definition at line 56 of file onslaught.qc.

57{
59 {
60 M_ARGV(0, vector) = generator_camera.origin;
63 return true;
64 }
65 return false;
66}
#define M_ARGV(x, type)
Definition events.qh:17
float ons_roundlost
Definition onslaught.qc:29
vector autocvar_cl_eventchase_generator_viewoffset
Definition onslaught.qc:31
float autocvar_cl_eventchase_generator_distance
Definition onslaught.qc:32
entity generator_camera
Definition onslaught.qc:11
vector
Definition self.qh:92

References autocvar_cl_eventchase_generator_distance, autocvar_cl_eventchase_generator_viewoffset, generator_camera, M_ARGV, ons_roundlost, and vector.

◆ MUTATOR_HOOKFUNCTION() [2/2]

MUTATOR_HOOKFUNCTION ( cl_ons ,
WantEventchase  )

Definition at line 33 of file onslaught.qc.

34{
35 ons_roundlost = STAT(ROUNDLOST);
36 entity gen = NULL;
38 {
39 IL_EACH(g_onsgenerators, GetResource(it, RES_HEALTH) <= 0,
40 {
41 gen = it;
42 break;
43 });
44 if(!gen)
45 ons_roundlost = false; // don't enforce the 3rd person camera if there is no dead generator to show
46 }
47
49 {
50 generator_origin = gen.origin;
51 return true;
52 }
53 return false;
54}
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.
#define IL_EACH(this, cond, body)
#define STAT(...)
Definition stats.qh:82
vector generator_origin
Definition onslaught.qc:30
IntrusiveList g_onsgenerators
Definition onslaught.qh:30
#define NULL
Definition post.qh:14

References entity(), g_onsgenerators, generator_origin, GetResource(), IL_EACH, NULL, ons_roundlost, STAT, and WantEventchase().

◆ NET_HANDLE()

NET_HANDLE ( ENT_ONSCAMERA ,
bool isnew )

Definition at line 12 of file onslaught.qc.

13{
14 this.origin = ReadVector();
15 setorigin(this, this.origin);
16
17 this.angles = ReadAngleVector();
18
19 this.drawmask = MASK_NORMAL;
20 setmodel(this, MDL_Null); // give it a size for clientcamera
21 setsize(this, '-1 -1 -1', '1 1 1');
22
23 generator_camera = this;
24 return true;
25}
#define setmodel(this, m)
Definition model.qh:26
float drawmask
const float MASK_NORMAL
vector origin
ent angles
Definition ent_cs.qc:121
#define ReadVector()
Definition net.qh:367
#define ReadAngleVector()
Definition net.qh:369

References angles, drawmask, generator_camera, MASK_NORMAL, origin, ReadAngleVector, ReadVector, and setmodel.

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( cl_ons ,
true  )

Variable Documentation

◆ autocvar_cl_eventchase_generator_distance

float autocvar_cl_eventchase_generator_distance = 400

Definition at line 32 of file onslaught.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_cl_eventchase_generator_viewoffset

vector autocvar_cl_eventchase_generator_viewoffset = '0 0 80'

Definition at line 31 of file onslaught.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ generator_camera

entity generator_camera

Definition at line 11 of file onslaught.qc.

Referenced by MUTATOR_HOOKFUNCTION(), and NET_HANDLE().

◆ generator_origin

vector generator_origin

Definition at line 30 of file onslaught.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ ons_roundlost

float ons_roundlost

Definition at line 29 of file onslaught.qc.

Referenced by MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().