2 float rainsnow_SendEntity(entity to, float sf)
4 WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
5 WriteByte(MSG_ENTITY, self.state);
6 WriteCoord(MSG_ENTITY, self.origin_x + self.mins_x);
7 WriteCoord(MSG_ENTITY, self.origin_y + self.mins_y);
8 WriteCoord(MSG_ENTITY, self.origin_z + self.mins_z);
9 WriteCoord(MSG_ENTITY, self.maxs_x - self.mins_x);
10 WriteCoord(MSG_ENTITY, self.maxs_y - self.mins_y);
11 WriteCoord(MSG_ENTITY, self.maxs_z - self.mins_z);
12 WriteShort(MSG_ENTITY, compressShortVector(self.dest));
13 WriteShort(MSG_ENTITY, self.count);
14 WriteByte(MSG_ENTITY, self.cnt);
18 /*QUAKED spawnfunc_func_rain (0 .5 .8) ?
19 This is an invisible area like a trigger, which rain falls inside of.
23 falling direction (should be something like '0 0 -700', use the X and Y velocity for wind)
25 sets color of rain (default 12 - white)
27 adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
29 void spawnfunc_func_rain()
31 self.dest = self.velocity;
32 self.velocity = '0 0 0';
34 self.dest = '0 0 -700';
35 self.angles = '0 0 0';
36 self.movetype = MOVETYPE_NONE;
37 self.solid = SOLID_NOT;
38 SetBrushEntityModel();
43 self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024);
46 if(self.count > 65535)
49 self.state = 1; // 1 is rain, 0 is snow
52 Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
56 /*QUAKED spawnfunc_func_snow (0 .5 .8) ?
57 This is an invisible area like a trigger, which snow falls inside of.
61 falling direction (should be something like '0 0 -300', use the X and Y velocity for wind)
63 sets color of rain (default 12 - white)
65 adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
67 void spawnfunc_func_snow()
69 self.dest = self.velocity;
70 self.velocity = '0 0 0';
72 self.dest = '0 0 -300';
73 self.angles = '0 0 0';
74 self.movetype = MOVETYPE_NONE;
75 self.solid = SOLID_NOT;
76 SetBrushEntityModel();
81 self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024);
84 if(self.count > 65535)
87 self.state = 0; // 1 is rain, 0 is snow
90 Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
95 te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
100 te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
103 void Ent_RainOrSnow()
105 self.impulse = ReadByte(); // Rain, Snow, or Whatever
106 self.origin_x = ReadCoord();
107 self.origin_y = ReadCoord();
108 self.origin_z = ReadCoord();
109 self.maxs_x = ReadCoord();
110 self.maxs_y = ReadCoord();
111 self.maxs_z = ReadCoord();
112 self.velocity = decompressShortVector(ReadShort());
113 self.count = ReadShort() * 10;
114 self.glow_color = ReadByte(); // color
116 self.mins = -0.5 * self.maxs;
117 self.maxs = 0.5 * self.maxs;
118 self.origin = self.origin - self.mins;
120 setorigin(self, self.origin);
121 setsize(self, self.mins, self.maxs);
122 self.solid = SOLID_NOT;
124 self.draw = Draw_Rain;
126 self.draw = Draw_Snow;