/* ---------------------------------------- V.I.P - Created by: Ch0wW - Original Date: 18/07/13 - Last Update: 09/12/13 http://www.baseq.fr ---------------------------------------- */ #include "FCT_CODINGLIB.txt" #define CVAR_TIMESTART "fct_timestart" int iPlayers; int iPlayerNB; bool bGameWin = false; #define DEFAULT_TIME 31 int iTimer; script 900 OPEN { int i; int iColor; if (!CVAR_Get("sv_acs_world_exit")) { print (s:"SV_ACS_WORLD_EXIT MUST BE SET TO 1!!!!"); terminate; } if (!CVAR_Get("sv_noexit")) { print (s:"SV_NOEXIT MUST BE SET TO 1!!!!"); terminate; } while (iPlayers == 0 ) { delay (5); } if (CVAR_Get(CVAR_TIMESTART) == 0) iTimer = DEFAULT_TIME; else iTimer = CVAR_Get(CVAR_TIMESTART); ACS_ExecuteAlways (905, 0,0,0,0); // About Monsters verification while (iTimer >= 1) { if (!bGameWin) { iTimer--; if (iTimer <= 5) iColor = CR_BRICK; else if (iTimer <= 15) iColor = CR_YELLOW; else if (iTimer <= 90) iColor = CR_GREEN; else iColor = CR_WHITE; SetFont ("BIGFONT"); HUDMessageBold (s:"Time left: ", d:iTimer; HUDMSG_PLAIN, 40, iColor, 0.5, 0.15, 0); } delay (GAMETIC_SECOND); } SetFont ("BIGFONT"); HUDMessageBold (s:"YOU FAILED! "; HUDMSG_PLAIN, 50, CR_GOLD, 0.5, 0.5, 0); for (i = PLAYER_DEFAULT_TID ; i < PLAYER_DEFAULT_TID+iPlayers ; i++) { Thing_Damage(i, 99999999999999999, MOD_EXIT); // Killing time! } } script 901 ENTER { Thing_ChangeTID(0, PLAYER_DEFAULT_TID+iPlayers ); iPlayerNB++; iPlayers++; } script 902 (int TimeAdded) { iTimer += TimeAdded; } script 903 DEATH { iPlayerNB--; } script 905 (void) { while ( GetLevelInfo(LEVELINFO_KILLED_MONSTERS) <= GetLevelInfo(LEVELINFO_TOTAL_MONSTERS) ) { HUDMessageBold (s:"Monsters killed: ", d:GetLevelInfo(LEVELINFO_KILLED_MONSTERS), s:" / ", d:GetLevelInfo(LEVELINFO_TOTAL_MONSTERS) ; HUDMSG_PLAIN, 41, CR_WHITE, 0.1, 0.20, 0); delay (5); } bGameWin = true; SetFont ("BIGFONT"); HUDMessageBold (s:"Good Job!"; HUDMSG_PLAIN, 45, CR_GOLD, 0.5, 0.5, 0); delay (5 * GAMETIC_SECOND); Exit_Normal(0); }