]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Tweak healthsize cvar functionality, and allow specifying shrink / grow amount
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 13:50:16 +0000 (16:50 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 13:50:16 +0000 (16:50 +0300)
data/defaultVT.cfg
data/qcsrc/client/Main.qc
data/qcsrc/client/main.qh
data/qcsrc/client/sbar.qc
data/qcsrc/client/shownames.qc
data/qcsrc/server/cl_client.qc

index 6e5b5e14cce7348db93183968ec51866705e361b..d59cd9fa7209d474510eb6f01048d56ab20c4f84 100644 (file)
@@ -1605,15 +1605,16 @@ set g_vore_regurgitatecolor_particles 0.75 "players who are dirty from regurgita
 set g_vore_neighborprey_distance 8 "Distance by which prey inside the same stomach are positioned away from each other. 0 disables seeing neighboring prey"\r
 set g_vore_swallowmodel_range 100 "Distance by which the swallow model oscillates based on swallow progress"\r
 \r
-set g_healthsize 100 "Players who are low on health shrink and become smaller, value specifies health at which the player has default size"\r
+set g_healthsize 1 "Players shrink and grow based on health, by this amount"\r
+set g_healthsize_center 100 "Health at which the player has the default size"\r
+set g_healthsize_min 50 "Player size may not drop below this amount of health"\r
+set g_healthsize_max 150 "Player size may not grow past this amount of health"\r
 set g_healthsize_movementfactor 0.5 "Amount by which player size affects jumping and running"\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_weapon_scalefactor 1 "Amount by which player size resizes the view weapon model"\r
 set g_healthsize_weapon_scalefactor_pos 10 "Amount by which the view model is moved vertically based on player size"\r
 set g_healthsize_vore_shrinkdeadprey 0.25 "Dead prey will be shrunken by this amount, the closer it gets to the digestion limit"\r
-set g_healthsize_min 50 "Player size may not drop below this amount of health"\r
-set g_healthsize_max 150 "Player size may not grow past this amount of health"\r
 \r
 // part of an ugly hack for the menu audio sliders to work with the cutsound feature\r
 seta menu_volume 1\r
index 411b80d110241e4d0a6ed12fb0ba35310bc35441..248074c2efc64a1abac378ebdcc635bf7c2789c3 100644 (file)
@@ -1054,7 +1054,7 @@ void Ent_Init()
        g_weaponswitchdelay = ReadByte() / 255.0;\r
 \r
        g_vore = ReadShort();\r
-       g_healthsize = ReadShort();\r
+       g_healthsize_center = ReadShort();\r
        g_healthsize_min = ReadShort();\r
        g_healthsize_max = ReadShort();\r
 \r
index 245ed88606c3b26393aae8993e1f34843a525dcb..1d495abf07bb0cb674b6eb4aa33ff7388f75d24a 100644 (file)
@@ -167,7 +167,7 @@ float armorblockpercent;
 float g_weaponswitchdelay;\r
 \r
 float g_vore;\r
-float g_healthsize, g_healthsize_min, g_healthsize_max;\r
+float g_healthsize_center, g_healthsize_min, g_healthsize_max;\r
 float armor_max;\r
 float teamheal_max;\r
 \r
index edda2244f01426306939957755791d0b26884c67..56395d20436d8cc2d630e45fdc3818045022176b 100644 (file)
@@ -3139,7 +3139,7 @@ void Sbar_Draw (void)
                                status_pos = bottomleft - '-43 168 0';\r
                                status_size = 16;\r
                        }\r
-                       else if(g_healthsize) // no point in showing it otherwise\r
+                       else if(g_healthsize_center >= 0) // no point in showing it otherwise\r
                        {\r
                                status_text = strcat(status_color, ftos(stomach_maxload));\r
                                status_pos = bottomleft - '-43 170 0';\r
index 3da7d34713a30e5accf1afa2c0417fdd0f661745..23e5290b5f81de565bcf5bb61b9e8755199dcee8 100644 (file)
@@ -23,8 +23,8 @@ void Draw_ShowNames(entity ent)
                ent.origin_z += cvar("hud_shownames_offset");
 
                // offset the name by player scale, decided by health
-               if(g_healthsize)
-                       ent.origin_z -= (g_healthsize - bound(g_healthsize_min, ent.healthvalue, g_healthsize_max)) * cvar("hud_shownames_offset_healthsize");
+               if(g_healthsize_center >= 0)
+                       ent.origin_z -= (g_healthsize_center - bound(g_healthsize_min, ent.healthvalue, g_healthsize_max)) * cvar("hud_shownames_offset_healthsize");
 
                traceline(ent.origin, view_origin, TRUE, ent);
 
index ea780e4aa886c949a919c5fbe66bc7155cafd4d0..f426043fad890b3681be451f3c959cd4ee23b5eb 100644 (file)
@@ -1052,7 +1052,10 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);\r
 \r
        WriteShort(MSG_ENTITY, cvar("g_vore"));\r
-       WriteShort(MSG_ENTITY, cvar("g_healthsize"));\r
+       if(cvar("g_healthsize"))\r
+               WriteShort(MSG_ENTITY, cvar("g_healthsize_center"));\r
+       else\r
+               WriteShort(MSG_ENTITY, -1); // healthsize is disabled\r
        WriteShort(MSG_ENTITY, cvar("g_healthsize_min"));\r
        WriteShort(MSG_ENTITY, cvar("g_healthsize_max"));\r
 \r
@@ -2319,7 +2322,7 @@ void SetPlayerSize()
                return;\r
 \r
        // change player scale based on the amount of health we have\r
-       self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize");\r
+       self.scale = pow(bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize_center"), cvar("g_healthsize"));\r
 \r
        // The following code sets the bounding box to match the player's size.\r
        // It is currently disabled because of issues with engine movement prediction (cl_movement).\r