From 84cbc40e52e9af30f9af69f9848f46bcf0571264 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 27 Apr 2010 01:12:02 +0300 Subject: [PATCH] Older patch from the dev tracker ( http://dev.alientrap.org/issues/show/635 ) Attempts to imitate UT2004-style respawn ghosts. When a dead player respawns, their last body becomes transparent and floats away. --- defaultXonotic.cfg | 4 ++++ effectinfo.txt | 14 ++++++++++++++ qcsrc/server/cl_client.qc | 21 +++++++++++++++++++++ qcsrc/server/cl_player.qc | 2 +- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 0c44f8ef8..9f8855a23 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -311,6 +311,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" + // fragmessage: This allows extra information to be displayed with the frag centerprints. set sv_fragmessage_information_ping 0 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)" set sv_fragmessage_information_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)" diff --git a/effectinfo.txt b/effectinfo.txt index 2885afb56..7dfb67134 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -4630,3 +4630,17 @@ originjitter 10 10 10 velocitymultiplier 20 velocityoffset 0 0 10 airfriction 1 + +// effect for respawn ghosts +// used in qcsrc/server/cl_client.qc: pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1) +effect respawn_ghost +count 75 +type static +color 0xA0A0A0 0xFFFFFF +size 2 2 +alpha 32 64 128 +airfriction 1 +liquidfriction 4 +originoffset 0 0 -8 +originjitter 28 28 16 +velocityjitter 0 0 256 \ No newline at end of file diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index ef83ef635..8a3fe88fd 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1748,10 +1748,31 @@ void UpdateTeamBubble() else self.colormod = '1 1 1'; };*/ +.float oldcolormap; void respawn(void) { + if(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(); } diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 8925f1713..d5064bdbd 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -412,7 +412,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.dmg_take = self.dmg_take + take;//max(take - 10, 0); self.dmg_inflictor = inflictor; - if (self.health <= -75 && self.modelindex != 0) + if (self.health <= -100 && self.modelindex != 0) { // don't use any animations as a gib self.frame = 0; -- 2.39.2