X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fvore.qc;h=1df5d2f42b1ed3a8b83b791e01cd4316b6d1eb61;hp=ae7a55f27207965449f495499dab00b294856501;hb=72c62dd8d1c79bdec2e61175947d85063174cb4e;hpb=c57df944f03551c2b7a20ae651c5b48c02d845dd diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index ae7a55f2..1df5d2f4 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -35,9 +35,9 @@ float Swallow_condition_check(entity prey) { if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore")) { - if(time > self.complain_vore) + if(time > self.complain_vore && self.BUTTON_ATCK) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, "You cannot swallow your team mates\n"); self.complain_vore = time + complain_delay_time; } @@ -46,9 +46,9 @@ float Swallow_condition_check(entity prey) if(self.stomach_load >= cvar("g_balance_vore_swallow_limit")) { - if(time > self.complain_vore) + if(time > self.complain_vore && self.BUTTON_ATCK) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, strcat("You cannot swallow more than ^2", cvar_string("g_balance_vore_swallow_limit"), "^7 players at a time\n")); self.complain_vore = time + complain_delay_time; } @@ -58,9 +58,9 @@ float Swallow_condition_check(entity prey) if(cvar("g_vore_biggergut")) if(prey.stomach_load > self.stomach_load) { - if(time > self.complain_vore) + if(time > self.complain_vore && self.BUTTON_ATCK) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, "You cannot swallow someone with a bigger stomach than yours\n"); self.complain_vore = time + complain_delay_time; } @@ -72,6 +72,22 @@ float Swallow_condition_check(entity prey) return FALSE; } +float Stomach_TeamMates_check(entity pred) +{ + // checks if a player's stomach contains any team mates + + entity head; + if(teams_matter) + { + FOR_EACH_PLAYER(head) + { + if(head.predator == pred && head.team == pred.team) + return TRUE; + } + } + return FALSE; +} + float Vore_CanLeave() { if(self.predator.classname == "player") @@ -144,23 +160,14 @@ void Vore_AutoDigest(entity e) { // if the predator has the autodigest preference enabled, begin digesting new prey automatically - if not(cvar("g_vore_digestion")) + if(!cvar("g_vore_digestion") || e.digesting) return; - if not(e.cvar_cl_vore_autodigest) - return; - if(clienttype(e) != CLIENTTYPE_REAL) - return; // this feature is only for players - - entity head; - if(teams_matter) - { - FOR_EACH_PLAYER(head) - { - // never begin automatic digestion if we've swallowed a team mate - if(head.team == e.team) - return; - } - } + if(!e.cvar_cl_vore_autodigest || clienttype(e) != CLIENTTYPE_REAL) + return; // this feature is only for players, not bots + if(e.stomach_load > 1) + return; // don't start digestion if we already ate someone, as that means we manually disabled it after the first prey and want it off + if(Stomach_TeamMates_check(e)) + return; // never begin automatic digestion if we've swallowed a team mate e.digesting = TRUE; } @@ -194,8 +201,10 @@ void Vore_Swallow(entity e) if(teams_matter && e.team == e.predator.team) { - centerprint(e, "^3You have been swallowed by a team mate, don't kick!"); - centerprint(e.predator, "^3You have swallowed a team mate, use caution!"); + if(cvar("g_vore_kick")) + centerprint(e, "^3You have been swallowed by a team mate, don't kick!"); + if(cvar("g_vore_digestion")) + centerprint(e.predator, "^3You have swallowed a team mate, don't digest!"); } PlayerSound(e.predator, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND); @@ -277,7 +286,7 @@ void Vore_DeadPrey_Configure(entity e) e.aiment = e.fakepredator; // completely remove the dead body - e.alpha = -1; + e.modelindex = 0; } void Vore_DeadPrey_Detach(entity e) @@ -367,6 +376,13 @@ void Vore_Teamheal() { self.health += cvar("g_balance_vore_teamheal"); self.teamheal_step = time + steptime; + + // play beep sound when a team mate was healed to the maximum amount, to both the prey and the predator + if(self.health >= cvar("g_balance_vore_teamheal_stable")) + { + play2(self, "misc/beep.wav"); + play2(self.predator, "misc/beep.wav"); + } } } @@ -380,7 +396,8 @@ void Vore_StomachKick() float damage; damage = ceil(random() * (cvar("g_balance_vore_kick_damage_max") - cvar("g_balance_vore_kick_damage_min")) + cvar("g_balance_vore_kick_damage_min")); Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, v_forward * cvar("g_balance_vore_kick_force")); - sound(self.predator, CHAN_PROJECTILE, "weapons/stomachkick.ogg", VOL_BASE, ATTN_NORM); + sound(self.predator, CHAN_PROJECTILE, "weapons/stomachkick.wav", VOL_BASE, ATTN_NORM); + self.predator.punchangle_x -= self.predator.cvar_cl_vore_kick_punchangle; if(random() < cvar("g_balance_vore_kick_escapeprobability")) Vore_Regurgitate(self); @@ -397,12 +414,49 @@ void Vore_StomachLeave() Vore_Regurgitate(self); else if(time > self.complain_vore) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, strcat("You cannot get out of ", self.predator.netname, "\n")); self.complain_vore = time + complain_delay_time; } } +void Vore_AutoTaunt() +{ + // triggers ambient vore taunts, for both pred and prey + + float taunt_time; + + // predator taunts + if(self.stomach_load && !Stomach_TeamMates_check(self)) + { + if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played + { + taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min"); + SetAutoTaunt(self, time + taunt_time, TAUNTTYPE_VOREPRED); + } + } + else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED) + { + // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it + SetAutoTaunt(self, 0, 0); + } + + // prey taunts + if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team)) + { + if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played + { + taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min"); + SetAutoTaunt(self, time + taunt_time, TAUNTTYPE_VOREPREY); + } + } + else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY) + { + // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it + SetAutoTaunt(self, 0, 0); + } +} + void Vore() { // main vore code, this is where it all happens @@ -413,6 +467,8 @@ void Vore() return; } + Vore_AutoTaunt(); + // wash the goo away from players once they leave the stomach if(self.predator.classname != "player") if(stov(cvar_string("g_vore_regurgitatecolor_release"))) @@ -488,9 +544,20 @@ void Vore() prey = Swallow_player_check(); // attempt to swallow our new prey if we pressed the attack button, and there's any in range - if(self.BUTTON_ATCK) + self.stat_canswallow = 0; if(Swallow_condition_check(prey)) - Vore_Swallow(prey); + { + // canswallow stat, used by the HUD + if(teams_matter && prey.team == self.team) + self.stat_canswallow = 2; + else + self.stat_canswallow = 1; + + if(self.BUTTON_ATCK) + Vore_Swallow(prey); + } + else if(prey != world) + self.stat_canswallow = -1; // toggle digestion, if the player has someone in their stomach if(self.BUTTON_DIGEST && cvar("g_vore_digestion")) @@ -505,7 +572,7 @@ void Vore() } else if(time > self.complain_vore) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, "There is nothing to digest\n"); self.complain_vore = time + complain_delay_time; } @@ -527,7 +594,7 @@ void Vore() } else if(time > self.complain_vore) { - play2(self, "misc/unavailable.wav"); + play2(self, "misc/forbidden.wav"); sprint(self, "There is nothing to regurgitate\n"); self.complain_vore = time + complain_delay_time; }