From e9ec61784e7922bff01a2f9e81f3dbd5868a38b0 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 19 Mar 2012 17:57:10 +0200 Subject: [PATCH] Fix the final cvars and document the new feature of swallowing items. It should now be complete and bug-free so far. --- data/balanceVT.cfg | 6 +++--- data/qcsrc/server/t_items.qc | 4 ++-- data/qcsrc/server/vore.qc | 14 +++++++------- docs/Release notes.txt | 2 ++ docs/TODO.txt | 4 ++++ 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index 5bc0059a..620adc93 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -204,9 +204,9 @@ set g_balance_vore_load_pred_speed 1 "you get this slower the more you eat, at 1 set g_balance_vore_load_pred_speedcap 800 "when a predator is going faster than this (at full stomach capacity), their prey is squeezed out of them" set g_balance_vore_load_prey_mass 30 "prey mass, influenced by player size" set g_balance_vore_swallow_range 140 "distance below which you can swallow another player when facing them" -set g_balance_vore_swallow_speed_item_fill 0.01 "how long it takes to swallow a health item, offset by item health, 0 is instant" -set g_balance_vore_swallow_speed_fill 2 "how long it takes to swallow a player, 0 is instant" -set g_balance_vore_swallow_speed_fill_scalediff 0.5 "fill rate depends on predator size compared to prey size by this amount" +set g_balance_vore_swallow_speed_fill_player 2 "how long it takes to swallow a player, 0 is instant" +set g_balance_vore_swallow_speed_fill_item 0.01 "how long it takes to swallow a health item, 0 is instant" +set g_balance_vore_swallow_speed_fill_scalediff 0.5 "fill rate depends on predator size compared to prey size by this amount, and player health compared to item health for items" set g_balance_vore_swallow_speed_fill_stomachload 1 "fill rate is influenced by the prey's stomach load by this amount" set g_balance_vore_swallow_speed_decrease 0.5 "how fast the swallow progress decreases, when the predator is no longer swallowing" set g_balance_vore_swallow_speed_cutspd_prey 1 "prey movement slows down by this amount the closer they are to being swallowed" diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 9b65c50c..f06ba5ea 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -428,9 +428,9 @@ float Item_Swallow(entity item, entity player) if(!usage) return FALSE; - item.swallow_progress_prey = item.swallow_progress_prey + cvar("g_balance_vore_swallow_speed_item_fill") * (player.health / item.health); + item.swallow_progress_prey = item.swallow_progress_prey + cvar("g_balance_vore_swallow_speed_fill_item") * pow(player.health / item.health, cvar("g_balance_vore_swallow_speed_fill_scalediff")); player.swallow_progress_pred = item.swallow_progress_prey; - if(item.swallow_progress_prey < 1) + if(item.swallow_progress_prey < 1 && !cvar("g_balance_vore_swallow_speed_fill_item")) return FALSE; // swallow progress not full yet if(usage > 1) diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index cae9440b..12c0dbe6 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -341,7 +341,7 @@ void Vore_Swallow(entity e) void Vore_SwallowStep(entity e) { - if(!cvar("g_balance_vore_swallow_speed_fill")) + if(!cvar("g_balance_vore_swallow_speed_fill_player")) { Vore_Swallow(e); return; @@ -357,11 +357,11 @@ void Vore_SwallowStep(entity e) if(e.swallow_progress_prey < 1) { float fill; - fill = cvar("g_balance_vore_swallow_speed_fill") * frametime; - if(cvar("g_healthsize") && cvar("g_balance_vore_swallow_speed_fill_scalediff")) // fill rate depends on predator size compared to prey size - fill *= pow(self.scale / e.scale, cvar("g_balance_vore_swallow_speed_fill_scalediff")); - 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))); + fill = cvar("g_balance_vore_swallow_speed_fill_player") * frametime; + if(cvar("g_healthsize") && cvar("g_balance_vore_swallow_speed_fill_player_scalediff")) // fill rate depends on predator size compared to prey size + fill *= pow(self.scale / e.scale, cvar("g_balance_vore_swallow_speed_fill_player_scalediff")); + if(cvar("g_balance_vore_swallow_speed_fill_player_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_player_stomachload"), 1))); // skill-based speed offset for bots if(skill && cvar("skill_offset")) @@ -420,7 +420,7 @@ void Vore_Regurgitate(entity e) 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") && cvar("g_balance_vore_regurgitate_swallowprogress")) + 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_SwallowModel_Update(e, e.predator); diff --git a/docs/Release notes.txt b/docs/Release notes.txt index 635c6333..e9134d7c 100644 --- a/docs/Release notes.txt +++ b/docs/Release notes.txt @@ -346,4 +346,6 @@ Features: - Player size also influences weight. Macros will have more gravity while micros float more easily. Jump pads throw players at the correct destination if their weight is changed by scale, but a loaded stomach will still reduce traveling speed. +- Health items are now swallowed slowly like players. The swallow speed depends on an item's health compared to the player's health, rather than a size comparison as done between players. This does not conflict with consumable items, and the two can be toggled individually. Items are still eaten by standing over them. + Known bugs: diff --git a/docs/TODO.txt b/docs/TODO.txt index 37cc1d42..11a809f6 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -114,6 +114,10 @@ - 0.8: Does item alpha break any game modes, now that slow swallowing items are implemented? +- 0.8: What should depend on health difference and what should depend on size difference between items and players, for swallowing items? + +- 0.8: Should items always be swallowed by standing over them only? + - 0.8: Don't allow macros in the tutorial map (use health rot), since their weight makes it impossible to pass some parts - 0.8: Make some g_healthsize cvars g_balance_healthsize, and move them to balanceVT.cfg -- 2.39.2