diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 7d95a30cb3..7bb5fa4e93 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -8,42 +8,6 @@ /datum/controller/subsystem/ticker/proc/gather_roundend_feedback() //Survivor numbers var/clients = GLOB.player_list.len - var/surviving_humans = 0 - var/surviving_total = 0 - var/ghosts = 0 - var/escaped_humans = 0 - var/escaped_total = 0 - - for(var/mob/M in GLOB.player_list) - if(ishuman(M)) - if(!M.stat) - surviving_humans++ - if(M.z == ZLEVEL_CENTCOM) - escaped_humans++ - if(!M.stat) - surviving_total++ - if(M.z == ZLEVEL_CENTCOM) - escaped_total++ - - if(isobserver(M)) - ghosts++ - - if(clients) - SSblackbox.record_feedback("nested tally", "round_end_stats", clients, list("clients")) - if(ghosts) - SSblackbox.record_feedback("nested tally", "round_end_stats", ghosts, list("ghosts")) - if(surviving_humans) - SSblackbox.record_feedback("nested tally", "round_end_stats", surviving_humans, list("survivors", "human")) - if(surviving_total) - SSblackbox.record_feedback("nested tally", "round_end_stats", surviving_total, list("survivors", "total")) - if(escaped_humans) - SSblackbox.record_feedback("nested tally", "round_end_stats", escaped_humans, list("escapees", "human")) - if(escaped_total) - SSblackbox.record_feedback("nested tally", "round_end_stats", escaped_total, list("escapees", "total")) - - gather_antag_success_rate() - -/datum/controller/subsystem/ticker/proc/gather_antag_success_rate() var/popcount = count_survivors() SSblackbox.record_feedback("nested tally", "round_end_stats", clients, list("clients")) SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_GHOSTS], list("ghosts")) @@ -85,7 +49,6 @@ antag_info["objectives"] += list(list("objective_type"=O.type,"text"=O.explanation_text,"result"=result)) SSblackbox.record_feedback("associative", "antagonists", 1, antag_info) - /datum/controller/subsystem/ticker/proc/record_nuke_disk_location() var/obj/item/disk/nuclear/N = locate() in GLOB.poi_list if(N) @@ -105,17 +68,45 @@ SSblackbox.record_feedback("associative", "roundend_nukedisk", 1 , data) +/datum/controller/subsystem/ticker/proc/gather_newscaster() + var/json_file = file("[GLOB.log_directory]/newscaster.json") + var/list/file_data = list() + var/pos = 1 + for(var/V in GLOB.news_network.network_channels) + var/datum/newscaster/feed_channel/channel = V + if(!istype(channel)) + stack_trace("Non-channel in newscaster channel list") + continue + file_data["[pos]"] = list("channel name" = "[channel.channel_name]", "author" = "[channel.author]", "censored" = channel.censored ? 1 : 0, "author censored" = channel.authorCensor ? 1 : 0, "messages" = list()) + for(var/M in channel.messages) + var/datum/newscaster/feed_message/message = M + if(!istype(message)) + stack_trace("Non-message in newscaster channel messages list") + continue + var/list/comment_data = list() + for(var/C in message.comments) + var/datum/newscaster/feed_comment/comment = C + if(!istype(comment)) + stack_trace("Non-message in newscaster message comments list") + continue + comment_data += list(list("author" = "[comment.author]", "time stamp" = "[comment.time_stamp]", "body" = "[comment.body]")) + file_data["[pos]"]["messages"] += list(list("author" = "[message.author]", "time stamp" = "[message.time_stamp]", "censored" = message.bodyCensor ? 1 : 0, "author censored" = message.authorCensor ? 1 : 0, "photo file" = "[message.photo_file]", "photo caption" = "[message.caption]", "body" = "[message.body]", "comments" = comment_data)) + pos++ + if(GLOB.news_network.wanted_issue.active) + file_data["wanted"] = list("author" = "[GLOB.news_network.wanted_issue.scannedUser]", "criminal" = "[GLOB.news_network.wanted_issue.criminal]", "description" = "[GLOB.news_network.wanted_issue.body]", "photo file" = "[GLOB.news_network.wanted_issue.photo_file]") + WRITE_FILE(json_file, json_encode(file_data)) + /datum/controller/subsystem/ticker/proc/declare_completion() set waitfor = FALSE - to_chat(world, "


The round has ended.") + to_chat(world, "


The round has ended.") if(LAZYLEN(GLOB.round_end_notifiees)) send2irc("Notice", "[GLOB.round_end_notifiees.Join(", ")] the round has ended.") - /*for(var/client/C in GLOB.clients) + for(var/client/C in GLOB.clients) if(!C.credits) C.RollCredits() - C.playtitlemusic(40)*/ + C.playtitlemusic(40) display_report() @@ -136,7 +127,7 @@ send2irc("Server", "Round just ended.") - if(CONFIG_GET(string/cross_server_address)) + if(length(CONFIG_GET(keyed_string_list/cross_server))) send_news_report() CHECK_TICK @@ -240,7 +231,7 @@ num_human_escapees++ if(shuttle_areas[get_area(Player)]) num_shuttle_escapees++ - + .[POPCOUNT_SURVIVORS] = num_survivors .[POPCOUNT_ESCAPEES] = num_escapees .[POPCOUNT_SHUTTLE_ESCAPEES] = num_shuttle_escapees @@ -252,7 +243,7 @@ var/list/parts = list() var/station_evacuated = EMERGENCY_ESCAPED_OR_ENDGAMED var/popcount = count_survivors() - + //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() @@ -404,7 +395,7 @@ currrent_category = A.roundend_category previous_category = A result += A.roundend_report() - result += "
" + result += "

" if(all_antagonists.len) var/datum/antagonist/last = all_antagonists[all_antagonists.len] @@ -451,7 +442,7 @@ text += " survived" if(fleecheck) var/turf/T = get_turf(ply.current) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) text += " while fleeing the station" if(ply.current.real_name != ply.name) text += " as [ply.current.real_name]"