]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Sound and music cutting effect when inside the stomach
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 26 Feb 2011 13:34:09 +0000 (15:34 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 26 Feb 2011 13:34:09 +0000 (15:34 +0200)
data/defaultVoretournament.cfg
data/qcsrc/client/View.qc

index 866a6cbc2ee504e4d30dcaccf674f348b0354636..29bbf3cbad46280cb1071a753f01db91f157c0a7 100644 (file)
@@ -1512,6 +1512,9 @@ seta g_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the co
 set cl_vore_stomachmodel 1 "when enabled, we see the stomach model around us when eaten. -1 = disabled, 1 = enabled, anything between 0 and 1 = alpha"\r
 set cl_vore_cameraspeed 1.5 "speed at which you see yourself sliding down when swallowed, 0 disables"\r
 set cl_vore_punchangle 10 "your view gets tilted by this amount when swallowing or regurgitating someone"\r
+set cl_vore_cutvolume_sound 0.5 "sound volume is reduced by this amount when you are in a stomach"\r
+set cl_vore_cutvolume_music 0.5 "music volume is reduced by this amount when you are in a stomach"\r
+set cl_vore_cutvolume_fade 0.1 "fading speed of the volume change"\r
 set g_vore 1 "enables the vore system, you want this on!"\r
 set g_vore_digestion 1 "enables digestion system, you want this on!"\r
 set g_vore_kick 1 "enables stomach kick system, you want this on!"\r
index b8f17b1c031cc623d9cdef84da0f7d7fa10b7e96..98c97ab7c9e636b4376d0f1dee74a73f8c2bedd7 100644 (file)
@@ -256,6 +256,7 @@ float pickup_crosshair_time, pickup_crosshair_size;
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
 float stomachsplash_alpha, stomachsplash_remove_at_respawn;\r
+float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2, volume_modify_default_set;\r
 vector myhealth_gentlergb;\r
 vector liquidcolor_prev;\r
 vector damage_blurpostprocess, content_blurpostprocess;\r
@@ -686,6 +687,52 @@ void CSQC_UpdateView(float w, float h)
                cvar_set("r_glsl_postprocess_uservec2_enable", "0");\r
        }\r
 \r
+       if(cvar("cl_vore_cutvolume_sound") || cvar("cl_vore_cutvolume_music"))\r
+       {\r
+               if(!volume_modify_default_set)\r
+               {\r
+                       // set the initial volume\r
+                       volume_modify_default_1 = cvar("volume");\r
+                       volume_modify_default_2 = cvar("bgmvolume");\r
+                       volume_modify_default_set = TRUE;\r
+               }\r
+               if(spectatee_status == -1 || intermission)\r
+                       volume_modify_1 = volume_modify_2 = 1;\r
+               else if (getstati(STAT_VORE_EATEN))\r
+               {\r
+                       if (volume_modify_1 > cvar("cl_vore_cutvolume_sound"))\r
+                       {\r
+                               volume_modify_1 -= cvar("cl_vore_cutvolume_fade") * frametime;\r
+                               if(volume_modify_1 < cvar("cl_vore_cutvolume_sound"))\r
+                                       volume_modify_1 = cvar("cl_vore_cutvolume_sound");\r
+                       }\r
+                       if (volume_modify_2 > cvar("cl_vore_cutvolume_music"))\r
+                       {\r
+                               volume_modify_2 -= cvar("cl_vore_cutvolume_fade") * frametime;\r
+                               if(volume_modify_2 < cvar("cl_vore_cutvolume_music"))\r
+                                       volume_modify_2 = cvar("cl_vore_cutvolume_music");\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       if (volume_modify_1 < 1)\r
+                       {\r
+                               volume_modify_1 += cvar("cl_vore_cutvolume_fade") * frametime;\r
+                               if(volume_modify_1 > 1)\r
+                                       volume_modify_1 = 1;\r
+                       }\r
+                       if (volume_modify_2 < 1)\r
+                       {\r
+                               volume_modify_2 += cvar("cl_vore_cutvolume_fade") * frametime;\r
+                               if(volume_modify_2 > 1)\r
+                                       volume_modify_2 = 1;\r
+                       }\r
+               }\r
+               cvar_set("volume", ftos(volume_modify_default_1 * volume_modify_1));\r
+               cvar_set("bgmvolume", ftos(volume_modify_default_2 * volume_modify_2));\r
+               // TODO: Setting the "volume" cvar is a bad way to go, and modifies the menu slider! We need a better way to go\r
+       }\r
+\r
        // Draw the mouse cursor\r
        // NOTE: drawpic must happen after R_RenderScene for some reason\r
        //drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);\r