From: MirceaKitsune Date: Mon, 2 May 2011 14:54:00 +0000 (+0300) Subject: Allow weapons to keep their size while the player shrinks and grows. Micros will... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7801f2cbfa067297cd22769ab7d40012a9e991ec;p=voretournament%2Fvoretournament.git Allow weapons to keep their size while the player shrinks and grows. Micros will now appear to be carrying a huge gun, whereas for macros, the weapon will appear tiny. Implementation for exterior weapon model to follow. --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 549b8c8f..7d519a3e 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1549,6 +1549,8 @@ set g_vore_keepdeadprey 1 "If enabled, prey remains in the stomach after dying, set g_healthsize 100 "Players who are low on health shrink and become smaller, value specifies health at which the player has default size" set g_healthsize_movementfactor 0.5 "Amount by which player size affects jumping and running" +set g_healthsize_weaponscalefactor 0.5 "Amount by which player size resizes the view weapon model" +set g_healthsize_weaponscalefactor_viewmodel_pos 5 "Amount by which the view model is moved vertically based on player size" set g_healthsize_min 25 "Player size may not drop below this amount of health" set g_healthsize_max 200 "Player size may not grow past this amount of health" diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index d4253c4d..78c92e1a 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -736,6 +736,14 @@ void CL_Weaponentity_Think() } + // if we are a micro or macro, size the weapon model accordingly + if(self.owner.scale && cvar("g_healthsize_weaponscalefactor")) + { + self.weaponentity.scale = (1 + cvar("g_healthsize_weaponscalefactor")) - cvar("g_healthsize_weaponscalefactor") * self.owner.scale; + self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weaponscalefactor_viewmodel_pos"); + dprint(strcat(ftos(self.weaponentity.origin_z), "\n")); + } + // create or update the lasertarget entity };