]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Older patch from the dev tracker ( http://dev.alientrap.org/issues/show/635 )
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 26 Apr 2010 22:12:02 +0000 (01:12 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 26 Apr 2010 22:12:02 +0000 (01:12 +0300)
Attempts to imitate UT2004-style respawn ghosts. When a dead player respawns, their last body becomes transparent and floats away.

defaultXonotic.cfg
effectinfo.txt
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc

index 0c44f8ef8a6a69c20a5ae2417fd8feac03305697..9f8855a23262e928a4277cbe0dd0e5906970497f 100644 (file)
@@ -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)"
index 2885afb563c834ae6f7a6203ca53c8783f1d93dc..7dfb6713439325289360315abe338136f2521f31 100644 (file)
@@ -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
index ef83ef63543c7dc1a77c1633be408fb5ba45a0c1..8a3fe88fd54ef39d6eb4de33f658417e57f7fba7 100644 (file)
@@ -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();
 }
 
index 8925f171340d0de0cbab5feb0076a9b3370aaa65..d5064bdbdc5a5324f117135b96b2d341e08a672f 100644 (file)
@@ -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;