Properly calculate falling damage based on player scale. Don't just offset the damage...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 13:10:37 +0000 (15:10 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 13:10:37 +0000 (15:10 +0200)
data/defaultVT.cfg
data/qcsrc/server/sv_main.qc
docs/TODO.txt

index 68d2bdb..4f96470 100644 (file)
@@ -1679,6 +1679,7 @@ set g_healthsize_death 0.25 "Dead players are further shrunken by this amount"
 set g_healthsize_death_min -100 "Health at which dead players stop being shrunken"\r
 set g_healthsize_weight 0.75 "Size affects player gravity by this amount"\r
 set g_healthsize_movementfactor 0.5 "Amount by which player size affects jumping and running"\r
 set g_healthsize_death_min -100 "Health at which dead players stop being shrunken"\r
 set g_healthsize_weight 0.75 "Size affects player gravity by this amount"\r
 set g_healthsize_movementfactor 0.5 "Amount by which player size affects jumping and running"\r
+set g_healthsize_falldamagefactor 0.5 "Amount by which player size influences fall damage"\r
 set g_healthsize_viewfactor 2 "The view is offset by this amount based on player size"\r
 set g_healthsize_soundfactor 0.5 "The sounds players make are amplified or reduced by this amount based on their size"\r
 set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resizes the exterior weapon model"\r
 set g_healthsize_viewfactor 2 "The view is offset by this amount based on player size"\r
 set g_healthsize_soundfactor 0.5 "The sounds players make are amplified or reduced by this amount based on their size"\r
 set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resizes the exterior weapon model"\r
index e49283c..eb4bb6b 100644 (file)
@@ -69,13 +69,16 @@ void CreatureFrame (void)
                        // check for falling damage\r
                        if(!(g_cts && !cvar("g_cts_selfdamage")))\r
                        {\r
                        // check for falling damage\r
                        if(!(g_cts && !cvar("g_cts_selfdamage")))\r
                        {\r
+                               // if we are smaller or larger, take more or less falling damage\r
+                               float scalefac;\r
+                               scalefac = cvar("g_healthsize") ? pow(self.scale, cvar("g_healthsize_falldamagefactor")) : 1;\r
+\r
                                dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.\r
                                if (self.deadflag)\r
                                dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.\r
                                if (self.deadflag)\r
-                                       dm = (dm - cvar("g_balance_falldamage_deadminspeed")) * cvar("g_balance_falldamage_factor");\r
+                                       dm = (dm - cvar("g_balance_falldamage_deadminspeed") * scalefac) * cvar("g_balance_falldamage_factor");\r
                                else\r
                                else\r
-                                       dm = min((dm - cvar("g_balance_falldamage_minspeed")) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage"));\r
-                               if(cvar("g_healthsize")) // if we are smaller or larger, we take more or less falling damage\r
-                                       dm *= (1 + cvar("g_healthsize_movementfactor")) - cvar("g_healthsize_movementfactor") * self.scale; \r
+                                       dm = min((dm - cvar("g_balance_falldamage_minspeed") * scalefac) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage"));\r
+                               dm /= scalefac;\r
                                if (dm > 0)\r
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');\r
                                else if(vlen(self.velocity) > 100000 && cvar("developer"))\r
                                if (dm > 0)\r
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');\r
                                else if(vlen(self.velocity) > 100000 && cvar("developer"))\r
index 8632a53..ceb8eae 100644 (file)
 \r
 - 0.8: Does the wind trigger brush need to account scale based gravity?\r
 \r
 \r
 - 0.8: Does the wind trigger brush need to account scale based gravity?\r
 \r
+- 0.8 BUG: Stomach load appeared 101 while my health was 100\r
+\r
 - 0.8: Make some g_healthsize cvars g_balance_healthsize, and move them to balanceVT.cfg\r
 \r
 - 0.8: Make player fatness depend on frags, using a trick I heard about with shaders\r
 - 0.8: Make some g_healthsize cvars g_balance_healthsize, and move them to balanceVT.cfg\r
 \r
 - 0.8: Make player fatness depend on frags, using a trick I heard about with shaders\r