Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds round end to status tab #4460

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SUBSYSTEM_DEF(ticker)
var/start_at

var/roundend_check_paused = FALSE
var/roundend_restart_delay

var/round_start_time = 0
var/list/round_start_events
Expand Down Expand Up @@ -97,6 +98,7 @@ SUBSYSTEM_DEF(ticker)

if(!roundend_check_paused && mode.check_finished(force_ending) || force_ending)
current_state = GAME_STATE_FINISHED
roundend_restart_delay = CONFIG_GET(number/round_end_countdown)
ooc_allowed = TRUE
mode.declare_completion(force_ending)
REDIS_PUBLISH("byond.round", "type" = "round-complete")
Expand Down Expand Up @@ -362,13 +364,17 @@ SUBSYSTEM_DEF(ticker)
var/skip_delay = check_rights()
if(delay_end && !skip_delay)
to_chat(world, SPAN_BOLDNOTICE("An admin has delayed the round end."))
SSticker.mode.round_end_time = -1
return

to_chat(world, SPAN_BOLDNOTICE("Rebooting World in [DisplayTimeText(delay)]. [reason]"))

var/start_wait = world.time
sleep(delay - (world.time - start_wait))
SSticker.mode.round_end_time = delay + world.time
addtimer(CALLBACK(src, PROC_REF(standard_reboot), reason, skip_delay), delay)

///Generic round-end reboot
/datum/controller/subsystem/ticker/proc/standard_reboot(reason, skip_delay)
SSticker.mode.round_end_time = -1
if(delay_end && !skip_delay)
to_chat(world, SPAN_BOLDNOTICE("Reboot was cancelled by an admin."))
return
Expand Down
3 changes: 3 additions & 0 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki
var/required_players = 0
var/required_players_secret = 0 //Minimum number of players for that game mode to be chose in Secret
var/ert_disabled = 0
/// Time that hijack force ends at
var/force_end_at = 0
/// Time server restarts (without delays)
var/round_end_time = 0
var/xeno_evo_speed = 0 // if not 0 - gives xeno an evo boost/nerf
var/is_in_endgame = FALSE //Set it to TRUE when we trigger DELTA alert or dropship crashes
/// When set and this gamemode is selected, the taskbar icon will change to the png selected here
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(eta_status)
. += "Evacuation: [eta_status]"

if(SSticker.current_state == GAME_STATE_FINISHED)
var/round_end_timer = "Time To Restart: [(SSticker.roundend_restart_delay + (SSticker.mode.round_end_time - world.time)) / 10 ]s [SSticker.delay_end ? "(DELAYED)" : ""]"
if(SSticker.mode.round_end_time == 0)
round_end_timer = "Time To Restart: Ongoing Vote [SSticker.delay_end ? "(DELAYED)" : ""]"
if(SSticker.mode.round_end_time < 0)
round_end_timer = "Time To Restart: SOON [SSticker.delay_end ? "(DELAYED)" : "(MANUAL RESTART NEEDED)"]"
. += round_end_timer

/proc/message_ghosts(message)
for(var/mob/dead/observer/O as anything in GLOB.observer_list)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
. += ""
. += "Game Mode: [GLOB.master_mode]"

if(SSticker.current_state == GAME_STATE_FINISHED)
var/round_end_timer = "Time To Restart: [(SSticker.roundend_restart_delay + (SSticker.mode.round_end_time - world.time)) / 10 ]s [SSticker.delay_end ? "(DELAYED)" : ""]"
if(SSticker.mode.round_end_time == 0)
round_end_timer = "Time To Restart: Ongoing Vote [SSticker.delay_end ? "(DELAYED)" : ""]"
if(SSticker.mode.round_end_time < 0)
round_end_timer = "Time To Restart: SOON [SSticker.delay_end ? "(DELAYED)" : "(MANUAL RESTART NEEDED)"]"
. += round_end_timer

if(SSticker.HasRoundStarted())
return

Expand Down