X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fvore.qc;h=accf701d4c1ac7bf2ee75c10fedb05fb8c3f463c;hb=691f0d5f85783262222fb8dfc36ad274c7333a66;hp=678aa9015bd850ebf125972437b5ca570a0592af;hpb=f55f300d90edcce5e8724867c26b05020b1cd830;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 678aa901..accf701d 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -5,7 +5,6 @@ const float system_delay_time = 0.1; const float complain_delay_time = 1; const float button_delay_time = 0.5; -const float steptime = 0.1; entity Swallow_player_check() { @@ -138,7 +137,7 @@ void Vore_SetPreyPositions(entity pred) .float gurgle_oldstomachload; void Vore_GurgleSound() { - if(time > self.gurglesound_finished || self.gurgle_oldstomachload != self.stomach_load) + if(time > self.gurglesound_finished || (self.gurgle_oldstomachload != self.stomach_load && !self.digesting)) { GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE); @@ -161,7 +160,7 @@ void Vore_StomachLoad_Apply() self.stomach_maxload = cvar("g_balance_vore_load_pred_capacity"); if(cvar("g_healthsize")) self.stomach_maxload *= self.scale; - self.stomach_maxload = floor(self.stomach_maxload); + self.stomach_maxload = ceil(self.stomach_maxload); self.stomach_load = 0; // start from zero FOR_EACH_PLAYER(e) @@ -171,13 +170,13 @@ void Vore_StomachLoad_Apply() prey_mass = cvar("g_balance_vore_load_prey_mass"); if(cvar("g_healthsize")) prey_mass *= e.scale; - self.stomach_load += floor(prey_mass); + self.stomach_load += ceil(prey_mass); } } for(e = world; (e = find(e, classname, "consumable")); ) { if(e.predator == self) - self.stomach_load += floor(e.dmg); + self.stomach_load += ceil(e.dmg); } // apply weight @@ -430,9 +429,9 @@ void Vore_Disconnect() if(head.predator == self) Vore_Regurgitate(head); } - Vore_GurgleSound(); // stop the gurgling sound self.stomach_load = self.gravity = 0; // prevents a bug + Vore_GurgleSound(); // stop the gurgling sound } .float digestion_step; @@ -455,25 +454,22 @@ void Vore_Digest() damage_offset = 1; if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage - damage_offset *= self.predator.stomach_load / self.predator.stomach_maxload; + damage_offset /= self.predator.stomach_load / self.predator.stomach_maxload; if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff")) // apply player scale to digestion damage damage_offset *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_digestion_scalediff")); - damage_offset = ceil(damage_offset); - damage = cvar("g_balance_vore_digestion_damage") / damage_offset; + damage = ceil(cvar("g_balance_vore_digestion_damage") / damage_offset); if(cvar("g_balance_vore_digestion_damage_death") && self.deadflag != DEAD_NO) // amplify digestion damage for dead prey damage *= cvar("g_balance_vore_digestion_damage_death"); Damage(self, self.predator, self.predator, damage, DEATH_DIGESTION, self.origin, '0 0 0'); if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable")) - self.predator.health += damage * cvar("g_balance_vore_digestion_vampire"); - - if (self.predator.digestsound_finished < time) { - PlayerSound (self.predator, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); - self.predator.digestsound_finished = time + 0.5; + self.predator.health += damage * cvar("g_balance_vore_digestion_vampire"); + self.predator.pauserothealth_finished = max(self.predator.pauserothealth_finished, time + cvar("g_balance_pause_health_rot")); } - self.digestion_step = time + steptime; + + self.digestion_step = time + vore_steptime; } if(stov(cvar_string("g_vore_regurgitatecolor_color_digest"))) @@ -492,7 +488,7 @@ void Vore_Teamheal() if(time > self.teamheal_step) { self.health += cvar("g_balance_vore_teamheal"); - self.teamheal_step = time + steptime; + self.teamheal_step = time + vore_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")) @@ -700,26 +696,8 @@ void Vore() // prevent this by checking if such has happened, and taking the proper measures // this code has a high priority and must not be stopped by any delay, so run it here if(self.predator.stat_eaten) - { - entity target_predator, target_predator_predator, oldself; - target_predator = self.predator; - target_predator_predator = self.predator.predator; - Vore_Regurgitate(self); - // now steal our prey's prey if this probability applies - if(random() < cvar("g_balance_vore_swallow_stealprey")) - { - oldself = self; - self = target_predator_predator; - if(Swallow_condition_check(oldself)) - if not(teams_matter && self.team == target_predator.team) // don't steal a team mate's prey - if not(teams_matter && self.team == oldself.team) // if the prey we would be stealing is a team mate, don't do it - Vore_Swallow(oldself); - self = oldself; - } - } - // the swallow progress of prey and preds idly decrease by this amount if(cvar("g_balance_vore_swallow_speed_decrease")) { @@ -826,12 +804,18 @@ void Vore() self.regurgitate_prepare = -1; return; } - if(cvar("g_balance_vore_load_pred_speedcap") && self.stomach_load && vlen(self.velocity) >= cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_load / self.stomach_maxload)) // predator's going too fast, gets sick and throws up + if(cvar("g_balance_vore_load_pred_speedcap") && self.stomach_load) + if(vlen(self.velocity) >= cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_load / self.stomach_maxload)) // predator's going too fast, gets sick and throws up { self.regurgitate_prepare = -1; return; } + if (self.digesting && self.digestsound_finished < time) + { + PlayerSound (self, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + self.digestsound_finished = time + 0.5; + } if(cvar("g_vore_gurglesound")) Vore_GurgleSound();