X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fvore.qc;h=88d81546f00f6400a7d8e62d0afa65adc25363c9;hp=9dfb21fe6afef659e4459abbdb129f03b348e8a8;hb=d79ab6cd22ba49fa0bf28bc972b639ce89bcd2cf;hpb=099bddb183122fe8493fe22a29aaee0287e47855 diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 9dfb21fe..88d81546 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -97,6 +97,8 @@ void Vore_Weight_apply(entity e) e.vore_oldstomachload = e.stomach_load; } +.entity pusher; +.float pushltime; void Vore_Swallow(entity e) { // this player is beening swallowed by another player, apply the proper changes @@ -104,6 +106,7 @@ void Vore_Swallow(entity e) e.vore_oldsolid = e.solid; e.vore_oldview_ofs_z = e.view_ofs_z; + e.eater = self; setorigin(e, e.eater.origin); e.velocity = '0 0 0'; e.movetype = MOVETYPE_FOLLOW; @@ -111,8 +114,8 @@ void Vore_Swallow(entity e) e.alpha = -1; // best way of hiding / showing the eaten player e.aiment = e.eater; // follow the predator. Is automatically unset - /*e.cameraeffect_current = e.view_ofs_z * 2; - e.cameraeffect_target = e.view_ofs_z / 2; // best positioning for the stomach model*/ + e.pusher = e.eater; // so we can frag players by regurgitating them in deadly pits + e.pushltime = time + cvar("g_maxpushtime"); Vore_CameraEffect_Set(e); @@ -124,12 +127,18 @@ void Vore_Swallow(entity e) if(stov(cvar_string("g_vore_regurgitatecolor_released"))) e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released")); + if(e.eater.team == e.team && teamplay) + centerprint(e.eater, "^4You have swallowed a team mate, use caution!"); + PlayerSound(e.eater, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND); - setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing \ regurgitating + setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating e.eater.stomach_load += 1; e.eater.regurgitate_prepare = 0; Vore_Weight_apply(e.eater); + // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow + e.eater.weapon_delay = time + button_delay; + e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay"); e.system_delay = e.eater.system_delay = time + system_delay_time; } @@ -142,8 +151,6 @@ void Vore_Regurgitate(entity e) e.view_ofs_z = e.vore_oldview_ofs_z; e.alpha = default_player_alpha; // best way of hiding / showing the eaten player - //e.view_ofs_z *= 2; // best positioning for the stomach model - // velocities local vector oldforward, oldright, oldup; oldforward = v_forward; @@ -157,7 +164,7 @@ void Vore_Regurgitate(entity e) v_up = oldup; PlayerSound(e.eater, playersound_regurgitate, CHAN_PAIN, VOICETYPE_PLAYERSOUND); - setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing \ regurgitating + setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating pointparticles(particleeffectnum("regurgitate"), e.eater.origin, '0 0 0', 1); e.eater.stomach_load -= 1; e.eater.regurgitate_prepare = 0; @@ -176,7 +183,7 @@ void Vore_Disconnect() // prey disconnects or goes spectating while inside someone's belly: if(self.eater.classname == "player") { - self.view_ofs_z += 25; + self.view_ofs_z = self.vore_oldview_ofs_z; self.eater.stomach_load -= 1; Vore_Weight_apply(self.eater); self.eater = world; @@ -232,12 +239,10 @@ void Vore_Teamheal() .float stomachkick_delay; void Vore_StomachKick() { - // allows prey to kick the predator's stomach and do some damage / attempt to escape, or bring the predator's digestion upon their self when there's no other option + // allows prey to kick the predator's stomach and do some damage or attempt to escape if(self.eater.classname != "player") return; - // kick the predator's stomach and do damage, or escape if we are lucky - if(self.BUTTON_ATCK) if(time > self.stomachkick_delay) { float damage; @@ -250,13 +255,6 @@ void Vore_StomachKick() self.stomachkick_delay = time + cvar("g_balance_vore_kick_delay"); } - - // start the predator's digestion - if(self.BUTTON_ATCK2) - { - centerprint(self.eater, strcat(self.netname, " has triggered your digestion")); - self.eater.digesting = TRUE; - } } .float gurglesound_finished, gurglesound_oldstomachload; @@ -308,17 +306,7 @@ void Vore() // attempt to swallow our new prey if there's any in range if(self.BUTTON_ATCK && !self.BUTTON_REGURGITATE && self.swallow_delay < time) if(Swallow_condition_check(prey)) - { - prey.eater = self; Vore_Swallow(prey); - self.swallow_delay = time + cvar("g_balance_vore_swallow_delay"); - - if(self.team == prey.team && teamplay) - centerprint(self, "You have swallowed a team mate, use caution!"); - - // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow - self.weapon_delay = time + 0.25; - } // start / stop digestion on command, if the player has someone in their stomach if(self.BUTTON_DIGEST) @@ -349,7 +337,7 @@ void Vore() if(time > self.regurgitate_button_delay) { self.regurgitate_prepare = time + cvar("g_balance_vore_regurgitate_delay"); - PlayerSound(self, playersound_regurgitate_prepare, CHAN_PAIN, VOICETYPE_PLAYERSOUND); + PlayerSound(self, playersound_regurgitate_prepare, CHAN_VOICE, VOICETYPE_PLAYERSOUND); self.regurgitate_button_delay = time + button_delay; } } @@ -374,7 +362,20 @@ void Vore() if(self.eater.deadflag || self.deadflag) Vore_Regurgitate(self); else if(self.eater.eater.classname == "player") // don't allow a player inside a player inside another player :) + { + entity targeteater, oldself; + targeteater = self.eater.eater; + Vore_Regurgitate(self); + if(random() < cvar("g_vore_stealprey")) + if(Swallow_condition_check(self)) + { + oldself = self; + self = targeteater; + Vore_Swallow(oldself); + self = oldself; + } + } else if(vlen(self.eater.velocity) > cvar("g_balance_vore_regurgitate_velocitylimit")) Vore_Regurgitate(self); @@ -391,7 +392,8 @@ void Vore() if(teams_matter && self.team == self.eater.team) Vore_Teamheal(); - Vore_StomachKick(); + if(self.BUTTON_ATCK) + Vore_StomachKick(); Vore_CameraEffect_Apply(); } \ No newline at end of file