2 .float lifetime, fadetime;
6 void ModelEffect_Draw()
8 self.angles = self.angles + frametime * self.avelocity;
9 setorigin(self, self.origin + frametime * self.velocity);
10 self.scale = self.scale1 + (self.scale2 - self.scale1) * (time - self.teleport_time) / (self.lifetime + self.fadetime - self.teleport_time);
11 self.alpha = self.cnt * bound(0, 1 - (time - self.lifetime) / self.fadetime, 1);
12 if(self.alpha < ALPHA_MIN_VISIBLE)
17 self.drawmask = MASK_NORMAL;
25 void Ent_ModelEffect(float isNew)
30 self.classname = "modeleffect_spawner";
35 e.classname = "modeleffect";
36 e.model = "from network";
37 e.modelindex = ReadShort();
41 e.origin_x = ReadCoord();
42 e.origin_y = ReadCoord();
43 e.origin_z = ReadCoord();
44 setorigin(e, e.origin);
47 e.velocity_x = ReadCoord();
48 e.velocity_y = ReadCoord();
49 e.velocity_z = ReadCoord();
53 e.angles_x = ReadAngle();
54 e.angles_y = ReadAngle();
55 e.angles_z = ReadAngle();
59 e.avelocity_x = ReadAngle();
60 e.avelocity_y = ReadAngle();
61 e.avelocity_z = ReadAngle();
63 e.scale1 = ReadShort() / 256.0;
64 e.scale2 = ReadShort() / 256.0;
65 e.lifetime = time + ReadByte() * 0.01;
66 e.fadetime = ReadByte() * 0.01;
67 e.teleport_time = time;
68 e.cnt = ReadByte() / 255.0; // actually alpha
70 e.draw = ModelEffect_Draw;
73 remove(e); // yes, this IS stupid, but I don't need to duplicate all the read* stuff then