Merge pull request #5606 from Citadel-Station-13/upstream-merge-35582
[MIRROR] The end-round report now shows the name, area, ckey, damage taken, and last words of the first person to die that round
This commit is contained in:
@@ -277,6 +277,12 @@
|
||||
parts += "<BR>[GLOB.TAB]Evacuation Rate: <B>[popcount[POPCOUNT_ESCAPEES]] ([PERCENT(popcount[POPCOUNT_ESCAPEES]/total_players)]%)</B>"
|
||||
parts += "[GLOB.TAB](on emergency shuttle): <B>[popcount[POPCOUNT_SHUTTLE_ESCAPEES]] ([PERCENT(popcount[POPCOUNT_SHUTTLE_ESCAPEES]/total_players)]%)</B>"
|
||||
parts += "[GLOB.TAB]Survival Rate: <B>[popcount[POPCOUNT_SURVIVORS]] ([PERCENT(popcount[POPCOUNT_SURVIVORS]/total_players)]%)</B>"
|
||||
if(SSblackbox.first_death)
|
||||
var/list/ded = SSblackbox.first_death
|
||||
if(ded.len)
|
||||
parts += "[GLOB.TAB]First Death: <b>[ded["name"]], [ded["role"]], at [ded["area"]]. Damage taken: [ded["damage"]].[ded["last_words"] ? " Their last words were: \"[ded["last_words"]]\"" : ""]</b>"
|
||||
else
|
||||
parts += "[GLOB.TAB]<i>Nobody died this shift!</i>"
|
||||
return parts.Join("<br>")
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/show_roundend_report(client/C,common_report, popcount)
|
||||
|
||||
@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
init_order = INIT_ORDER_BLACKBOX
|
||||
|
||||
var/list/feedback = list() //list of datum/feedback_variable
|
||||
var/list/first_death = list() //the first death of this round, assoc. vars keep track of different things
|
||||
var/triggertime = 0
|
||||
var/sealed = FALSE //time to stop tracking stats?
|
||||
var/list/versions = list("antagonists" = 3,
|
||||
@@ -260,6 +261,8 @@ Versioning
|
||||
return
|
||||
if(!L || !L.key || !L.mind)
|
||||
return
|
||||
var/brute = L.getBruteLoss()
|
||||
var/fire = L.getFireLoss()
|
||||
var/area/placeofdeath = get_area(L)
|
||||
var/sqlname = sanitizeSQL(L.real_name)
|
||||
var/sqlkey = sanitizeSQL(L.ckey)
|
||||
@@ -268,8 +271,8 @@ Versioning
|
||||
var/sqlpod = sanitizeSQL(placeofdeath.name)
|
||||
var/laname = sanitizeSQL(L.lastattacker)
|
||||
var/lakey = sanitizeSQL(L.lastattackerckey)
|
||||
var/sqlbrute = sanitizeSQL(L.getBruteLoss())
|
||||
var/sqlfire = sanitizeSQL(L.getFireLoss())
|
||||
var/sqlbrute = sanitizeSQL(brute)
|
||||
var/sqlfire = sanitizeSQL(fire)
|
||||
var/sqlbrain = sanitizeSQL(L.getBrainLoss())
|
||||
var/sqloxy = sanitizeSQL(L.getOxyLoss())
|
||||
var/sqltox = sanitizeSQL(L.getToxLoss())
|
||||
@@ -281,5 +284,13 @@ Versioning
|
||||
var/last_words = sanitizeSQL(L.last_words)
|
||||
var/suicide = sanitizeSQL(L.suiciding)
|
||||
var/map = sanitizeSQL(SSmapping.config.map_name)
|
||||
if(!suicide && !first_death.len) //some of the things in here are not SQL-sanitized because they're only stored locally, and sanitized versions do not appear to show correctly
|
||||
first_death["name"] = L.name
|
||||
first_death["role"] = null
|
||||
if(L.mind.assigned_role)
|
||||
first_death["role"] = L.mind.assigned_role
|
||||
first_death["area"] = "[get_area_name(L, TRUE)] [COORD(L)]"
|
||||
first_death["damage"] = "<font color='#FF5555'>[brute]</font>/<font color='orange'>[fire]</font>/<font color='lightgreen'>[L.toxloss]</font>/<font color='lightblue'>[L.oxyloss]</font>/<font color='pink'>[L.cloneloss]</font>"
|
||||
first_death["last_words"] = L.last_words
|
||||
var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, last_words, suicide) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], '[last_words]', [suicide])")
|
||||
query_report_death.Execute()
|
||||
|
||||
@@ -32,6 +32,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
SCRIPTURE_SCRIPT = FALSE, \
|
||||
SCRIPTURE_APPLICATION = FALSE) //list of clockcult scripture states for announcements
|
||||
|
||||
var/list/first_death = list() //contains info about the first player to die; ckey, name, location, and last words
|
||||
|
||||
var/delay_end = 0 //if set true, the round will not restart on it's own
|
||||
var/admin_delay_notice = "" //a message to display to anyone who tries to restart the world after a delay
|
||||
var/ready_for_reboot = FALSE //all roundend preparation done with, all that's left is reboot
|
||||
|
||||
@@ -74,6 +74,16 @@
|
||||
|
||||
if (client)
|
||||
client.move_delay = initial(client.move_delay)
|
||||
if(!suiciding && !SSticker.first_death.len) //suicides don't clog up the list, only BRUTAL deaths here
|
||||
var/list/L = list()
|
||||
L["name"] = name
|
||||
L["role"] = null
|
||||
if(mind.assigned_role)
|
||||
L["role"] = mind.assigned_role
|
||||
L["area"] = "[get_area_name(src, TRUE)] [COORD(src)]"
|
||||
L["damage"] = "<font color='#FF5555'>[bruteloss]</font>/<font color='orange'>[fireloss]</font>/<font color='lightgreen'>[toxloss]</font>/<font color='lightblue'>[oxyloss]</font>/<font color='pink'>[cloneloss]</font>"
|
||||
L["last_words"] = last_words
|
||||
SSticker.first_death = L
|
||||
|
||||
for(var/s in ownedSoullinks)
|
||||
var/datum/soullink/S = s
|
||||
|
||||
Reference in New Issue
Block a user