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

Go to the source code of this file.

Functions

bool rainsnow_SendEntity (entity this, entity to, float sf)
 spawnfunc (func_rain)
 spawnfunc (func_snow)

Function Documentation

◆ rainsnow_SendEntity()

bool rainsnow_SendEntity ( entity this,
entity to,
float sf )

Definition at line 5 of file rainsnow.qc.

6{
7 vector myorg = this.origin + this.mins;
8 vector mysize = this.maxs - this.mins;
9 WriteHeader(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
11 WriteVector(MSG_ENTITY, myorg);
12 WriteVector(MSG_ENTITY, mysize);
16 WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767));
17 return true;
18}
float cnt
Definition powerups.qc:24
float count
Definition powerups.qc:22
float fade_end
Definition item.qh:87
float compressShortVector(vector vec)
Definition util.qc:521
vector mins
vector maxs
vector origin
int state
vector dest
Definition jumppads.qh:54
const int MSG_ENTITY
Definition net.qh:115
#define WriteHeader(to, id)
Definition net.qh:221
float bound(float min, float value, float max)
void WriteShort(float data, float dest, float desto)
void WriteByte(float data, float dest, float desto)
vector
Definition self.qh:92

References bound(), cnt, compressShortVector(), count, dest, entity(), fade_end, maxs, mins, MSG_ENTITY, origin, state, vector, WriteByte(), WriteHeader, and WriteShort().

Referenced by spawnfunc(), and spawnfunc().

◆ spawnfunc() [1/2]

spawnfunc ( func_rain )

Definition at line 31 of file rainsnow.qc.

32{
33 this.dest = this.velocity;
34 this.velocity = '0 0 0';
35 if (!this.dest)
36 this.dest = '0 0 -700';
37 this.angles = '0 0 0';
39 this.solid = SOLID_NOT;
40 SetBrushEntityModel(this, true);
41 if (!this.cnt)
42 {
43 this.cnt = 12;
44 }
45 if (!this.count)
46 this.count = 2000;
47 // relative to absolute particle count
48 //this.count = 0.1 * this.count * (this.size_x / 1024) * (this.size_y / 1024);
49 if (this.count < 1)
50 this.count = 1;
51 if(this.count > 65535)
52 this.count = 65535;
53
54 this.state = RAINSNOW_RAIN;
55
56 Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
57}
vector velocity
const float SOLID_NOT
ent angles
Definition ent_cs.qc:121
solid
Definition ent_cs.qc:165
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:129
bool rainsnow_SendEntity(entity this, entity to, float sf)
Definition rainsnow.qc:5
const int RAINSNOW_RAIN
Definition rainsnow.qh:5
void SetBrushEntityModel(entity this, bool with_lod)
Definition subs.qc:420

References angles, cnt, count, dest, MOVETYPE_NONE, Net_LinkEntity(), RAINSNOW_RAIN, rainsnow_SendEntity(), set_movetype(), SetBrushEntityModel(), solid, SOLID_NOT, state, and velocity.

◆ spawnfunc() [2/2]

spawnfunc ( func_snow )

Definition at line 71 of file rainsnow.qc.

72{
73 this.dest = this.velocity;
74 this.velocity = '0 0 0';
75 if (!this.dest)
76 this.dest = '0 0 -300';
77 this.angles = '0 0 0';
79 this.solid = SOLID_NOT;
80 SetBrushEntityModel(this, true);
81 if (!this.cnt)
82 {
83 this.cnt = 12;
84 }
85 if (!this.count)
86 this.count = 2000;
87 // relative to absolute particle count
88 //this.count = 0.1 * this.count * (this.size_x / 1024) * (this.size_y / 1024);
89 if (this.count < 1)
90 this.count = 1;
91 if(this.count > 65535)
92 this.count = 65535;
93
94 this.state = RAINSNOW_SNOW;
95
96 Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
97}
const int RAINSNOW_SNOW
Definition rainsnow.qh:4

References angles, cnt, count, dest, MOVETYPE_NONE, Net_LinkEntity(), rainsnow_SendEntity(), RAINSNOW_SNOW, set_movetype(), SetBrushEntityModel(), solid, SOLID_NOT, state, and velocity.