X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fnades%2Fnet.qc;h=af320d9c15555c866f30505e72dee4d0c41c237a;hp=072f5072f58bdf86a7734119f1e86605666ca73a;hb=41e3520cfef3b385f744db4f169c45c7dd1b71fb;hpb=5a935f5c767deb9151a2e7b4f2bc190766190ab7 diff --git a/qcsrc/common/mutators/mutator/nades/net.qc b/qcsrc/common/mutators/mutator/nades/net.qc index 072f5072f..af320d9c1 100644 --- a/qcsrc/common/mutators/mutator/nades/net.qc +++ b/qcsrc/common/mutators/mutator/nades/net.qc @@ -4,76 +4,84 @@ #ifdef CSQC .float ltime; -void healer_draw(entity this) +void orb_draw(entity this) { - float dt = time - self.move_time; - self.move_time = time; + float dt = time - this.move_time; + this.move_time = time; if(dt <= 0) return; - self.alpha = (self.ltime - time) / self.healer_lifetime; - self.scale = min((1 - self.alpha)*self.healer_lifetime*4,1)*self.healer_radius; + this.alpha = (this.ltime - time) / this.orb_lifetime; + this.scale = min((1 - this.alpha)*this.orb_lifetime*4,1)*this.orb_radius; + this.angles = this.angles + dt * this.avelocity; } -void healer_setup(entity e) +void orb_setup(entity e) { - setmodel(e, MDL_NADE_HEAL); + setmodel(e, MDL_NADE_ORB); + e.skin = 1; setorigin(e, e.origin); float model_radius = e.maxs.x; - vector size = '1 1 1' * e.healer_radius / 2; + vector size = '1 1 1' * e.orb_radius / 2; setsize(e,-size,size); - e.healer_radius = e.healer_radius/model_radius*0.6; + e.orb_radius = e.orb_radius/model_radius*0.6; - e.draw = healer_draw; + e.draw = orb_draw; e.health = 255; e.movetype = MOVETYPE_NONE; e.solid = SOLID_NOT; e.drawmask = MASK_NORMAL; e.scale = 0.01; e.avelocity = e.move_avelocity = '7 0 11'; - e.colormod = '1 0 0'; e.renderflags |= RF_ADDITIVE; } #endif -REGISTER_NET_LINKED(Nade_Heal) +REGISTER_NET_LINKED(Nade_Orb) #ifdef CSQC -NET_HANDLE(Nade_Heal, bool isNew) +NET_HANDLE(Nade_Orb, bool isNew) { - Net_Accept(Nade_Heal); + Net_Accept(Nade_Orb); int sf = ReadByte(); if (sf & 1) { this.origin_x = ReadCoord(); this.origin_y = ReadCoord(); this.origin_z = ReadCoord(); setorigin(this, this.origin); - this.healer_lifetime = ReadByte(); - this.healer_radius = ReadShort(); + this.colormod_x = ReadCoord(); + this.colormod_y = ReadCoord(); + this.colormod_z = ReadCoord(); + this.orb_lifetime = ReadByte(); + this.orb_radius = ReadShort(); this.ltime = time + ReadByte()/10.0; - // this.ltime = time + this.healer_lifetime; - healer_setup(this); + // this.ltime = time + this.orb_lifetime; + orb_setup(this); } return true; } #endif #ifdef SVQC -bool healer_send(entity this, entity to, int sf) +bool orb_send(entity this, entity to, int sf) { int channel = MSG_ENTITY; - WriteHeader(channel, Nade_Heal); + WriteHeader(channel, Nade_Orb); WriteByte(channel, sf); if (sf & 1) { WriteCoord(channel, this.origin.x); WriteCoord(channel, this.origin.y); WriteCoord(channel, this.origin.z); - WriteByte(channel, this.healer_lifetime); + WriteCoord(channel, this.colormod.x); + WriteCoord(channel, this.colormod.y); + WriteCoord(channel, this.colormod.z); + + WriteByte(channel, this.orb_lifetime); //WriteByte(MSG_ENTITY, this.ltime - time + 1); - WriteShort(channel, this.healer_radius); + WriteShort(channel, this.orb_radius); // round time delta to a 1/10th of a second WriteByte(channel, (this.ltime - time)*10.0+0.5); }