From 913e23bfcae6d8c4a7dc548ef776eb983d856f35 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 16:19:23 +0200 Subject: [PATCH] Allow items to be digested. Only partly implemented --- data/balanceVT.cfg | 1 + data/qcsrc/server/t_items.qc | 19 ++++++++++++++++++- data/qcsrc/server/vore.qc | 5 ++--- data/qcsrc/server/vore.qh | 4 +++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index 962aeef6..5e395475 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -218,6 +218,7 @@ set g_balance_vore_regurgitate_predator_punchangle_item 6 "your view gets tilted set g_balance_vore_regurgitate_prey_punchvector 50 "your view gets lowered by this amount when getting regurgitated" set g_balance_vore_digestion_damage 4 "amount of damage applied to victims during digestion" set g_balance_vore_digestion_damage_death 2 "amplify digestion damage by this amount when the prey is dead" +set g_balance_vore_digestion_damage_item 2 "amount of damage applied to items during digestion" set g_balance_vore_digestion_limit -100 "prey can be digested down to this amount of health" set g_balance_vore_digestion_limit_regurgitate 1 "the predator automatically regurgitates prey that has reached the digestion limit" set g_balance_vore_digestion_limit_blockrespawn 1 "dead prey cannot respawn if it's still being digested" diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index b0c2eed7..43756ab6 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -220,6 +220,7 @@ void Item_ScheduleInitialRespawn(entity e) } .float inithealth; +.float item_digestion_step; void Item_Consumable_Remove(entity e, float regurgitate); void Item_Consumable_Think() { @@ -239,10 +240,26 @@ void Item_Consumable_Think() if(self.predator.digesting) { - self.scale = self.health / self.inithealth; // scale matches the item's digestion progress + if(time > self.item_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 *= self.predator.stomach_load / self.predator.stomach_maxload; + damage_offset = ceil(damage_offset); + damage = cvar("g_balance_vore_digestion_damage_item") / damage_offset; + + self.health -= damage; + self.predator.health += damage; + self.scale = self.health / self.inithealth; // scale matches the item's digestion progress + } if(stov(cvar_string("g_vore_regurgitatecolor_color_digest"))) self.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_digest")); + + self.item_digestion_step = time + vore_steptime; } self.nextthink = time; diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 5870a694..e07db746 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() { @@ -473,7 +472,7 @@ void Vore_Digest() PlayerSound (self.predator, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); self.predator.digestsound_finished = time + 0.5; } - self.digestion_step = time + steptime; + self.digestion_step = time + vore_steptime; } if(stov(cvar_string("g_vore_regurgitatecolor_color_digest"))) @@ -492,7 +491,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")) diff --git a/data/qcsrc/server/vore.qh b/data/qcsrc/server/vore.qh index baf9ffbc..a03b4e15 100644 --- a/data/qcsrc/server/vore.qh +++ b/data/qcsrc/server/vore.qh @@ -1,7 +1,9 @@ +const float vore_steptime = 0.1; + void Vore(); void Vore_Disconnect(); .float regurgitate_prepare; entity Swallow_player_check(); float Swallow_condition_check(entity prey); -float Stomach_HasLivePrey(entity pred); \ No newline at end of file +float Stomach_HasLivePrey(entity pred); -- 2.39.2