2 #include "../../client/defs.qh"
4 #include "../buffs/all.qh"
5 #include "../movetypes/movetypes.qh"
6 #include "../../client/main.qh"
7 #include "../../lib/csqcmodel/cl_model.qh"
10 #include "../constants.qh"
11 #include "../../server/constants.qh"
12 #include "../turrets/sv_turrets.qh"
18 void healer_draw(entity this)
20 float dt = time - self.move_time;
21 self.move_time = time;
25 self.alpha = (self.ltime - time) / self.healer_lifetime;
26 self.scale = min((1 - self.alpha)*self.healer_lifetime*4,1)*self.healer_radius;
29 void healer_setup(entity e)
31 setmodel(e, MDL_NADE_HEAL);
33 setorigin(e, e.origin);
35 float model_radius = e.maxs.x;
36 vector size = '1 1 1' * e.healer_radius / 2;
37 setsize(e,-size,size);
38 e.healer_radius = e.healer_radius/model_radius*0.6;
42 e.movetype = MOVETYPE_NONE;
44 e.drawmask = MASK_NORMAL;
46 e.avelocity = e.move_avelocity = '7 0 11';
48 e.renderflags |= RF_ADDITIVE;
52 REGISTER_NET_LINKED(Nade_Heal, bool isNew)
55 Net_Accept(Nade_Heal);
58 this.origin_x = ReadCoord();
59 this.origin_y = ReadCoord();
60 this.origin_z = ReadCoord();
61 setorigin(this, this.origin);
62 this.healer_lifetime = ReadByte();
63 this.healer_radius = ReadShort();
64 this.ltime = time + ReadByte()/10.0;
65 // this.ltime = time + this.healer_lifetime;
72 bool healer_send(entity this, entity to, int sf)
74 int channel = MSG_ENTITY;
75 WriteHeader(channel, Nade_Heal);
76 WriteByte(channel, sf);
78 WriteCoord(channel, this.origin.x);
79 WriteCoord(channel, this.origin.y);
80 WriteCoord(channel, this.origin.z);
82 WriteByte(channel, this.healer_lifetime);
83 //WriteByte(MSG_ENTITY, this.ltime - time + 1);
84 WriteShort(channel, this.healer_radius);
85 // round time delta to a 1/10th of a second
86 WriteByte(channel, (this.ltime - time)*10.0+0.5);