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:531
vector mins
vector maxs
vector origin
int state
WriteByte(chan, ent.angles.y/DEC_FACTOR)
vector dest
Definition jumppads.qh:54
const int MSG_ENTITY
Definition net.qh:156
#define WriteHeader(to, id)
Definition net.qh:265
float bound(float min, float value, float max)
void WriteShort(float data, float dest, float desto)
vector
Definition self.qh:96

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 this.cnt = 12;
43 if (!this.count)
44 this.count = 2000;
45 // relative to absolute particle count
46 //this.count = 0.1 * this.count * (this.size_x / 1024) * (this.size_y / 1024);
47 this.count = bound(1, this.count, 65535);
48
49 this.state = RAINSNOW_RAIN;
50
51 Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
52}
vector velocity
const float SOLID_NOT
float solid
ent angles
Definition ent_cs.qc:146
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:167
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:133
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:419

References angles, bound(), 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 66 of file rainsnow.qc.

67{
68 this.dest = this.velocity;
69 this.velocity = '0 0 0';
70 if (!this.dest)
71 this.dest = '0 0 -300';
72 this.angles = '0 0 0';
74 this.solid = SOLID_NOT;
75 SetBrushEntityModel(this, true);
76 if (!this.cnt)
77 this.cnt = 12;
78 if (!this.count)
79 this.count = 2000;
80 // relative to absolute particle count
81 //this.count = 0.1 * this.count * (this.size_x / 1024) * (this.size_y / 1024);
82 this.count = bound(1, this.count, 65535);
83
84 this.state = RAINSNOW_SNOW;
85
86 Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
87}
const int RAINSNOW_SNOW
Definition rainsnow.qh:4

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