From: FruitieX Date: Thu, 2 Dec 2010 20:28:20 +0000 (+0200) Subject: make it all cvarrable X-Git-Tag: xonotic-v0.1.0preview~76^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=734a58da1c750ee5821437537303629623a49859;p=xonotic%2Fxonotic-data.pk3dir.git make it all cvarrable --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 1f977fc67..d3af957bb 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -2057,3 +2057,11 @@ exec _hud_descriptions.cfg // exec the default skin config // please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency exec hud_luminos.cfg + +set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector" +set g_weapon_charge_colormod_red_half 0 +set g_weapon_charge_colormod_green_half 0.5 +set g_weapon_charge_colormod_blue_half 1 +set g_weapon_charge_colormod_red_full 1 +set g_weapon_charge_colormod_green_full -0.5 +set g_weapon_charge_colormod_blue_full -1 diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 4401abfa8..0f285ebce 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -96,16 +96,19 @@ float w_nex(float req) if(cvar("g_balance_nex_charge")) { + local float hdrmultiplier = + self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset - self.weaponentity.weaponentity.glowmod_y = 0.5 * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); - self.weaponentity.weaponentity.glowmod_z = bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_x = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_y = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_z = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_half") * bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); if(self.nex_charge > cvar("g_balance_nex_charge_limit")) { - self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); - self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y - 0.5 * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); - self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z - (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); + self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); + self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); + self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); } self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod; }