Merge pull request #1215 from Erthilo/master

Records System <3
This commit is contained in:
SkyMarshal
2012-05-31 20:57:40 -07:00
7 changed files with 197 additions and 21 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 += "<hr><b><a href=\"byond://?src=\ref[user];preferences=1;disabilities=-1\">Disabilities</a></b><br>"
if(jobban_isbanned(user, "Records"))
dat += "<hr><b>You are banned from using character records.</b><br>"
else
dat += "<hr><b><a href=\"byond://?src=\ref[user];preferences=1;records=1\">Character Records</a></b><br>"
dat += "<hr><b>Flavor Text</b><br>"
dat += "<a href='byond://?src=\ref[user];preferences=1;flavor_text=1'>Change</a><br>"
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 = "<body>"
HTML += "<tt><center>"
HTML += "<b>Set Character Records</b><br>"
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;med_record=1\">Medical Records</a><br>"
if(lentext(med_record) <= 40)
HTML += "<br>[med_record]<br>"
else
HTML += "<br>[copytext(med_record, 1, 37)]...<br>"
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;sec_record=1\">Security Records</a><br>"
if(lentext(sec_record) <= 40)
HTML += "<br>[sec_record]<br>"
else
HTML += "<br>[copytext(sec_record, 1, 37)]...<br>"
HTML += "<br>"
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;records=-1\">\[Done\]</a>"
HTML += "</center></tt>"
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

View File

@@ -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