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