9 WriteHeader(MSG_ENTITY, ENT_CLIENT_POINTPARTICLES);
12 sendflags = sendflags & 0x0F;
19 if(this.
mins !=
'0 0 0' || this.
maxs !=
'0 0 0')
32 WriteVector(MSG_ENTITY, this.
origin);
36 if(this.
model !=
"null")
41 WriteVector(MSG_ENTITY, this.
mins);
42 WriteVector(MSG_ENTITY, this.
maxs);
50 WriteVector(MSG_ENTITY, this.
maxs);
72 if(this.bgmscript !=
"")
83 void pointparticles_think(
entity this)
95 if(this.
model !=
"") { precache_model(this.
model); _setmodel(
this, this.
model); }
97 if(this.mdl !=
"") this.
cnt = 0;
99 if(!this.bgmscriptsustain) this.bgmscriptsustain = 1;
100 else if(this.bgmscriptsustain < 0) this.bgmscriptsustain = 0;
111 setsize(
this,
'0 0 0', this.
maxs - this.
mins);
114 this.setactive = generic_netlinked_setactive;
121 this.
use = generic_netlinked_legacy_use;
123 this.reset = generic_netlinked_reset;
125 setthink(
this, pointparticles_think);
142 this.mdl =
"TE_SPARK";
145 spawnfunc_func_pointparticles(
this);
164 const int ABSOLUTE_ONLY_SPAWN_AT_TOGGLE = 2;
166 void Draw_PointParticles(
entity this)
175 if(this.absolute == ABSOLUTE_ONLY_SPAWN_AT_TOGGLE)
178 n = this.just_toggled ? this.
impulse : 0;
185 if(this.just_toggled)
192 for(i =
random(); i <= n && fail <= 64*n; ++i)
208 eff_num = _particleeffectnum(this.mdl);
217 eff_num = _particleeffectnum(this.mdl);
225 this.just_toggled = 0;
227 else if(this.absolute)
236 void Ent_PointParticles_Remove(
entity this)
243 NET_HANDLE(ENT_CLIENT_POINTPARTICLES,
bool isnew)
247 int sendflags = ReadByte();
248 if(sendflags & SF_TRIGGER_UPDATE)
251 if(i && !this.
impulse && (this.
cnt || this.mdl))
252 this.just_toggled = 1;
255 if(sendflags & SF_TRIGGER_RESET)
257 this.
origin = ReadVector();
259 if(sendflags & SF_TRIGGER_INIT)
266 this.mins = ReadVector();
267 this.
maxs = ReadVector();
272 this.
maxs = ReadVector();
277 this.mins = this.
maxs =
'0 0 0';
280 this.
cnt = ReadShort();
283 if(sendflags & SF_POINTPARTICLES_MOVING)
292 if(sendflags & SF_POINTPARTICLES_JITTER_AND_COUNT)
295 this.
count = ReadByte() / 16.0;
305 this.
atten = ReadByte() / 64.0;
306 this.
volume = ReadByte() / 255.0;
309 if(this.bgmscript !=
"")
311 this.bgmscriptattack = ReadByte() / 64.0;
312 this.bgmscriptdecay = ReadByte() / 64.0;
313 this.bgmscriptsustain = ReadByte() / 255.0;
314 this.bgmscriptrelease = ReadByte() / 64.0;
321 if(sendflags & SF_TRIGGER_UPDATE)
323 this.absolute = (this.
impulse >= 0);
327 this.
impulse *= -v.x * v.y * v.z / (64**3);
332 this.absolute = ABSOLUTE_ONLY_SPAWN_AT_TOGGLE;
335 setsize(
this, this.mins, this.
maxs);
337 this.draw = Draw_PointParticles;
339 this.entremove = Ent_PointParticles_Remove;
float compressShortVector(vector vec)
#define REGISTER_NET_LINKED(id)
const int SF_TRIGGER_INIT
const int SF_POINTPARTICLES_JITTER_AND_COUNT
#define NET_HANDLE(id, param)
const int SF_POINTPARTICLES_BOUNDS
spawnfunc(info_player_attacker)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void BGMScript_InitEntity(entity e)
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
const int SF_TRIGGER_RESET
const int PARTICLES_IMPULSE
const int SF_POINTPARTICLES_MOVING
vector decompressShortVector(int data)
const int PARTICLES_VISCULLING
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define _sound(e, c, s, v, a)
vector trace_plane_normal
const int SF_POINTPARTICLES_IMPULSE
float doBGMScript(entity e)
IntrusiveList g_drawables
const int SF_TRIGGER_UPDATE