1 REGISTER_NET_LINKED(ENT_CLIENT_RAINSNOW)
4 bool rainsnow_SendEntity(entity this, entity to, float sf)
6 WriteHeader(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
7 WriteByte(MSG_ENTITY, self.state);
8 WriteCoord(MSG_ENTITY, self.origin_x + self.mins_x);
9 WriteCoord(MSG_ENTITY, self.origin_y + self.mins_y);
10 WriteCoord(MSG_ENTITY, self.origin_z + self.mins_z);
11 WriteCoord(MSG_ENTITY, self.maxs_x - self.mins_x);
12 WriteCoord(MSG_ENTITY, self.maxs_y - self.mins_y);
13 WriteCoord(MSG_ENTITY, self.maxs_z - self.mins_z);
14 WriteShort(MSG_ENTITY, compressShortVector(self.dest));
15 WriteShort(MSG_ENTITY, self.count);
16 WriteByte(MSG_ENTITY, self.cnt);
20 /*QUAKED spawnfunc_func_rain (0 .5 .8) ?
21 This is an invisible area like a trigger, which rain falls inside of.
25 falling direction (should be something like '0 0 -700', use the X and Y velocity for wind)
27 sets color of rain (default 12 - white)
29 adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
33 self.dest = self.velocity;
34 self.velocity = '0 0 0';
36 self.dest = '0 0 -700';
37 self.angles = '0 0 0';
38 self.movetype = MOVETYPE_NONE;
39 self.solid = SOLID_NOT;
40 SetBrushEntityModel();
45 self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024);
48 if(self.count > 65535)
51 self.state = 1; // 1 is rain, 0 is snow
54 Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
58 /*QUAKED spawnfunc_func_snow (0 .5 .8) ?
59 This is an invisible area like a trigger, which snow falls inside of.
63 falling direction (should be something like '0 0 -300', use the X and Y velocity for wind)
65 sets color of rain (default 12 - white)
67 adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
71 self.dest = self.velocity;
72 self.velocity = '0 0 0';
74 self.dest = '0 0 -300';
75 self.angles = '0 0 0';
76 self.movetype = MOVETYPE_NONE;
77 self.solid = SOLID_NOT;
78 SetBrushEntityModel();
83 self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024);
86 if(self.count > 65535)
89 self.state = 0; // 1 is rain, 0 is snow
92 Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
95 void Draw_Rain(entity this)
97 te_particlerain(this.origin + this.mins, this.origin + this.maxs, this.velocity, floor(this.count * drawframetime + random()), this.glow_color);
100 void Draw_Snow(entity this)
102 te_particlesnow(this.origin + this.mins, this.origin + this.maxs, this.velocity, floor(this.count * drawframetime + random()), this.glow_color);
105 NET_HANDLE(ENT_CLIENT_RAINSNOW, bool isnew)
107 self.impulse = ReadByte(); // Rain, Snow, or Whatever
108 self.origin_x = ReadCoord();
109 self.origin_y = ReadCoord();
110 self.origin_z = ReadCoord();
111 self.maxs_x = ReadCoord();
112 self.maxs_y = ReadCoord();
113 self.maxs_z = ReadCoord();
114 self.velocity = decompressShortVector(ReadShort());
115 self.count = ReadShort() * 10;
116 self.glow_color = ReadByte(); // color
120 self.mins = -0.5 * self.maxs;
121 self.maxs = 0.5 * self.maxs;
122 self.origin = self.origin - self.mins;
124 setorigin(self, self.origin);
125 setsize(self, self.mins, self.maxs);
126 self.solid = SOLID_NOT;
128 self.draw = Draw_Rain;
130 self.draw = Draw_Snow;