]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Some major changes to fake prey and the way prey is hidden. Fixes a bug and might...
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index b2fa9e6077cdcf1c8298a55a2e83c40d24a207cb..eb9ab112b0e0ee53d02e6e9fbce9002108dbdaed 100644 (file)
@@ -129,7 +129,7 @@ void Vore_CameraEffect_Set(entity e)
 }\r
 void Vore_CameraEffect_Apply()\r
 {\r
-       if not(self.predator.classname == "player" || self.fakeprey)\r
+       if not(self.predator.classname == "player" || self.fakeprey > 1)\r
                return;\r
 \r
        if(self.cvar_cl_vore_cameraspeed)\r
@@ -151,7 +151,7 @@ void Vore_CameraEffect_Apply()
        self.view_ofs_z = PL_PREY_VIEW_OFS_z / self.cameraeffect_current;\r
 \r
        float prey_height;\r
-       if(self.fakeprey)\r
+       if(self.fakeprey > 1)\r
                prey_height = (self.scale - self.fakepredator.scale) * cvar("g_healthsize_vore_pos");\r
        else\r
                prey_height = (self.scale - self.predator.scale) * cvar("g_healthsize_vore_pos");\r
@@ -212,7 +212,6 @@ void Vore_Swallow(entity e)
        e.velocity = '0 0 0';\r
        e.movetype = MOVETYPE_FOLLOW;\r
        e.solid = SOLID_NOT;\r
-       e.alpha = -1; // best way of hiding the eaten player\r
        e.aiment = e.predator; // follow the predator, automatically unset when regurgitated\r
 \r
        // drop keys (KH) and flags (CTF) when we get swallowed\r
@@ -256,7 +255,6 @@ void Vore_Regurgitate(entity e)
        if(e.health > 0) // leave SOLID_NOT for dead bodies\r
                e.solid = e.vore_oldsolid;\r
        e.view_ofs_z = PL_VIEW_OFS_z;\r
-       e.alpha = default_player_alpha;\r
 \r
        // apply velocities\r
        local vector oldforward, oldright, oldup;\r
@@ -297,7 +295,7 @@ void Vore_DeadPrey_Configure(entity e)
 \r
        // this entity is like e.predator but for dead prey, to avoid conflicts\r
        e.fakepredator = e.predator;\r
-       e.fakeprey = TRUE;\r
+       e.fakeprey = 2; // is fakeprey in a stomach\r
 \r
        // first release the prey from the predator, as dead prey needs to be attached differently\r
        // the predator's stomach load is also decreased, as dead prey doesn't count any more\r
@@ -310,9 +308,6 @@ void Vore_DeadPrey_Configure(entity e)
        e.takedamage = DAMAGE_NO;\r
        e.solid = SOLID_NOT;\r
        e.aiment = e.fakepredator;\r
-\r
-       // completely remove the dead body\r
-       e.modelindex = 0;\r
 }\r
 \r
 void Vore_DeadPrey_Detach(entity e)\r
@@ -324,7 +319,7 @@ void Vore_DeadPrey_Detach(entity e)
                return;\r
 \r
        e.fakepredator = world;\r
-       e.fakeprey = FALSE;\r
+       e.fakeprey = 1; // was fakeprey but is now detached\r
        e.aiment = world;\r
        e.movetype = MOVETYPE_TOSS;\r
 }\r
@@ -333,7 +328,7 @@ void Vore_PreyRelease(entity e, float pred_disconnect)
 {\r
        if(pred_disconnect)\r
        {\r
-               if(e.fakeprey)\r
+               if(e.fakeprey > 1)\r
                        Vore_DeadPrey_Detach(e);\r
                else\r
                        Vore_Regurgitate(e);\r
@@ -515,7 +510,7 @@ void Vore()
        }\r
 \r
        // set all vore stats\r
-       if(self.fakeprey)\r
+       if(self.fakeprey > 1)\r
                self.stat_eaten = num_for_edict(self.fakepredator);\r
        else if(self.predator.classname == "player")\r
        {\r