.float stomachkick_delay, system_delay, action_delay, digest_button_delay_time, regurgitate_button_delay_time; .float complain_vore; .float vore_oldmovetype, vore_oldsolid; const float system_delay_time = 0.1; const float complain_delay_time = 1; const float button_delay_time = 0.5; entity Swallow_player_check() { // check if we can swallow a player instead of firing our weapon float swallow_range; vector vore_w_shotorg, vore_w_shotdir; swallow_range = cvar("g_balance_vore_swallow_range"); if(cvar("g_healthsize")) // we can swallow from further or closer based on our size swallow_range *= self.scale; makevectors(self.angles); vore_w_shotorg = self.origin; vore_w_shotdir = v_forward; if(self.antilag_debug) WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, self.antilag_debug); else WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, ANTILAG_LATENCY(self)); if(trace_fraction < 1) if(trace_ent.classname == "player") return trace_ent; return world; } float Swallow_condition_check(entity prey) { // checks the necessary conditions for swallowing a player if(prey != self) if(prey.classname == "player" && !prey.stat_eaten && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach if(self.classname == "player" && !self.stat_eaten && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves if(!self.BUTTON_REGURGITATE && time > self.action_delay) { float prey_mass; prey_mass = cvar("g_balance_vore_load_prey_mass"); if(cvar("g_healthsize")) prey_mass *= prey.scale; string swallow_complain; if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore")) swallow_complain = "You cannot swallow your team mates\n"; else if(!cvar("g_vore_spawnshield") && prey.spawnshieldtime > time) swallow_complain = "You cannot swallow someone protected by the spawn shield\n"; else if(self.stomach_load + prey_mass > self.stomach_maxload) swallow_complain = strcat("You don't have any room to swallow this player. Their mass is ^3", ftos(prey_mass), "^7 and your remaining capacity is ^3", ftos(self.stomach_maxload - self.stomach_load), "\n"); else if(cvar("g_vore_biggergut") && prey.stomach_load > self.stomach_load) swallow_complain = "You cannot swallow someone with a bigger stomach than yours\n"; else if(cvar("g_vore_biggersize") && prey.scale > self.scale) swallow_complain = "You cannot swallow someone larger than you\n"; if(swallow_complain != "") { if(time > self.complain_vore && self.BUTTON_ATCK) { play2(self, "misc/forbidden.wav"); sprint(self, swallow_complain); self.complain_vore = time + complain_delay_time; } return FALSE; } return TRUE; } 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 Stomach_HasLivePrey(entity pred) { entity head; FOR_EACH_PLAYER(head) { if(head.predator == pred) if(head.deadflag == DEAD_NO) return TRUE; } return FALSE; } float Vore_CanLeave() { if(self.stat_eaten) { if(!cvar("g_vore_kick")) // you are defenseless in the stomach if you can't kick, so allow leaving return TRUE; if(teams_matter && self.team == self.predator.team) return TRUE; if(g_rpg && cvar("g_rpg_canleave")) return TRUE; } return FALSE; } // position the camera properly for prey void Vore_SetPreyPositions(entity pred) { // pred is the predator and head is the prey local entity head; // In order to allow prey to see each other in the stomach, we must position each occupant differently, // else all players overlap in the center. To do this, we use a random origin on all players in the same stomach. FOR_EACH_PLAYER(head) { if(head.predator == pred) { // since prey have their predators set as an aiment, view_ofs will specify the real origin of prey, not just the view offset head.view_ofs_x = PL_PREY_VIEW_OFS_x + crandom() * cvar("g_vore_neighborprey_distance"); head.view_ofs_y = PL_PREY_VIEW_OFS_y + crandom() * cvar("g_vore_neighborprey_distance"); head.view_ofs_z = PL_PREY_VIEW_OFS_z; } } } .float gurgle_oldstomachload; void Vore_GurgleSound() { if(time > self.gurglesound_finished || (self.gurgle_oldstomachload != self.stomach_load && !self.digesting)) { GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE, VOL_BASE); // yes, hard coded sound length. I know it's bad but what can I do? if(cvar("g_healthsize") && cvar("g_healthsize_pitch")) self.gurglesound_finished = time + 11 * pow(self.scale, -cvar("g_healthsize_pitch")); // modified sound pitch, based on player scale else self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do? self.gurgle_oldstomachload = self.stomach_load; } } void Vore_AutoDigest(entity e) { // if the predator has the autodigest preference enabled, begin digesting new prey automatically if(!cvar("g_vore_digestion") || e.digesting) return; if(g_rpg) return; // RPG is choice based, so don't do things automatically there if(e.stomach_load) 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(clienttype(e) != CLIENTTYPE_REAL) return; // this feature is only for players, not bots if(Stomach_TeamMates_check(e)) return; // never begin automatic digestion if we've swallowed a team mate e.digesting = TRUE; } void Vore_StomachLoad_Apply() { // apply stomach weight that makes you heavier and larger the more you eat // slowing the player is done in cl_physics.qc if(self.classname != "player") return; entity e; float prey_mass, final_load; // apply the stomach capacity of the predator self.stomach_maxload = cvar("g_balance_vore_load_pred_capacity"); if(cvar("g_healthsize")) self.stomach_maxload *= self.scale; self.stomach_maxload = ceil(self.stomach_maxload); FOR_EACH_PLAYER(e) { if(e.predator == self) { prey_mass = cvar("g_balance_vore_load_prey_mass"); if(cvar("g_healthsize")) prey_mass *= e.scale; final_load += ceil(prey_mass); if(self.cvar_cl_vore_autodigest > 1) Vore_AutoDigest(self); } } for(e = world; (e = find(e, classname, "consumable")); ) { if(e.predator == self) { final_load += ceil(e.dmg); if(self.cvar_cl_vore_autodigest > 0) Vore_AutoDigest(self); } } self.stomach_load = final_load; // apply weight self.gravity = 1 * (cvar("g_healthsize") ? pow(self.scale, cvar("g_healthsize_weight")) : 1) + (self.stomach_load / self.stomach_maxload) * cvar("g_balance_vore_load_pred_weight"); if(!self.gravity && self.stomach_load) self.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity } .entity swallow_model; float Vore_GulletModel_CustomizeEntityForClient() { // use the same system as the weapon model self.viewmodelforclient = self.owner; self.alpha = self.owner.cvar_cl_vore_gulletmodel; if(other.classname == "spectator") if(other.enemy == self.owner) { self.viewmodelforclient = other; self.alpha = other.cvar_cl_vore_gulletmodel; } return TRUE; } void Vore_GulletModel_Think() { // update the position of the swallow model to match our swallow progress float dist; dist = (-0.5 + self.owner.swallow_progress_prey) * cvar("g_vore_swallowmodel_range"); // the model is centered at 0.5 progress if(cvar("g_healthsize")) dist *= self.scale; self.view_ofs = '1 0 0' * dist; // if our swallow progress is gone or we are dead, the swallow model also goes away if(!self.owner.swallow_progress_prey || self.owner.deadflag != DEAD_NO || self.owner.classname != "player") { remove(self.owner.swallow_model); self.owner.swallow_model = world; return; } // properties that should update whenever possible, but when the predator is not available self.nextthink = time; } void Vore_GulletModel_Update(entity prey, entity pred) { // if we don't have a swallow model already, spawn one if(!prey.swallow_model) { prey.swallow_model = spawn(); prey.swallow_model.movetype = MOVETYPE_FOLLOW; prey.swallow_model.solid = SOLID_NOT; //prey.swallow_model.effects |= EF_NOGUNBOB; // let it bob prey.swallow_model.effects |= EF_NODEPTHTEST; // don't hide behind walls prey.swallow_model.owner = prey; prey.swallow_model.customizeentityforclient = Vore_GulletModel_CustomizeEntityForClient; prey.swallow_model.think = Vore_GulletModel_Think; prey.swallow_model.nextthink = time; } // properties that should update whenever possible, but when the predator is available string player_gulletmodel; player_gulletmodel = strcat(substring(pred.playermodel, 0, strlen(pred.playermodel) - 4), "_gullet.iqm"); // 4 is the extension length if(prey.swallow_model.model != player_gulletmodel) // player model can be changed while the predator is active setmodel(prey.swallow_model, player_gulletmodel); 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 = pred.scale / prey.scale; // player size difference if(prey.swallow_model.enemy != pred) prey.swallow_model.enemy = pred; // enemy is the predator if(prey.swallow_model.colormap != pred.colormap) prey.swallow_model.colormap = pred.colormap; // pants and shirt color if(prey.swallow_model.glowmod != pred.glowmod) prey.swallow_model.glowmod = pred.glowmod; // glow color } .entity pusher; .float pushltime; void Vore_Swallow(entity e) { // this player is being swallowed by another player, apply the proper changes e.vore_oldmovetype = e.movetype; e.vore_oldsolid = e.solid; e.punchvector_z = cvar("g_balance_vore_swallow_prey_punchvector"); e.predator = self; setorigin(e, e.predator.origin); e.velocity = '0 0 0'; e.punchangle = '0 0 0'; e.movetype = MOVETYPE_FOLLOW; e.solid = SOLID_NOT; e.aiment = e.predator; // follow the predator, automatically unset when regurgitated e.swallow_progress_prey = e.swallow_progress_pred = 0; float scalediff; scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect // drop keys (KH) and flags (CTF) when we get swallowed kh_Key_DropAll(e, FALSE); if(e.flagcarried) DropFlag(e.flagcarried, world, e.predator); if(stov(cvar_string("g_vore_regurgitatecolor_color_normal"))) e.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_normal")); if(teams_matter && e.team == e.predator.team) { 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_VOICE, VOICETYPE_PLAYERSOUND); setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating e.predator.punchangle_x = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; e.predator.punchangle_y = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; e.predator.punchangle_z = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; e.predator.regurgitate_prepare = 0; e.predator.spawnshieldtime = 0; // lose spawn shield when we vore e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them e.predator.swallow_progress_prey = e.predator.swallow_progress_pred = 0; // this also resets the progress of any predator eating you if you eat him or someone else, it's better this way Vore_SetPreyPositions(e.predator); // block firing for a small amount of time, or we'll be firing the next frame after we swallow e.predator.weapon_delay = time + button_delay_time; e.predator.action_delay = time + cvar("g_balance_vore_action_delay"); e.system_delay = e.predator.system_delay = time + system_delay_time; e.stomachkick_delay = time + cvar("g_balance_vore_kick_delay"); // don't kick immediately after being swallowed } void Vore_SwallowStep(entity e) { if(!cvar("g_balance_vore_swallow_speed_fill_player")) { Vore_Swallow(e); return; } // when the predator starts swallowing, play his grab sound if(!self.swallow_progress_pred) PlayerSound(self, playersound_grab, CHAN_PAIN, VOICETYPE_PLAYERSOUND); // apply prey orientation if(cvar("g_balance_vore_swallow_prey_orient")) { e.punchangle = self.angles - e.angles; e.punchangle_speed = cvar("g_balance_vore_swallow_prey_orient_speed"); } Vore_GulletModel_Update(e, self); // increase the progress value until it reaches 1, then swallow the player if(e.swallow_progress_prey < 1) { float fill; fill = cvar("g_balance_vore_swallow_speed_fill_player") * frametime; if(cvar("g_healthsize") && cvar("g_balance_vore_swallow_speed_fill_scalediff_player")) // fill rate depends on predator size compared to prey size fill *= pow(self.scale / e.scale, cvar("g_balance_vore_swallow_speed_fill_scalediff_player")); if(cvar("g_balance_vore_swallow_speed_fill_stomachload") && e.stomach_load) // fill rate is influenced by the prey's stomach load fill *= (1 - ((e.stomach_load / e.stomach_maxload) * bound(0, cvar("g_balance_vore_swallow_speed_fill_stomachload"), 1))); // skill-based speed offset for bots if(skill && cvar("skill_offset")) { float ofs; ofs = pow(skill / cvar("skill_offset_center"), cvar("skill_offset")); if(clienttype(self) == CLIENTTYPE_BOT) fill *= ofs; if(clienttype(e) == CLIENTTYPE_BOT) fill /= ofs; } e.swallow_progress_prey += fill; } else { Vore_Swallow(e); e.swallow_progress_prey = 0; } // the predator's progress is how much the prey got swallowed self.swallow_progress_pred = e.swallow_progress_prey; } void Vore_Regurgitate(entity e) { // this player is being regurgitated by their predator, apply the proper changes e.movetype = e.vore_oldmovetype; if(e.health > 0) // leave SOLID_NOT for dead bodies e.solid = e.vore_oldsolid; e.view_ofs_z = PL_VIEW_OFS_z; e.punchvector_z = -cvar("g_balance_vore_regurgitate_prey_punchvector"); //e.swallow_progress_prey = e.swallow_progress_pred = 0; // not really needed here // if the prey has been fully digested, silently detach them if(cvar("g_balance_vore_regurgitate_death_silent")) if(e.deadflag != DEAD_NO && e.health <= cvar("g_balance_vore_digestion_limit")) { e.predator = world; e.modelindex = 0; // hide the dead body return; } float scalediff; scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect // apply velocities makevectors(e.predator.v_angle); e.velocity = v_forward * cvar("g_balance_vore_regurgitate_force") * scalediff; e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_predatorforce") * scalediff; e.pusher = e.predator; // allows us to frag players by regurgitating them in deadly pits e.pushltime = time + cvar("g_maxpushtime"); // apply prey orientation if(cvar("g_balance_vore_swallow_prey_orient")) { e.punchangle = e.predator.angles - e.angles; e.punchangle_speed = cvar("g_balance_vore_swallow_prey_orient_speed") * (1 - e.swallow_progress_prey); } // if the dead body of the prey is below gibbing health, gib it e.stat_eaten = 0; // necessary for gibs to show PlayerGib(e, e.predator); // regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable if(cvar("g_balance_vore_swallow_speed_fill_player") && cvar("g_balance_vore_regurgitate_swallowprogress")) { e.swallow_progress_prey = cvar("g_balance_vore_regurgitate_swallowprogress"); Vore_GulletModel_Update(e, e.predator); } // apply regurgitation damage to the predator if(cvar("g_balance_vore_regurgitate_damage")) { float regurgitate_dmg; regurgitate_dmg = cvar("g_balance_vore_regurgitate_damage"); if(cvar("g_healthsize")) regurgitate_dmg *= e.scale / e.predator.scale; Damage(e.predator, e, e, regurgitate_dmg, DEATH_REGURGITATION, e.predator.origin, '0 0 0'); } PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND); setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', floor(scalediff * PARTICLE_MULTIPLIER)); e.predator.punchangle_x = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; e.predator.punchangle_y = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; e.predator.punchangle_z = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; e.predator.regurgitate_prepare = 0; e.predator.action_delay = time + cvar("g_balance_vore_action_delay"); e.predator.swallow_progress_prey = e.predator.swallow_progress_pred = 0; // this also resets the progress of any predator eating you if you regurgitate, it's better this way Vore_SetPreyPositions(e.predator); // block firing for a small amount of time, or we'll be firing the next frame e.weapon_delay = time + button_delay_time; e.system_delay = e.predator.system_delay = time + system_delay_time; e.predator = world; } void Vore_Disconnect(float consumables) { // frees prey from their predators when someone disconnects or goes spectating, or in other circumstances entity e; // prey disconnects or goes spectating while inside someone's belly if(self.stat_eaten) Vore_Regurgitate(self); // pred disconnects or goes spectating with players in their belly entity head; FOR_EACH_PLAYER(head) { if(head.predator == self) Vore_Regurgitate(head); } // remove consumable items when we disconnect if(consumables) { for(e = world; (e = find(e, classname, "consumable")); ) { if(e.predator == self) Item_Consumable_Remove(e, TRUE); } } self.stomach_load = self.gravity = 0; // prevents a bug Vore_GurgleSound(); // stop the gurgling sound } .float digestion_step; void Vore_Digest() { // apply digestion to prey if(self.predator.deadflag != DEAD_NO) // dead predators don't digest { self.predator.digesting = FALSE; return; } if(self.health <= cvar("g_balance_vore_digestion_limit")) // don't digest below this amount of health return; if(time > self.digestion_step) { // if distributed digestion is enabled, reduce digestion strength by the amount of prey in our stomach float damage, damage_offset; damage_offset = 1; if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage damage_offset /= (1 - (self.predator.stomach_load / self.predator.stomach_maxload) * bound(0, cvar("g_balance_vore_digestion_distribute"), 1)); 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")); if(self.deadflag != DEAD_NO) damage = cvar("g_balance_vore_digestion_damage_death") / damage_offset; else damage = cvar("g_balance_vore_digestion_damage") / damage_offset; 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"); self.predator.pauserothealth_finished = max(self.predator.pauserothealth_finished, time + cvar("g_balance_pause_health_rot")); } self.digestion_step = time + vore_steptime; } if(stov(cvar_string("g_vore_regurgitatecolor_color_digest"))) self.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_digest")); } .float teamheal_step; void Vore_Teamheal() { // apply teamheal if(self.deadflag != DEAD_NO) return; if(cvar("g_balance_vore_teamheal") && self.health < cvar("g_balance_vore_teamheal_stable")) if(time > self.teamheal_step) { self.health += cvar("g_balance_vore_teamheal"); 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")) { play2(self, "misc/beep.wav"); play2(self.predator, "misc/beep.wav"); } } } .float kick_pressed; void Vore_StomachKick() { // allows prey to kick the predator's stomach and do some damage or attempt to escape if(self.deadflag != DEAD_NO) return; float scalediff; scalediff = pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); if(time > self.stomachkick_delay && !self.kick_pressed) { float damage, vol, pitch; vector force; damage = cvar("g_balance_vore_kick_damage"); force = v_forward * cvar("g_balance_vore_kick_force"); vol = VOL_BASE; // modified sound pitch, based on player scale if(cvar("g_healthsize") && cvar("g_healthsize_pitch")) pitch = pow(self.predator.scale, -cvar("g_healthsize_pitch")); // apply player scale to the damage / force of the kick if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff")) { damage *= scalediff; force *= scalediff; vol *= scalediff; // kick sound volume based on the same scale } vol = bound(0, vol, 1); Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, force); sound7(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM, 100 * pitch, 0); self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; self.punchangle_x = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; self.punchangle_y = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; self.punchangle_z = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; // abort the predator's scheduled regurgitation if(random() < cvar("g_balance_vore_kick_cutregurgitate")) self.predator.regurgitate_prepare = 0; self.stomachkick_delay = time + cvar("g_balance_vore_kick_delay"); if(cvar("g_balance_vore_kick_repress")) if not(clienttype(self) == CLIENTTYPE_BOT) // not for bots, to prevent an issue self.kick_pressed = TRUE; } } void Vore_StomachLeave() { // allows players to get out of their predator at will in some circumstances, such as team mates if(self.deadflag != DEAD_NO) return; if(Vore_CanLeave()) Vore_Regurgitate(self); else if(time > self.complain_vore) { 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.swallow_progress_pred || (self.stomach_load && Stomach_HasLivePrey(self))) && !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.swallow_progress_prey || (self.stat_eaten && !(teams_matter && self.team == self.predator.team))) && self.deadflag == DEAD_NO) { 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_SetSbarRings() { // first clear the ring stats, then configure them if needed self.stat_sbring1_type = self.stat_sbring1_clip = 0; self.stat_sbring2_type = self.stat_sbring2_clip = 0; if(self.stat_eaten) { if(time <= self.stomachkick_delay) { self.stat_sbring1_type = 3; // ring shows stomach kick delay, empties with progress self.stat_sbring1_clip = bound(0, (time / self.stomachkick_delay - 1) / ((self.stomachkick_delay - cvar("g_balance_vore_kick_delay")) / self.stomachkick_delay - 1), 1); } } else { if(self.swallow_progress_pred) { self.stat_sbring1_type = 1; // ring shows predator swallow progress, fills with progress self.stat_sbring1_clip = bound(0, self.swallow_progress_pred, 1); } else if(time <= self.action_delay) { self.stat_sbring1_type = 2; // ring shows vore action delay, empties with progress self.stat_sbring1_clip = bound(0, (time / self.action_delay - 1) / ((self.action_delay - cvar("g_balance_vore_action_delay")) / self.action_delay - 1), 1); } if(self.swallow_progress_prey) { self.stat_sbring2_type = 1; // ring shows prey swallow progress, fills with progress self.stat_sbring2_clip = bound(0, self.swallow_progress_prey, 1); } else if(time <= self.regurgitate_prepare) { self.stat_sbring2_type = 2; // ring shows regurgitation preparing, fills with progress self.stat_sbring2_clip = 1 - bound(0, (time / self.regurgitate_prepare - 1) / ((self.regurgitate_prepare - cvar("g_balance_vore_regurgitate_delay")) / self.regurgitate_prepare - 1), 1); } } } .float regurgitatecolor_particles_tick; void Vore() { // main vore code, this is where it all happens Vore_AutoTaunt(); if(!self.stat_eaten) if(self.modelindex) // not if we're a gibbed dead body or not visible any more if(self.colormod) if(self.colormod != '1 1 1') { // slowly wash stomach fluids off players once they're out of the stomach if(cvar("g_vore_regurgitatecolor_fade")) if(self.deadflag == DEAD_NO) // not for dead bodies { float goo_fade; goo_fade = cvar("g_vore_regurgitatecolor_fade") * frametime; goo_fade *= 1 + self.waterlevel; // fade faster when underwater self.colormod_x += goo_fade; if(self.colormod_x > 1) self.colormod_x = 1; self.colormod_y += goo_fade; if(self.colormod_y > 1) self.colormod_y = 1; self.colormod_z += goo_fade; if(self.colormod_z > 1) self.colormod_z = 1; } // constant particles falling off dirty players if(cvar("g_vore_regurgitatecolor_particles")) if(self.regurgitatecolor_particles_tick < time) { pointparticles(particleeffectnum("vore_regurgitate_constant"), self.origin, '0 0 0', floor((cvar("g_healthsize") ? self.scale : 1) * PARTICLE_MULTIPLIER)); self.regurgitatecolor_particles_tick = time + cvar("g_vore_regurgitatecolor_particles") * vlen(self.colormod); // particle time depends on how dirty the player is } } // set all vore stats Vore_SetSbarRings(); if(self.predator.classname == "player") { self.stat_stomachload = self.predator.stomach_load; // necessary for the stomach board self.stat_stomachmaxload = self.predator.stomach_maxload; // necessary for the stomach board self.stat_digesting = self.predator.digesting; // necessary for the stomach board self.stat_eaten = num_for_edict(self.predator); } else { self.stat_stomachload = self.stomach_load; self.stat_stomachmaxload = self.stomach_maxload; self.stat_digesting = self.digesting; self.stat_eaten = 0; } self.stat_canleave = Vore_CanLeave(); // don't allow a player inside a player inside another player :) // 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) Vore_Regurgitate(self); // the swallow progress of prey and preds idly decrease by this amount if(cvar("g_balance_vore_swallow_speed_decrease")) { if(self.swallow_progress_pred) { float speed = cvar("g_balance_vore_swallow_speed_decrease"); if(cvar("g_balance_vore_swallow_speed_decrease_even")) speed += self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_decrease_even"); self.swallow_progress_pred = max(0, self.swallow_progress_pred - speed * frametime); } if(self.swallow_progress_prey) { float speed = cvar("g_balance_vore_swallow_speed_decrease"); if(cvar("g_balance_vore_swallow_speed_decrease_even")) speed += self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_decrease_even"); self.swallow_progress_prey = max(0, self.swallow_progress_prey - cvar("g_balance_vore_swallow_speed_decrease") * frametime); } } // set the predator's stomach load and capacity Vore_StomachLoad_Apply(); // apply delays and skip the vore system under some circumstances if(!cvar("g_vore")) // the vore system is disabled { Vore_Disconnect(TRUE); return; } if(time < game_starttime || (time < warmup && !inWarmupStage)) // don't allow vore before a round begins { Vore_Disconnect(FALSE); return; } if(self.spectatee_status) return; if(time < self.system_delay) return; // -------------------------------- // Code that addresses predators: // -------------------------------- entity prey; prey = Swallow_player_check(); // attempt to swallow our new prey if we pressed the attack button, and there's any in range self.stat_canswallow = 0; if(Swallow_condition_check(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_SwallowStep(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")) { if(self.stomach_load) { if(time > self.digest_button_delay_time) { self.digesting = !self.digesting; self.digest_button_delay_time = time + button_delay_time; } } else if(time > self.complain_vore) { play2(self, "misc/forbidden.wav"); sprint(self, "There is nothing to digest\n"); self.complain_vore = time + complain_delay_time; } } if(!self.stomach_load || !cvar("g_vore_digestion")) self.digesting = FALSE; // predator wishes to regurgitate his prey if(self.BUTTON_REGURGITATE && time > self.action_delay) if(!self.regurgitate_prepare) { if(self.stomach_load) { if(time > self.regurgitate_button_delay_time) { self.regurgitate_prepare = time + cvar("g_balance_vore_regurgitate_delay"); PlayerSound(self, playersound_regurgitate_prepare, CHAN_VOICE, VOICETYPE_PLAYERSOUND); setanim(self, self.anim_pain2, FALSE, TRUE, TRUE); // looks good for preparing regurgitation self.punchangle_x = cvar("g_balance_vore_regurgitate_predator_prepare_punchangle"); self.regurgitate_button_delay_time = time + button_delay_time; } } else if(time > self.complain_vore) { play2(self, "misc/forbidden.wav"); sprint(self, "There is nothing to regurgitate\n"); self.complain_vore = time + complain_delay_time; } } if(self.stomach_load > self.stomach_maxload) // the predator got beyond his capacity after eating, so some prey must pop out { self.regurgitate_prepare = -1; return; } 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(); // -------------------------------- // Code that addresses the prey: // -------------------------------- if(!self.stat_eaten) return; if(self.deadflag != DEAD_NO && self.health < cvar("g_balance_vore_digestion_limit")) // make sure health doesn't go below the limit self.health = cvar("g_balance_vore_digestion_limit"); // automatically regurgitate prey that has reached their digestion limit if(cvar("g_balance_vore_digestion_limit_regurgitate")) if(self.health <= cvar("g_balance_vore_digestion_limit")) { Vore_Regurgitate(self); return; } // do we stick around inside dead furries? x_x if(self.predator.deadflag != DEAD_NO) { if(!cvar("g_balance_vore_deadpredator") || !self.predator.modelindex) // if the predator is gibbed, we are out { Vore_Regurgitate(self); return; } if(self.predator.regurgitate_prepare) // abort scheduled regurgitation self.predator.regurgitate_prepare = 0; } // apply delayed regurgitating if it was scheduled if(self.predator.regurgitate_prepare && time > self.predator.regurgitate_prepare) { Vore_Regurgitate(self); self.predator.complain_vore = time + complain_delay_time; // prevent complaining the next frame if this empties our stomach } // execute digesting and team healing if(self.predator.digesting == TRUE) Vore_Digest(); if(teams_matter && self.team == self.predator.team) if(cvar("g_balance_vore_teamheal") && cvar("g_vore_teamvore")) Vore_Teamheal(); // execute prey commands if(self.BUTTON_ATCK) { if(cvar("g_vore_kick")) Vore_StomachKick(); } else self.kick_pressed = FALSE; if(self.BUTTON_JUMP) Vore_StomachLeave(); // Ugly workaround for a Keyhunt issue. Your team's key can still be given to you while in the stomach // (at round start), which is pretty ugly and wrong. So attempt to drop keys each frame for prey kh_Key_DropAll(self, FALSE); // always position camera at the center of the stomach, to reduce probability of the view poking out self.view_ofs_z = PL_PREY_VIEW_OFS_z * self.predator.scale; }