// =============================================================================== // DESCRIPTION: Abstract class for game // CALLED BY: // PARAMS: // TYPE: Server-Side // =============================================================================== // Init ========================================================================== @INIT if [__debug == 1] goto DEBUG goto SCRIPT // =============================================================================== // Debug ========================================================================= @DEBUG Echo #__debug_prefix#"Calling script _SVR_GAME" goto SCRIPT // =============================================================================== // Script ======================================================================== @SCRIPT if [__debug == 1] Echo #__debug_prefix#"Calling method _SVR_GAME::"#GetScriptParam(::)# goto #GetScriptParam(::)# goto EOF @RESET Set __game_blocking true Set __reset_max_idx [__clients_max_idx + 50] Set parter_idx 0 goto PARTER goto EOF @RESET_JOIN Set joiner_idx 0 Set __join_max_idx [__clients_max_idx + 50] sleep 1000 goto JOINER goto EOF @PARTER Set _tmp_index #GetIndexFromClientNum(|#parter_idx|#)# if [_tmp_index > 0] "ExecScript _SVR_PLAYER :: PART clientid #parter_idx#; sleep 100" @nextParter Set parter_idx [parter_idx + 1] if [parter_idx < __reset_max_idx] "goto PARTER" goto RESET_JOIN goto EOF @JOINER Set _tmp_index #GetIndexFromClientNum(|#joiner_idx|#)# if [_tmp_index > 0] "ExecScript _SVR_PLAYER :: JOIN clientid #joiner_idx#; sleep 100" @nextJoiner Set joiner_idx [joiner_idx + 1] if [joiner_idx < __join_max_idx] "goto JOINER" Set __game_blocking false goto #GetScriptParam(do)# goto EOF @STOP_POWERUPS ExecScript _SVR_POWERUP :: TERMINATE goto EOF @INIT_POWERUPS ExecScript _SVR_POWERUP :: POPULATE goto EOF @START if [__game_started] goto EOF if [__game_blocking] goto EOF if [__clients < __start_game_min] goto EOF Set __timer_start #GetGameTime()# Set __game_started true ExecScript __FRAME_LOOP :: START_PROGRESS SendMessage -1 "^r["#__name#"] ^y Game has STARTED!" Set __timer_start #GetGameTime()# ExecScript _SVR_GAME :: INIT_POWERUPS goto EOF @STOP if [! __game_started] goto EOF if [__game_blocking] goto EOF Set __game_started false ExecScript __FRAME_LOOP :: STOP_PROGRESS SendMessage -1 "^r["#__name#"] ^y Game has ended!" ExecScript _SVR_GAME :: STOP_POWERUPS goto EOF @WINNER SendMessage -1 "^r["#__name#"] ^y WINNER! TEAM"#GetScriptParam(teamidx)#" WINS! respawning in 5 seconds." ExecScript _SVR_GAME :: STOP sleep 5000 ExecScript _SVR_GAME :: RESET goto EOF @EOF