From: MirceaKitsune Date: Sun, 10 Jul 2011 21:29:31 +0000 (+0300) Subject: Also show the swallow model to a prey that's been regurgitated, if we give them swall... X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=8f7da4a470af58f701884ebfff8164f13fa1ab0b Also show the swallow model to a prey that's been regurgitated, if we give them swallow progress when that happens --- diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index b99e4c17..9f9dd765 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -222,7 +222,7 @@ void Vore_SwallowModel_Think() self.nextthink = time; } -void Vore_SwallowModel_Update(entity prey) +void Vore_SwallowModel_Update(entity prey, entity pred) { // if we don't have a swallow model already, spawn one if(!prey.swallow_model) @@ -245,15 +245,15 @@ void Vore_SwallowModel_Update(entity prey) // properties that should update whenever possible, but when the predator is available string player_swallowmodel; - player_swallowmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3"); // 4 is the extension length + player_swallowmodel = strcat(substring(pred.playermodel, 0, strlen(pred.playermodel) - 4), "_swallow.md3"); // 4 is the extension length if(prey.swallow_model.model != player_swallowmodel) // player model can be changed while the predator is active setmodel(prey.swallow_model, player_swallowmodel); - if(prey.swallow_model.skin != self.skin) // player skin can be changed while the predator is active - prey.swallow_model.skin = self.skin; + if(prey.swallow_model.skin != pred.skin) // player skin can be changed while the predator is active + prey.swallow_model.skin = pred.skin; if(cvar("g_healthsize")) - prey.swallow_model.scale = self.scale / prey.scale; // player size difference - if(prey.swallow_model.enemy != self) - prey.swallow_model.enemy = self; // enemy is the predator + prey.swallow_model.scale = pred.scale / prey.scale; // player size difference + if(prey.swallow_model.enemy != pred) + prey.swallow_model.enemy = pred; // enemy is the predator } .entity pusher; @@ -312,7 +312,7 @@ void Vore_SwallowStep(entity e) return; } - Vore_SwallowModel_Update(e); + Vore_SwallowModel_Update(e, self); // increase the progress value until it reaches 1, then swallow the player if(e.swallow_progress_prey < 1) @@ -361,8 +361,11 @@ void Vore_Regurgitate(entity e) e.pushltime = time + cvar("g_maxpushtime"); // regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable - if(cvar("g_balance_vore_swallow_speed_fill")) + if(cvar("g_balance_vore_swallow_speed_fill") && cvar("g_balance_vore_regurgitate_swallowprogress")) + { e.swallow_progress_prey = cvar("g_balance_vore_regurgitate_swallowprogress"); + Vore_SwallowModel_Update(e, e.predator); + } PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND); setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating