Skip to content
Merged
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
11 changes: 2 additions & 9 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@

/datum/controller/subsystem/ticker/proc/survivor_report(popcount)
var/list/parts = list()
var/station_evacuated = round_end

if(GLOB.round_id)
var/statspage = CONFIG_GET(string/roundstatsurl)
Expand All @@ -321,8 +320,6 @@
var/total_players = GLOB.joined_player_list.len
if(total_players)
parts+= "[FOURSPACES]Total Population: <B>[total_players]</B>"
if(station_evacuated)
parts += "<BR>[FOURSPACES]Evacuation Rate: <B>[popcount[POPCOUNT_ESCAPEES]] ([PERCENT(popcount[POPCOUNT_ESCAPEES]/total_players)]%)</B>"
parts += "[FOURSPACES]Survival Rate: <B>[popcount[POPCOUNT_SURVIVORS]] ([PERCENT(popcount[POPCOUNT_SURVIVORS]/total_players)]%)</B>"
if(SSblackbox.first_death)
var/list/ded = SSblackbox.first_death
Expand Down Expand Up @@ -360,12 +357,8 @@
var/mob/M = C.mob
if(M.mind && !isnewplayer(M))
if(M.stat != DEAD && !isbrain(M))
if(round_end)
parts += "<div class='panel greenborder'>"
parts += "<span class='greentext'>I managed to survive the events on [station_name()] as [M.real_name].</span>"
else
parts += "<div class='panel greenborder'>"
parts += "<span class='greentext'>I managed to survive the events on [station_name()] as [M.real_name].</span>"
parts += "<div class='panel greenborder'>"
parts += "<span class='greentext'>I managed to survive the events on [station_name()] as [M.real_name].</span>"

else
parts += "<div class='panel redborder'>"
Expand Down
48 changes: 31 additions & 17 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ SUBSYSTEM_DEF(ticker)
var/end_party = FALSE
var/last_lobby = 0
var/reboot_anyway
var/round_end = FALSE

var/next_lord_check = 0
var/missing_lord_time = 0
Expand All @@ -100,7 +99,10 @@ SUBSYSTEM_DEF(ticker)
"I'm going to lose my mind if we don't get a Ruler readied up.",
"No. The game will not start because there is no Ruler.",
"What's the point of Vanderlin without a Ruler?"
)
)

/// ID of round reboot timer, if it exists
var/reboot_timer = null

/datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode()
Expand Down Expand Up @@ -637,38 +639,50 @@ SUBSYSTEM_DEF(ticker)

var/skip_delay = check_rights()
if(delay_end && !skip_delay)
to_chat(world, span_boldannounce("A game master has delayed the round end."))
to_chat(world, span_boldannounce("An admin has delayed the round end."))
return

SStriumphs.end_triumph_saving_time()
to_chat(world, span_boldannounce("Rebooting World in [DisplayTimeText(delay)]. [reason]"))

round_end = TRUE
var/start_wait = world.time
UNTIL(round_end_sound_sent || (world.time - start_wait) > (delay * 2)) //don't wait forever
sleep(delay - (world.time - start_wait))

if(delay_end && !skip_delay)
to_chat(world, span_boldannounce("Reboot was cancelled by an admin."))
round_end = FALSE
return

var/start_wait = world.time
UNTIL(round_end_sound_sent || (world.time - start_wait) > (delay * 2)) //don't wait forever
reboot_timer = addtimer(CALLBACK(src, PROC_REF(reboot_callback), reason, end_string), delay - (world.time - start_wait), TIMER_STOPPABLE)

/datum/controller/subsystem/ticker/proc/reboot_callback(reason, end_string)
if(end_string)
end_state = end_string

SStriumphs.end_triumph_saving_time()

var/statspage = CONFIG_GET(string/roundstatsurl)
var/gamelogloc = CONFIG_GET(string/gamelogurl)
if(statspage)
to_chat(world, span_info("Round statistics and logs can be viewed <a href=\"[statspage][GLOB.round_id]\">at this website!</a>"))
else if(gamelogloc)
to_chat(world, span_info("Round logs can be located <a href=\"[gamelogloc]\">at this website!</a>"))

log_game("Rebooting World. [reason]")

if(end_party)
to_chat(world, span_boldannounce("It's over!"))
world.Del()
else
world.Reboot()
log_game(span_boldannounce("Rebooting World. [reason]"))

world.Reboot()

/**
* Deletes the current reboot timer and nulls the var
*
* Arguments:
* * user - the user that cancelled the reboot, may be null
*/
/datum/controller/subsystem/ticker/proc/cancel_reboot(mob/user)
if(!reboot_timer)
to_chat(user, span_warning("There is no pending reboot!"))
return FALSE
to_chat(world, span_boldannounce("An admin has delayed the round end."))
deltimer(reboot_timer)
reboot_timer = null
return TRUE

/datum/controller/subsystem/ticker/Shutdown()
save_admin_data()
Expand Down
Loading