7 void healer_draw(entity this)
9 float dt = time - this.move_time;
10 this.move_time = time;
14 this.alpha = (this.ltime - time) / this.healer_lifetime;
15 this.scale = min((1 - this.alpha)*this.healer_lifetime*4,1)*this.healer_radius;
18 void healer_setup(entity e)
20 setmodel(e, MDL_NADE_HEAL);
22 setorigin(e, e.origin);
24 float model_radius = e.maxs.x;
25 vector size = '1 1 1' * e.healer_radius / 2;
26 setsize(e,-size,size);
27 e.healer_radius = e.healer_radius/model_radius*0.6;
31 e.movetype = MOVETYPE_NONE;
33 e.drawmask = MASK_NORMAL;
35 e.avelocity = e.move_avelocity = '7 0 11';
37 e.renderflags |= RF_ADDITIVE;
41 REGISTER_NET_LINKED(Nade_Heal)
44 NET_HANDLE(Nade_Heal, bool isNew)
46 Net_Accept(Nade_Heal);
49 this.origin_x = ReadCoord();
50 this.origin_y = ReadCoord();
51 this.origin_z = ReadCoord();
52 setorigin(this, this.origin);
53 this.healer_lifetime = ReadByte();
54 this.healer_radius = ReadShort();
55 this.ltime = time + ReadByte()/10.0;
56 // this.ltime = time + this.healer_lifetime;
64 bool healer_send(entity this, entity to, int sf)
66 int channel = MSG_ENTITY;
67 WriteHeader(channel, Nade_Heal);
68 WriteByte(channel, sf);
70 WriteCoord(channel, this.origin.x);
71 WriteCoord(channel, this.origin.y);
72 WriteCoord(channel, this.origin.z);
74 WriteByte(channel, this.healer_lifetime);
75 //WriteByte(MSG_ENTITY, this.ltime - time + 1);
76 WriteShort(channel, this.healer_radius);
77 // round time delta to a 1/10th of a second
78 WriteByte(channel, (this.ltime - time)*10.0+0.5);