]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Rename a particle effect
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 9a3d94124fd76037b5dc387b1882b1cae3d3351c..e47b06553a0be0af23502af82b28181c5ef4861d 100644 (file)
@@ -235,6 +235,7 @@ void Vore_SwallowModel_Update(entity prey, entity pred)
                // apply the properties of the prey\r
                prey.swallow_model.viewmodelforclient = prey; // use the same system as the weapon model\r
                //prey.swallow_model.effects |= EF_NOGUNBOB; // let it bob\r
+               prey.swallow_model.effects |= EF_NODEPTHTEST; // don't hide behind walls\r
                prey.swallow_model.colormap = prey.colormap; // pants and shirt color\r
                prey.swallow_model.glowmod = prey.glowmod; // glow color\r
 \r
@@ -294,6 +295,7 @@ void Vore_Swallow(entity e)
        e.predator.stomach_load += 1;\r
        e.predator.regurgitate_prepare = 0;\r
        e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
+       e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them\r
        Vore_WeightApply(e.predator);\r
        Vore_AutoDigest(e.predator);\r
 \r
@@ -367,9 +369,19 @@ void Vore_Regurgitate(entity e)
                Vore_SwallowModel_Update(e, e.predator);\r
        }\r
 \r
+       // apply regurgitation damage to the predator\r
+       if(cvar("g_balance_vore_regurgitate_damage"))\r
+       {\r
+               float regurgitate_dmg;\r
+               regurgitate_dmg = cvar("g_balance_vore_regurgitate_damage");\r
+               if(cvar("g_healthsize"))\r
+                       regurgitate_dmg *= e.scale / e.predator.scale;\r
+               Damage(e.predator, e.predator, e.predator, regurgitate_dmg, DEATH_REGURGITATION, e.predator.origin, '0 0 0');\r
+       }\r
+\r
        PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, 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
+       pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', 1);\r
        e.predator.punchangle_x += cvar("g_balance_vore_regurgitate_punchangle");\r
        e.predator.stomach_load -= 1;\r
        e.predator.regurgitate_prepare = 0;\r
@@ -518,11 +530,12 @@ void Vore_Teamheal()
        }\r
 }\r
 \r
+.float kick_pressed;\r
 void Vore_StomachKick()\r
 {\r
        // allows prey to kick the predator's stomach and do some damage or attempt to escape\r
 \r
-       if(time > self.stomachkick_delay)\r
+       if(time > self.stomachkick_delay && !self.kick_pressed)\r
        {\r
                float damage;\r
                vector force;\r
@@ -546,6 +559,9 @@ void Vore_StomachKick()
                        self.predator.regurgitate_prepare = 0;\r
 \r
                self.stomachkick_delay = time + cvar("g_balance_vore_kick_delay");\r
+               if(cvar("g_balance_vore_kick_repress"))\r
+               if not(clienttype(self) == CLIENTTYPE_BOT) // not for bots, to prevent an issue\r
+                       self.kick_pressed = TRUE;\r
        }\r
 }\r
 \r
@@ -644,12 +660,6 @@ void Vore()
 {\r
        // main vore code, this is where it all happens\r
 \r
-       if(!cvar("g_vore")) // the vore system is disabled\r
-       {\r
-               Vore_Disconnect();\r
-               return;\r
-       }\r
-\r
        Vore_AutoTaunt();\r
 \r
        // wash the goo away from players once they leave the stomach\r
@@ -729,6 +739,11 @@ void Vore()
        }\r
 \r
        // apply delays and skip the vore system under some circumstances\r
+       if(!cvar("g_vore")) // the vore system is disabled\r
+       {\r
+               Vore_Disconnect();\r
+               return;\r
+       }\r
        if(time < game_starttime || (time < warmup && !inWarmupStage)) // don't allow vore before a round begins\r
        {\r
                Vore_Disconnect();\r
@@ -847,8 +862,13 @@ void Vore()
                Vore_Teamheal();\r
 \r
        // execute prey commands\r
-       if(self.BUTTON_ATCK && cvar("g_vore_kick"))\r
-               Vore_StomachKick();\r
+       if(self.BUTTON_ATCK)\r
+       {\r
+               if(cvar("g_vore_kick"))\r
+                       Vore_StomachKick();\r
+       }\r
+       else\r
+               self.kick_pressed = FALSE;\r
        if(self.BUTTON_JUMP)\r
                Vore_StomachLeave();\r
 \r