]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Allow weapons to keep their size while the player shrinks and grows. Micros will...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 14:54:00 +0000 (17:54 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 14:54:00 +0000 (17:54 +0300)
data/defaultVT.cfg
data/qcsrc/server/cl_weaponsystem.qc

index 549b8c8fd743cc0e798d0fa948b68a9452ca5c32..7d519a3edee3f279b1464b3243ea128732058d56 100644 (file)
@@ -1549,6 +1549,8 @@ set g_vore_keepdeadprey 1 "If enabled, prey remains in the stomach after dying,
 \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_movementfactor 0.5 "Amount by which player size affects jumping and running"\r
+set g_healthsize_weaponscalefactor 0.5 "Amount by which player size resizes the view weapon model"\r
+set g_healthsize_weaponscalefactor_viewmodel_pos 5 "Amount by which the view model is moved vertically based on player size"\r
 set g_healthsize_min 25 "Player size may not drop below this amount of health"\r
 set g_healthsize_max 200 "Player size may not grow past this amount of health"\r
 \r
index d4253c4d0ec4bc88d02dce49092bc28b91ba3a5b..78c92e1a410604c23ec2e47f805a67bd030953f6 100644 (file)
@@ -736,6 +736,14 @@ void CL_Weaponentity_Think()
 \r
        }\r
 \r
+       // if we are a micro or macro, size the weapon model accordingly\r
+       if(self.owner.scale && cvar("g_healthsize_weaponscalefactor"))\r
+       {\r
+               self.weaponentity.scale = (1 + cvar("g_healthsize_weaponscalefactor")) - cvar("g_healthsize_weaponscalefactor") * self.owner.scale;\r
+               self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weaponscalefactor_viewmodel_pos");\r
+               dprint(strcat(ftos(self.weaponentity.origin_z), "\n"));\r
+       }\r
+\r
        // create or update the lasertarget entity\r
 };\r
 \r