An important improvement to my last commit
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 16:33:00 +0000 (18:33 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 16:33:00 +0000 (18:33 +0200)
data/qcsrc/server/t_items.qc
docs/TODO.txt

index f06ba5e..a382d71 100644 (file)
@@ -428,10 +428,14 @@ float Item_Swallow(entity item, entity player)
        if(!usage)\r
                return FALSE;\r
 \r
-       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"));\r
+       // since map items don't have a scale, calculate one based on player size center and the item's health, in order to determine swallowing speed\r
+       float scalediff;\r
+       scalediff = pow((item.health / cvar("g_healthsize_center")) / player.scale, cvar("g_balance_vore_swallow_speed_fill_scalediff"));\r
+\r
+       item.swallow_progress_prey += cvar("g_balance_vore_swallow_speed_fill_item") / scalediff;\r
        player.swallow_progress_pred = item.swallow_progress_prey;\r
-       if(item.swallow_progress_prey < 1 && !cvar("g_balance_vore_swallow_speed_fill_item"))\r
-               return FALSE; // swallow progress not full yet\r
+       if(item.swallow_progress_prey < 1 && cvar("g_balance_vore_swallow_speed_fill_item"))\r
+               return FALSE; // swallow progress not full yet, or slow swallowing of items is disabled\r
 \r
        if(usage > 1)\r
        {\r
index 11a809f..aaa4bce 100644 (file)
 \r
 - 0.8: Does item alpha break any game modes, now that slow swallowing items are implemented?\r
 \r
-- 0.8: What should depend on health difference and what should depend on size difference between items and players, for swallowing items?\r
-\r
 - 0.8: Should items always be swallowed by standing over them only?\r
 \r
 - 0.8: Don't allow macros in the tutorial map (use health rot), since their weight makes it impossible to pass some parts\r