eater -> predator, because that's a more correct word
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 48cfd3f6539ad09fddf76812ecd7ed6d23885fc6..9526959b3a0dde452bc5302ee8943be3b3d02663 100644 (file)
@@ -25,8 +25,8 @@ entity Swallow_distance_check()
 float Swallow_condition_check(entity prey)\r
 {\r
        // checks the necessary conditions for swallowing another player\r
-       if(prey.classname == "player" && prey.eater.classname != "player" && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
-       if(self.classname == "player" && self.eater.classname != "player" && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
+       if(prey.classname == "player" && prey.predator.classname != "player" && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
+       if(self.classname == "player" && self.predator.classname != "player" && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
        if not(vlen(self.velocity) > cvar("g_balance_vore_regurgitate_velocitylimit"))\r
        {\r
                if(self.stomach_load >= cvar("g_balance_vore_swallow_limit"))\r
@@ -58,7 +58,7 @@ float Swallow_condition_check(entity prey)
 \r
 float Vore_PreyCanLeave()\r
 {\r
-       if(teams_matter && self.team == self.eater.team)\r
+       if(teams_matter && self.team == self.predator.team)\r
                return TRUE;\r
        return FALSE;\r
 }\r
@@ -73,7 +73,7 @@ void Vore_CameraEffect_Set(entity e)
 }\r
 void Vore_CameraEffect_Apply()\r
 {\r
-       if(self.eater.classname != "player")\r
+       if(self.predator.classname != "player")\r
                return;\r
 \r
        if(self.cvar_cl_vore_cameraspeed)\r
@@ -113,40 +113,40 @@ void Vore_Swallow(entity e)
        e.vore_oldsolid = e.solid;\r
        e.vore_oldview_ofs_z = e.view_ofs_z;\r
 \r
-       e.eater = self;\r
-       setorigin(e, e.eater.origin);\r
+       e.predator = self;\r
+       setorigin(e, e.predator.origin);\r
        e.velocity = '0 0 0';\r
        e.movetype = MOVETYPE_FOLLOW;\r
        e.solid = SOLID_NOT;\r
        e.alpha = -1; // best way of hiding / showing the eaten player\r
-       e.aiment = e.eater; // follow the predator. Is automatically unset\r
+       e.aiment = e.predator; // follow the predator. Is automatically unset\r
 \r
        // drop keys (KH) and flags (CTF) when we get swallowed\r
        kh_Key_DropAll(e, FALSE);\r
        if(e.flagcarried)\r
-               DropFlag(e.flagcarried, world, e.eater);\r
+               DropFlag(e.flagcarried, world, e.predator);\r
 \r
        Vore_CameraEffect_Set(e);\r
 \r
        if(stov(cvar_string("g_vore_regurgitatecolor_released")))\r
                e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released"));\r
 \r
-       if(e.team == e.eater.team && teamplay)\r
+       if(e.team == e.predator.team && teamplay)\r
        {\r
                centerprint(e, "^3You have been swallowed by a team mate, don't kick!");\r
-               centerprint(e.eater, "^3You have swallowed a team mate, use caution!");\r
+               centerprint(e.predator, "^3You have swallowed a team mate, use caution!");\r
        }\r
 \r
-       PlayerSound(e.eater, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
-       setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
-       e.eater.stomach_load += 1;\r
-       e.eater.regurgitate_prepare = 0;\r
-       Vore_Weight_apply(e.eater);\r
+       PlayerSound(e.predator, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
+       setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
+       e.predator.stomach_load += 1;\r
+       e.predator.regurgitate_prepare = 0;\r
+       Vore_Weight_apply(e.predator);\r
 \r
        // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow\r
-       e.eater.weapon_delay = time + button_delay;\r
-       e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
-       e.system_delay = e.eater.system_delay = time + system_delay_time;\r
+       e.predator.weapon_delay = time + button_delay;\r
+       e.predator.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
+       e.system_delay = e.predator.system_delay = time + system_delay_time;\r
 }\r
 \r
 void Vore_Regurgitate(entity e)\r
@@ -163,28 +163,28 @@ void Vore_Regurgitate(entity e)
        oldforward = v_forward;\r
        oldright = v_right;\r
        oldup = v_up;\r
-       makevectors(e.eater.v_angle);\r
+       makevectors(e.predator.v_angle);\r
        e.velocity = v_forward * cvar("g_balance_vore_regurgitate_force");\r
-       e.eater.velocity += -v_forward * cvar("g_balance_vore_regurgitate_eaterforce");\r
+       e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_eaterforce");\r
        v_forward = oldforward;\r
        v_right = oldright;\r
        v_up = oldup;\r
 \r
-       e.pusher = e.eater; // so we can frag players by regurgitating them in deadly pits\r
+       e.pusher = e.predator; // so we can frag players by regurgitating them in deadly pits\r
        e.pushltime = time + cvar("g_maxpushtime");\r
 \r
-       PlayerSound(e.eater, playersound_regurgitate, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
-       setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
-       pointparticles(particleeffectnum("regurgitate"), e.eater.origin, '0 0 0', 1);\r
-       e.eater.stomach_load -= 1;\r
-       e.eater.regurgitate_prepare = 0;\r
-       e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
-       Vore_Weight_apply(e.eater);\r
+       PlayerSound(e.predator, playersound_regurgitate, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
+       setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
+       pointparticles(particleeffectnum("regurgitate"), e.predator.origin, '0 0 0', 1);\r
+       e.predator.stomach_load -= 1;\r
+       e.predator.regurgitate_prepare = 0;\r
+       e.predator.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
+       Vore_Weight_apply(e.predator);\r
 \r
        // block firing for a small amount of time when getting regurgitated, or we'll be firing the next frame\r
        e.weapon_delay = time + button_delay;\r
-       e.system_delay = e.eater.system_delay = time + system_delay_time;\r
-       e.eater = world;\r
+       e.system_delay = e.predator.system_delay = time + system_delay_time;\r
+       e.predator = world;\r
 }\r
 \r
 void Vore_Gurglesound();\r
@@ -193,12 +193,12 @@ void Vore_Disconnect()
        // frees prey from their predators when someone disconnects or goes spectating\r
 \r
        // prey disconnects or goes spectating while inside someone's belly:\r
-       if(self.eater.classname == "player")\r
+       if(self.predator.classname == "player")\r
        {\r
                self.view_ofs_z = self.vore_oldview_ofs_z;\r
-               self.eater.stomach_load -= 1;\r
-               Vore_Weight_apply(self.eater);\r
-               self.eater = world;\r
+               self.predator.stomach_load -= 1;\r
+               Vore_Weight_apply(self.predator);\r
+               self.predator = world;\r
        }\r
 \r
        // pred disconnects or goes spectating with players in their belly:\r
@@ -207,7 +207,7 @@ void Vore_Disconnect()
                entity head;\r
                FOR_EACH_PLAYER(head)\r
                {\r
-                       if(head.eater == self)\r
+                       if(head.predator == self)\r
                                Vore_Regurgitate(head);\r
                }\r
                Vore_Gurglesound(); // stop the gurgling sound\r
@@ -218,18 +218,18 @@ void Vore_Disconnect()
 void Vore_Digest()\r
 {\r
        // apply digestion to prey\r
-       if(time > self.eater.digestion_step + steptime)\r
+       if(time > self.predator.digestion_step + steptime)\r
        {\r
-               Damage(self, self.eater, self.eater, cvar("g_balance_vore_digestion_damage"), DEATH_DIGESTION, self.origin, '0 0 0');\r
-               if(cvar("g_balance_vore_digestion_vampire") && self.eater.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
-                       self.eater.health += cvar("g_balance_vore_digestion_vampire");\r
+               Damage(self, self.predator, self.predator, cvar("g_balance_vore_digestion_damage"), DEATH_DIGESTION, self.origin, '0 0 0');\r
+               if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
+                       self.predator.health += cvar("g_balance_vore_digestion_vampire");\r
 \r
-               if (self.eater.digestsound_finished < time)\r
+               if (self.predator.digestsound_finished < time)\r
                {\r
-                       self.eater.digestsound_finished = time + 0.5;\r
-                       PlayerSound (self.eater, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);\r
+                       self.predator.digestsound_finished = time + 0.5;\r
+                       PlayerSound (self.predator, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);\r
                }\r
-               self.eater.digestion_step = time;\r
+               self.predator.digestion_step = time;\r
        }\r
 \r
        if(self.health <= 0)\r
@@ -252,15 +252,15 @@ void Vore_Teamheal()
 void Vore_StomachKick()\r
 {\r
        // allows prey to kick the predator's stomach and do some damage or attempt to escape\r
-       if(self.eater.classname != "player")\r
+       if(self.predator.classname != "player")\r
                return;\r
 \r
        if(time > self.stomachkick_delay)\r
        {\r
                float damage;\r
                damage = ceil(random() * (cvar("g_balance_vore_kick_damage_max") - cvar("g_balance_vore_kick_damage_min")) + cvar("g_balance_vore_kick_damage_min"));\r
-               Damage(self.eater, self, self, damage, DEATH_STOMACHKICK, self.eater.origin, '0 0 0');\r
-               sound(self.eater, CHAN_PROJECTILE, "weapons/stomachkick.ogg", VOL_BASE, ATTN_NORM);\r
+               Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, '0 0 0');\r
+               sound(self.predator, CHAN_PROJECTILE, "weapons/stomachkick.ogg", VOL_BASE, ATTN_NORM);\r
 \r
                if(cvar("g_balance_vore_kick_escapeprobability") >= random())\r
                        Vore_Regurgitate(self);\r
@@ -278,7 +278,7 @@ void Vore_StomachLeave()
        else if(time > self.complain_swallow)\r
        {\r
                play2(self, "weapons/unavailable.wav");\r
-               sprint(self, strcat("You cannot get out of ", self.eater.netname, "\n"));\r
+               sprint(self, strcat("You cannot get out of ", self.predator.netname, "\n"));\r
                self.complain_swallow = time + complain_delay;\r
        }\r
 }\r
@@ -298,11 +298,11 @@ void Vore_Gurglesound()
 void Vore()\r
 {\r
        // if we are free, show our stomach load on the HUD. Otherwise, show the predator's\r
-       if(self.eater.classname == "player")\r
+       if(self.predator.classname == "player")\r
        {\r
-               self.stat_stomachload = self.eater.stomach_load;\r
-               self.stat_digesting = self.eater.digesting;\r
-               self.stat_eaten = num_for_edict(self.eater);\r
+               self.stat_stomachload = self.predator.stomach_load;\r
+               self.stat_digesting = self.predator.digesting;\r
+               self.stat_eaten = num_for_edict(self.predator);\r
        }\r
        else\r
        {\r
@@ -382,40 +382,40 @@ void Vore()
 // Code that addresses the prey:\r
 // --------------------------------\r
 \r
-       if(self.eater.classname != "player")\r
+       if(self.predator.classname != "player")\r
                return;\r
 \r
-       if(self.eater.deadflag || self.deadflag)\r
+       if(self.predator.deadflag || self.deadflag)\r
                Vore_Regurgitate(self);\r
-       else if(self.eater.eater.classname == "player") // don't allow a player inside a player inside another player :)\r
+       else if(self.predator.predator.classname == "player") // don't allow a player inside a player inside another player :)\r
        {\r
-               entity targeteater, oldself;\r
-               targeteater = self.eater.eater;\r
+               entity target_predator, oldself;\r
+               target_predator = self.predator.predator;\r
 \r
                Vore_Regurgitate(self);\r
                if(random() < cvar("g_vore_stealprey"))\r
                if(Swallow_condition_check(self))\r
                {\r
                        oldself = self;\r
-                       self = targeteater;\r
+                       self = target_predator;\r
                        Vore_Swallow(oldself);\r
                        self = oldself;\r
                }\r
        }\r
-       else if(vlen(self.eater.velocity) > cvar("g_balance_vore_regurgitate_velocitylimit"))\r
+       else if(vlen(self.predator.velocity) > cvar("g_balance_vore_regurgitate_velocitylimit"))\r
                Vore_Regurgitate(self);\r
 \r
        // apply delayed regurgitating\r
-       if(self.eater.regurgitate_prepare && time > self.eater.regurgitate_prepare)\r
+       if(self.predator.regurgitate_prepare && time > self.predator.regurgitate_prepare)\r
        {\r
-               self.eater.regurgitate_prepare = 0;\r
-               self.eater.complain_swallow = time + complain_delay;\r
+               self.predator.regurgitate_prepare = 0;\r
+               self.predator.complain_swallow = time + complain_delay;\r
                Vore_Regurgitate(self);\r
        }\r
 \r
-       if(self.eater.digesting == TRUE)\r
+       if(self.predator.digesting == TRUE)\r
                Vore_Digest();\r
-       if(teams_matter && self.team == self.eater.team)\r
+       if(teams_matter && self.team == self.predator.team)\r
                Vore_Teamheal();\r
 \r
        if(self.BUTTON_ATCK)\r