]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/Main.qc
Make saturation depend on the amount of armor the player has (post process effect)
[voretournament/voretournament.git] / data / qcsrc / client / Main.qc
index cf29ae8aa8a3d7169f23faff3eb80f7cfe75c203..e4fadc50ff3906e52edf2c3101f304e0fbe03654 100644 (file)
@@ -68,7 +68,7 @@ void CSQC_Init(void)
        ClientProgsDB = db_load("client.db");\r
        compressShortVector_init();\r
 \r
-       drawfont = 0;\r
+       drawfont = FONT_USER+1;\r
        menu_visible = FALSE;\r
        menu_show = menu_show_error;\r
        menu_action = menu_sub_null;\r
@@ -88,6 +88,8 @@ void CSQC_Init(void)
        registercmd("-button3");\r
        registercmd("+button4");\r
        registercmd("-button4");\r
+       registercmd("+button6");\r
+       registercmd("-button6");\r
        registercmd("+showaccuracy");registercmd("-showaccuracy");\r
 \r
 #ifndef CAMERATEST\r
@@ -116,7 +118,7 @@ void CSQC_Init(void)
 \r
        postinit = false;\r
 \r
-       calledgrabbers = 0;\r
+       calledhooks = 0;\r
 \r
        teams = Sort_Spawn();\r
        players = Sort_Spawn();\r
@@ -141,6 +143,9 @@ void CSQC_Init(void)
                cl_announcer_prev = strzone(cvar_string("cl_announcer"));\r
        }\r
 \r
+       if(cvar("cl_reticle_item_normal")) precache_pic("gfx/reticle_normal");\r
+       if(cvar("cl_reticle_item_nex")) precache_pic("gfx/reticle_nex");\r
+\r
 #ifdef UID\r
        {\r
                // find the user ID\r
@@ -159,13 +164,13 @@ void CSQC_Init(void)
 #endif\r
 \r
        get_mi_min_max_texcoords(1); // try the CLEVER way first\r
-       minimapname = strcat("gfx/", mi_shortname, "_radar.tga");\r
+       minimapname = strcat("gfx/radar/", mi_shortname, "_radar.tga");\r
        shortmapname = mi_shortname;\r
 \r
        if(precache_pic(minimapname) == "")\r
        {\r
                // but maybe we have a non-clever minimap\r
-               minimapname = strcat("gfx/", mi_shortname, "_mini.tga");\r
+               minimapname = strcat("gfx/radar/", mi_shortname, "_mini.tga");\r
                if(precache_pic(minimapname) == "")\r
                        minimapname = ""; // FAIL\r
                else\r
@@ -203,12 +208,24 @@ void CSQC_Shutdown(void)
        if(camera_active)\r
                cvar_set("chase_active",ftos(chase_active_backup));\r
 \r
+       // unset the event chasecam's chase_active\r
+       if(cvar("chase_active") < 0)\r
+               cvar_set("chase_active", "0");\r
+\r
        if not(isdemo())\r
        {\r
-               if not(calledgrabbers & GRABBER_START)\r
+               if not(calledhooks & HOOK_START)\r
+               {\r
                        localcmd("\n_cl_hook_gamestart nop;");\r
-               if not(calledgrabbers & GRABBER_END)\r
+                       if(g_campaign) // this is a server cvar used in the client code, but g_campaign is always local, so it should be safe\r
+                               localcmd("\n_cl_hook_campaign_gamestart nop;");\r
+               }\r
+               if not(calledhooks & HOOK_END)\r
+               {\r
                        localcmd("\ncl_hook_gameend;");\r
+                       if(g_campaign)\r
+                               localcmd("\ncl_hook_campaign_gameend;");\r
+               }\r
        }\r
 }\r
 \r
@@ -387,6 +404,12 @@ float CSQC_ConsoleCommand(string strMessage)
        } else if(strCmd == "-button3") { // secondary\r
                button_attack2 = 0;\r
                return false;\r
+       } else if(strCmd == "+button6") { // secondary\r
+               button_jetpack = 1;\r
+               return false;\r
+       } else if(strCmd == "-button6") { // secondary\r
+               button_jetpack = 0;\r
+               return false;\r
        } else if(strCmd == "+showscores") {\r
                sb_showscores = true;\r
                return true;\r
@@ -933,22 +956,15 @@ void CSQC_Ent_Remove()
 \r
 void Gamemode_Init()\r
 {\r
-       if(gametype == GAME_ONSLAUGHT) {\r
+       if(gametype == GAME_ONSLAUGHT)\r
                print(strcat("Using ", minimapname, " as minimap.\n"));\r
-               precache_pic("gfx/ons-cp-neutral.tga");\r
-               precache_pic("gfx/ons-cp-red.tga");\r
-               precache_pic("gfx/ons-cp-blue.tga");\r
-               precache_pic("gfx/ons-frame.tga");\r
-               precache_pic("gfx/ons-frame-team.tga");\r
-       } else if(gametype == GAME_KEYHUNT) {\r
-               precache_pic("gfx/sb_key_carrying");\r
-               precache_pic("gfx/sb_key_carrying_outline");\r
-       }\r
 \r
        if not(isdemo())\r
        {\r
                localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";");\r
-               calledgrabbers |= GRABBER_START;\r
+               if(g_campaign)\r
+                       localcmd("\n_cl_hook_campaign_gamestart ", GametypeNameFromType(gametype), ";");\r
+               calledhooks |= HOOK_START;\r
        }\r
 }\r
 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided.  To execute standard behavior, simply execute localcmd with the string.\r
@@ -1010,12 +1026,16 @@ void Ent_Init()
                strunzone(forcefog);\r
        forcefog = strzone(ReadString());\r
 \r
+       g_campaign = ReadCoord();\r
+\r
        armorblockpercent = ReadByte() / 255.0;\r
 \r
        g_weaponswitchdelay = ReadByte() / 255.0;\r
 \r
+       g_vore = ReadCoord();\r
        g_balance_vore_swallow_limit = ReadCoord();\r
-       g_vore_showpreyhealth = ReadCoord();\r
+\r
+       armor_enabled = ReadByte();\r
 \r
        if(!postinit)\r
                PostInit();\r
@@ -1211,7 +1231,7 @@ void Net_ReadOtherPLReport()
        if not(playerslots[e])\r
                return;\r
        playerslots[e].plhealth = ph;\r
-       playerslots[e].pleater = pn;\r
+       playerslots[e].plpredator = pn;\r
 }\r
 \r
 void Net_VoteDialog(float highlight) {\r
@@ -1268,10 +1288,6 @@ float CSQC_Parse_TempEntity()
                        Net_ReadZCurveParticles();\r
                        bHandled = true;\r
                        break;\r
-               case TE_CSQC_NEXGUNBEAMPARTICLE:\r
-                       Net_ReadNexgunBeamParticle();\r
-                       bHandled = true;\r
-                       break;\r
                case TE_CSQC_TEAMNAGGER:\r
                        Net_TeamNagger();\r
                        bHandled = true;\r