2 .float lifetime, fadetime;
\r
3 .float teleport_time;
\r
4 .float scale1, scale2;
\r
6 void ModelEffect_Draw()
\r
8 self.angles = self.angles + frametime * self.avelocity;
\r
9 self.origin = self.origin + frametime * self.velocity;
\r
10 self.scale = self.scale1 + (self.scale2 - self.scale1) * (time - self.teleport_time) / (self.lifetime + self.fadetime - self.teleport_time);
\r
11 self.alpha = self.cnt * bound(0, 1 - (time - self.lifetime) / self.fadetime, 1);
\r
12 if(self.alpha < ALPHA_MIN_VISIBLE)
\r
22 void Ent_ModelEffect(float isNew)
\r
27 self.classname = "modeleffect_spawner";
\r
32 e.classname = "modeleffect";
\r
33 e.model = "from network";
\r
34 e.modelindex = ReadShort();
\r
35 e.skin = ReadByte();
\r
36 e.frame = ReadByte();
\r
37 e.frame1time = time;
\r
38 e.origin_x = ReadCoord();
\r
39 e.origin_y = ReadCoord();
\r
40 e.origin_z = ReadCoord();
\r
43 e.velocity_x = ReadCoord();
\r
44 e.velocity_y = ReadCoord();
\r
45 e.velocity_z = ReadCoord();
\r
49 e.angles_x = ReadAngle();
\r
50 e.angles_y = ReadAngle();
\r
51 e.angles_z = ReadAngle();
\r
55 e.avelocity_x = ReadAngle();
\r
56 e.avelocity_y = ReadAngle();
\r
57 e.avelocity_z = ReadAngle();
\r
59 e.scale1 = ReadShort() / 256.0;
\r
60 e.scale2 = ReadShort() / 256.0;
\r
61 e.lifetime = time + ReadByte() * 0.01;
\r
62 e.fadetime = ReadByte() * 0.01;
\r
63 e.teleport_time = time;
\r
64 e.cnt = ReadByte() / 255.0; // actually alpha
\r
66 e.draw = ModelEffect_Draw;
\r
69 remove(e); // yes, this IS stupid, but I don't need to duplicate all the read* stuff then
\r