From 3b96d7495531128ec7ce9a357efb340ba660cdc4 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Tue, 28 Apr 2015 23:00:42 -0600 Subject: [PATCH] Admins can now adjust pre-game delay time Instead of just a simple Pause/Play toggle, it lets admins set a longer (or shorter) time if they want. Admins can still set -1 for indefinite delays. --- code/controllers/subsystem/ticker.dm | 2 ++ code/modules/admin/admin.dm | 22 ++++++++------ code/modules/mob/new_player/new_player.dm | 2 +- html/changelogs/Ikarrus-Delay.yml | 36 +++++++++++++++++++++++ 4 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 html/changelogs/Ikarrus-Delay.yml diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c33ecb81ac9..58758fc0d72 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -78,6 +78,8 @@ var/datum/subsystem/ticker/ticker ++totalPlayersReady //countdown + if(timeLeft < 0) + return timeLeft -= wait if(timeLeft <= 30 && !tipped) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d9a4d08f85b..0e489180a1e 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -634,17 +634,21 @@ var/global/floorIsLava = 0 /datum/admins/proc/delay() set category = "Server" set desc="Delay the game start" - set name="Delay" + set name="Delay pre-game" + + var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(ticker.timeLeft/10)) as num|null if(ticker.current_state > GAME_STATE_PREGAME) return alert("Too late... The game has already started!") - ticker.can_fire = !ticker.can_fire - if(!ticker.can_fire) - world << "The game start has been delayed." - log_admin("[key_name(usr)] delayed the game.") - else - world << "The game will start soon." - log_admin("[key_name(usr)] removed the delay.") - feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + if(newtime) + ticker.timeLeft = newtime * 10 + if(newtime < 0) + world << "The game start has been delayed." + log_admin("[key_name(usr)] delayed the round start.") + else + world << "The game will start in [newtime] seconds." + world << 'sound/ai/attention.ogg' + log_admin("[key_name(usr)] set the pre-game delay to [newtime] seconds.") + feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/immreboot() set category = "Server" diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 70a8b157f64..2c0451396e9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -69,7 +69,7 @@ stat("Game Mode:", (ticker.hide_mode) ? "Secret" : "[master_mode]") if(ticker.current_state == GAME_STATE_PREGAME) - stat("Time To Start:", (ticker.can_fire) ? "[round(ticker.timeLeft / 10)]s" : "DELAYED") + stat("Time To Start:", (ticker.timeLeft >= 0) ? "[round(ticker.timeLeft / 10)]s" : "DELAYED") stat("Players:", "[ticker.totalPlayers]") if(client.holder) diff --git a/html/changelogs/Ikarrus-Delay.yml b/html/changelogs/Ikarrus-Delay.yml new file mode 100644 index 00000000000..03c6f0b7239 --- /dev/null +++ b/html/changelogs/Ikarrus-Delay.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# spellcheck (typo fixes) +# experiment +# tgs (TG-ported fixes?) +################################# + +# Your name. +author: Ikarrus + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Admins can now adjust the pre-game delay time." \ No newline at end of file