]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
make it all cvarrable
authorFruitieX <fruitiex@gmail.com>
Thu, 2 Dec 2010 20:28:20 +0000 (22:28 +0200)
committerFruitieX <fruitiex@gmail.com>
Thu, 2 Dec 2010 20:28:20 +0000 (22:28 +0200)
defaultXonotic.cfg
qcsrc/server/w_nex.qc

index 1f977fc67e0aae71f08e9547ebf339ac37c6e15a..d3af957bbb9cc8c0b36d7b21a39d9f5387be7182 100644 (file)
@@ -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
index 4401abfa84f9446051137a5faefc5c4cdc3e2fd1..0f285ebce19c6e3be6ca85bd1a6ca5e9c5d84ce0 100644 (file)
@@ -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;
         }