From fe8192ed6536f91473c779cd40e5afb81da365c6 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Fri, 1 Jun 2012 03:20:50 +0100 Subject: [PATCH] Records system. You can now set your characters Medical and Security records. Remember, these are official NanoTrasen records, and should be written as such. Admins can ban people from using records by selecting 'Records' from the jobban panel. --- code/game/machinery/computer/computer.dm | 55 +++++++++++++--- code/modules/admin/admin.dm | 18 ++++++ code/modules/mob/mob_defines.dm | 2 + code/modules/mob/new_player/new_player.dm | 58 ++++++++++++++--- code/modules/mob/new_player/preferences.dm | 73 +++++++++++++++++++++- code/modules/mob/new_player/savefile.dm | 4 ++ 6 files changed, 189 insertions(+), 21 deletions(-) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index e78c65031b5..ef311774f78 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -161,7 +161,7 @@ Pod/Blast Doors computer M.fields["id"] = G.fields["id"] S.fields["name"] = G.fields["name"] S.fields["id"] = G.fields["id"] - if (H.gender == FEMALE) + if(H.gender == FEMALE) G.fields["sex"] = "Female" else G.fields["sex"] = "Male" @@ -171,21 +171,58 @@ Pod/Blast Doors computer G.fields["m_stat"] = "Stable" M.fields["b_type"] = text("[]", H.dna.b_type) M.fields["b_dna"] = H.dna.unique_enzymes - M.fields["mi_dis"] = "None" - M.fields["mi_dis_d"] = "No minor disabilities have been declared." - M.fields["ma_dis"] = "None" - M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + + var/minor_dis = null + if(H.disabilities) + if(H.disabilities & 1) + minor_dis += "Myopia, " + if(H.disabilities & 4) + minor_dis += "Persistant Cough, " + if(H.disabilities & 16) + minor_dis += "Stuttering, " + if(minor_dis) + M.fields["mi_dis"] = minor_dis + else + M.fields["mi_dis"] = "None" + + M.fields["mi_dis_d"] = "No additional minor disability notes." + + var/major_dis = null + if(H.disabilities) + if(H.disabilities & 2) + major_dis += "Epilepsy, " + if(H.disabilities & 8) + major_dis += "Tourette's Syndrome, " + if(H.disabilities & 32) + major_dis += "Deafness, " + if(major_dis) + M.fields["ma_dis"] = major_dis + else + M.fields["ma_dis"] = "None" + + M.fields["ma_dis_d"] = "No additional major disability notes." M.fields["alg"] = "None" - M.fields["alg_d"] = "No allergies have been detected in this patient." + M.fields["alg_d"] = "No additional allergy notes." M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = "No notes." + M.fields["cdi_d"] = "No additional disease notes." + + if(H.med_record && !jobban_isbanned(H, "Records")) + M.fields["notes"] = H.med_record + else + M.fields["notes"] = "No notes found." + S.fields["criminal"] = "None" S.fields["mi_crim"] = "None" S.fields["mi_crim_d"] = "No minor crime convictions." S.fields["ma_crim"] = "None" S.fields["ma_crim_d"] = "No major crime convictions." - S.fields["notes"] = "No notes." + + if(H.sec_record && !jobban_isbanned(H, "Records")) + S.fields["notes"] = H.sec_record + else + S.fields["notes"] = "No notes." + + //Begin locked reporting L.fields["name"] = H.real_name diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 2b29c7e5ad1..d0f0b72f56a 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -515,6 +515,17 @@ var/global/BSACooldown = 0 else jobs += "[dd_replacetext("Emergency Response Team", " ", " ")]" + //Misc (Grey) + jobs += "" + jobs += "" + + //Records + if(jobban_isbanned(M, "Records")) + jobs += "" + else + jobs += "" + + /* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment if(jobban_isbanned(M, "malf AI") || isbanned_dept) @@ -601,6 +612,13 @@ var/global/BSACooldown = 0 var/datum/job/temp = job_master.GetJob(jobPos) if(!temp) continue joblist += temp.title + if("miscdept") + joblist += "pAI" + for(var/jobPos in nonhuman_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title else joblist += href_list["jobban3"] diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index f72051a457a..7ef6542467b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -98,6 +98,8 @@ var/real_name = null var/original_name = null //Original name is only used in ghost chat! It is not to be edited by anything! var/flavor_text = "" + var/med_record = "" + var/sec_record = "" var/blinded = null var/bhunger = 0//Carbon var/ajourn = 0 diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 431230e350b..ec9484a289e 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -301,7 +301,7 @@ proc/ManifestLateSpawn(var/mob/living/carbon/human/H, icon/H_icon) // Attempted fix to add late joiners to various databases -- TLE - // This is basically ripped wholesale from the normal code for adding people to the databases during a fresh round + // This is basically ripped wholesale from the normal code for adding people to the databases during a fresh round //Erth Mark if (!isnull(H.mind) && (H.mind.assigned_role != "MODE")) var/datum/data/record/G = new() var/datum/data/record/M = new() @@ -310,10 +310,11 @@ var/obj/item/weapon/card/id/C = H.wear_id if (C) G.fields["rank"] = C.assignment + G.fields["real_rank"] = H.mind.assigned_role else if(H.mind && H.mind.assigned_role) - G.fields["rank"] = H.mind.assigned_role + G.fields["rank"] = H.mind.role_alt_title ? H.mind.role_alt_title : H.mind.assigned_role G.fields["real_rank"] = H.mind.assigned_role else G.fields["rank"] = "Unassigned" @@ -334,21 +335,58 @@ G.fields["m_stat"] = "Stable" M.fields["b_type"] = text("[]", H.dna.b_type) M.fields["b_dna"] = H.dna.unique_enzymes - M.fields["mi_dis"] = "None" - M.fields["mi_dis_d"] = "No minor disabilities have been declared." - M.fields["ma_dis"] = "None" - M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + + var/minor_dis = null + if(H.disabilities) + if(H.disabilities & 1) + minor_dis += "Myopia, " + if(H.disabilities & 4) + minor_dis += "Persistant Cough, " + if(H.disabilities & 16) + minor_dis += "Stuttering, " + if(minor_dis) + M.fields["mi_dis"] = minor_dis + else + M.fields["mi_dis"] = "None" + + M.fields["mi_dis_d"] = "No additional minor disability notes." + + var/major_dis = null + if(H.disabilities) + if(H.disabilities & 2) + major_dis += "Epilepsy, " + if(H.disabilities & 8) + major_dis += "Tourette's Syndrome, " + if(H.disabilities & 32) + major_dis += "Deafness, " + if(major_dis) + M.fields["ma_dis"] = major_dis + else + M.fields["ma_dis"] = "None" + + M.fields["ma_dis_d"] = "No additional major disability notes." M.fields["alg"] = "None" - M.fields["alg_d"] = "No allergies have been detected in this patient." + M.fields["alg_d"] = "No additional allergy notes." M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = "No notes." + M.fields["cdi_d"] = "No additional disease notes." + + if(H.med_record && !jobban_isbanned(H, "Records")) + M.fields["notes"] = H.med_record + else + M.fields["notes"] = "No notes found." + S.fields["criminal"] = "None" S.fields["mi_crim"] = "None" S.fields["mi_crim_d"] = "No minor crime convictions." S.fields["ma_crim"] = "None" S.fields["ma_crim_d"] = "No major crime convictions." - S.fields["notes"] = "No notes." + + if(H.sec_record && !jobban_isbanned(H, "Records")) + S.fields["notes"] = H.sec_record + else + S.fields["notes"] = "No notes." + + //Begin locked reporting L.fields["name"] = H.real_name diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 615d09231cb..e810b05b301 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -126,6 +126,9 @@ datum/preferences var/flavor_text = "" + var/med_record = "" + var/sec_record = "" + // slot stuff (Why were they var/var? --SkyMarshal) var/slotname var/curslot = 0 @@ -320,6 +323,10 @@ datum/preferences dat += "
Disabilities
" + if(jobban_isbanned(user, "Records")) + dat += "
You are banned from using character records.
" + else + dat += "
Character Records
" dat += "
Flavor Text
" dat += "Change
" if(lentext(flavor_text) <= 40) @@ -392,6 +399,33 @@ datum/preferences user << browse(HTML, "window=disabil;size=350x300") return + proc/SetRecords(mob/user) + var/HTML = "" + HTML += "
" + HTML += "Set Character Records
" + + HTML += "Medical Records
" + + if(lentext(med_record) <= 40) + HTML += "
[med_record]
" + else + HTML += "
[copytext(med_record, 1, 37)]...
" + + HTML += "Security Records
" + + if(lentext(sec_record) <= 40) + HTML += "
[sec_record]
" + else + HTML += "
[copytext(sec_record, 1, 37)]...
" + + HTML += "
" + HTML += "\[Done\]" + HTML += "
" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=records;size=350x300") + return + proc/GetAltTitle(datum/job/job) return job_alt_titles.Find(job.title) > 0 \ ? job_alt_titles[job.title] \ @@ -890,10 +924,9 @@ datum/preferences be_random_name = !be_random_name if(link_tags["flavor_text"]) - var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message + var/msg = copytext(sanitize(input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message),1,MAX_NAME_LEN) if(msg != null) - msg = copytext(msg, 1, MAX_MESSAGE_LEN) msg = html_encode(msg) flavor_text = msg @@ -984,6 +1017,7 @@ datum/preferences midis = 1 ghost_ears = 1 disabilities = 0 + if(link_tags["disabilities"]) if(text2num(link_tags["disabilities"]) >= -1) if(text2num(link_tags["disabilities"]) >= 0) @@ -993,6 +1027,39 @@ datum/preferences else user << browse(null, "window=disabil") + if(link_tags["records"]) + if(text2num(link_tags["records"]) >= 1) + SetRecords(user) + return + else + user << browse(null, "window=records") + + if(link_tags["med_record"]) + var/medmsg = copytext(sanitize(input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message),1,MAX_NAME_LEN) + + if(medmsg != null) + medmsg = html_encode(medmsg) + + med_record = medmsg + SetRecords(user) + + if(link_tags["sec_record"]) + var/secmsg = copytext(sanitize(input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message),1,MAX_NAME_LEN) + + if(secmsg != null) + secmsg = html_encode(secmsg) + + sec_record = secmsg + SetRecords(user) + + if(link_tags["flavor_text"]) + var/msg = copytext(sanitize(input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message),1,MAX_NAME_LEN) + + if(msg != null) + msg = html_encode(msg) + + flavor_text = msg + ShowChoices(user) proc/copy_to(mob/living/carbon/human/character, safety = 0) @@ -1002,6 +1069,8 @@ datum/preferences character.original_name = real_name //Original name is only used in ghost chat! It is not to be edited by anything! character.flavor_text = flavor_text + character.med_record = med_record + character.sec_record = sec_record character.gender = gender diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 30c49843a89..f0c4c3a6bd6 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -98,6 +98,8 @@ datum/preferences/proc/savefile_save(mob/user, slot) F["name_is_always_random"] << src.be_random_name F["flavor_text"] << flavor_text + F["med_record"] << med_record + F["sec_record"] << sec_record F["gender"] << src.gender F["age"] << src.age @@ -196,6 +198,8 @@ datum/preferences/proc/savefile_load(mob/user, slot) F["age"] >> src.age F["flavor_text"] >> flavor_text + F["med_record"] >> med_record + F["sec_record"] >> sec_record F["hair_red"] >> src.r_hair F["hair_green"] >> src.g_hair
Misc Positions
[dd_replacetext("Records", " ", " ")][dd_replacetext("Records", " ", " ")]