From: MirceaKitsune Date: Tue, 3 May 2011 11:08:18 +0000 (+0300) Subject: Port respawn ghosts from Xonotic, original code by me. Makes dead bodies become float... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=192e41dd19d271c71e51df4b00377268e5babdd5;p=voretournament%2Fvoretournament.git Port respawn ghosts from Xonotic, original code by me. Makes dead bodies become floating ghosts if they are still whole and visible, once the player respawns. Effect only. --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 8368f0fe..f730511c 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -273,6 +273,10 @@ set g_telefrags 1 set g_telefrags_avoid 0 set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed" +set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns" +set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate" +set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would" + set sv_gibhealth 75 "Minus health a dead body must have in order to get gibbed" // fragmessage: This allows extra information to be displayed with the frag centerprints. diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 63ae5907..33790477 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1711,10 +1711,31 @@ void UpdateTeamBubble() else self.colormod = '1 1 1'; };*/ +.float oldcolormap; void respawn(void) { + if(self.alpha >= 0 && self.modelindex != 0 && cvar("g_respawn_ghosts")) + { + self.solid = SOLID_NOT; + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_FLY; + self.velocity = '0 0 1' * cvar("g_respawn_ghosts_speed"); + self.avelocity = randomvec() * cvar("g_respawn_ghosts_speed") * 3 - randomvec() * cvar("g_respawn_ghosts_speed") * 3; + self.effects |= EF_ADDITIVE; + self.oldcolormap = self.colormap; + self.colormap = 512; + pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1); + if(cvar("g_respawn_ghosts_maxtime")) + SUB_SetFade (self, time + cvar("g_respawn_ghosts_maxtime") / 2 + random () * (cvar("g_respawn_ghosts_maxtime") - cvar("g_respawn_ghosts_maxtime") / 2), 1.5); + } + CopyBody(1); self.effects |= EF_NODRAW; // prevent another CopyBody + if(self.oldcolormap) + { + self.colormap = self.oldcolormap; + self.oldcolormap = 0; + } PutClientInServer(); }