2 #include "../../dpdefs/csprogsdefs.qh"
3 #include "../../client/defs.qh"
5 #include "../buffs/all.qh"
6 #include "../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 "../turrets/sv_turrets.qh"
20 void healer_draw(entity this)
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_NET_LINKED(Nade_Heal, bool isNew)
60 this.origin_x = ReadCoord();
61 this.origin_y = ReadCoord();
62 this.origin_z = ReadCoord();
63 setorigin(this, this.origin);
64 this.healer_lifetime = ReadByte();
65 this.healer_radius = ReadShort();
66 this.ltime = time + ReadByte()/10.0;
67 // this.ltime = time + this.healer_lifetime;
74 bool healer_send(entity this, entity to, int sf)
76 int channel = MSG_ENTITY;
77 WriteHeader(channel, Nade_Heal);
78 WriteByte(channel, sf);
80 WriteCoord(channel, this.origin.x);
81 WriteCoord(channel, this.origin.y);
82 WriteCoord(channel, this.origin.z);
84 WriteByte(channel, this.healer_lifetime);
85 //WriteByte(MSG_ENTITY, this.ltime - time + 1);
86 WriteShort(channel, this.healer_radius);
87 // round time delta to a 1/10th of a second
88 WriteByte(channel, (this.ltime - time)*10.0+0.5);