2 #include "../dpdefs/csprogsdefs.qh"
3 #include "../client/defs.qh"
6 #include "../common/movetypes/movetypes.qh"
7 #include "../client/main.qh"
8 #include "../csqcmodellib/cl_model.qh"
11 #include "../dpdefs/progsdefs.qh"
12 #include "constants.qh"
13 #include "../server/constants.qh"
14 #include "../common/turrets/sv_turrets.qh"
22 float dt = time - self.move_time;
23 self.move_time = time;
27 self.alpha = (self.ltime - time) / self.healer_lifetime;
28 self.scale = min((1 - self.alpha)*self.healer_lifetime*4,1)*self.healer_radius;
31 void healer_setup(entity e)
33 setmodel(e, MDL_NADE_HEAL);
35 setorigin(e, e.origin);
37 float model_radius = e.maxs.x;
38 vector size = '1 1 1' * e.healer_radius / 2;
39 setsize(e,-size,size);
40 e.healer_radius = e.healer_radius/model_radius*0.6;
44 e.movetype = MOVETYPE_NONE;
46 e.drawmask = MASK_NORMAL;
48 e.avelocity = e.move_avelocity = '7 0 11';
50 e.renderflags |= RF_ADDITIVE;
54 REGISTER_LINKED(Nade_Heal, bool isNew)
59 this.origin_x = ReadCoord();
60 this.origin_y = ReadCoord();
61 this.origin_z = ReadCoord();
62 setorigin(this, this.origin);
63 this.healer_lifetime = ReadByte();
64 this.healer_radius = ReadShort();
65 this.ltime = time + ReadByte()/10.0;
66 // this.ltime = time + this.healer_lifetime;
73 float healer_send(entity to, int sf)
76 WriteByte(MSG_ENTITY, Linked_Nade_Heal.m_id);
77 WriteByte(MSG_ENTITY, sf);
79 WriteCoord(MSG_ENTITY, this.origin.x);
80 WriteCoord(MSG_ENTITY, this.origin.y);
81 WriteCoord(MSG_ENTITY, this.origin.z);
83 WriteByte(MSG_ENTITY, this.healer_lifetime);
84 //WriteByte(MSG_ENTITY, this.ltime - time + 1);
85 WriteShort(MSG_ENTITY, this.healer_radius);
86 // round time delta to a 1/10th of a second
87 WriteByte(MSG_ENTITY, (this.ltime - time)*10.0+0.5);