diff --git a/code/__DEFINES/human.dm b/code/__DEFINES/human.dm index f2d60983b74c..89f0b550d437 100644 --- a/code/__DEFINES/human.dm +++ b/code/__DEFINES/human.dm @@ -215,3 +215,92 @@ #define RELIGION_AGNOSTICISM "Agnostic" #define MAXIMUM_DROPPED_OBJECTS_REMEMBERED 2 + +// DEFINES FOR RECORD SYSTEM STAT TYPES, arguably pointless to create defines for these, could of just renamed the string but eh, who cares. +// --------------------------------------------------------------------------------------------------------------- // + +// general records +#define MOB_NAME "name" +#define RECORD_UNIQUE_ID "id" +#define MOB_SHOWN_RANK "rank" +#define MOB_REAL_RANK "real_rank" +#define MOB_SEX "sex" +#define MOB_AGE "age" +#define MOB_ETHNICITY "ethnicity" +#define MOB_HEALTH_STATUS "p_stat" +#define MOB_MENTAL_STATUS "m_stat" +#define MOB_SPECIES "species" +#define MOB_ORIGIN "origin" +#define MOB_SHOWN_FACTION "faction" +#define MOB_REAL_FACTION "mob_faction" +#define MOB_RELIGION "religion" +#define MOB_SQUAD "squad" +#define MOB_GENERAL_NOTES "g_notes" +#define MOB_EXPLOIT_RECORD "mob_exploit_record" +#define MOB_WEAKREF "ref" + +#define GENERAL_RECORD_LIST list(MOB_NAME, RECORD_UNIQUE_ID, MOB_SHOWN_RANK, MOB_REAL_RANK, MOB_SEX, MOB_AGE, MOB_ETHNICITY, MOB_HEALTH_STATUS, MOB_MENTAL_STATUS, MOB_SPECIES, MOB_ORIGIN, MOB_SHOWN_FACTION, MOB_REAL_FACTION, MOB_RELIGION, MOB_SQUAD, MOB_GENERAL_NOTES, MOB_EXPLOIT_RECORD, MOB_WEAKREF) + +// security record stat types +#define MOB_INCIDENTS "incidents" +#define MOB_CRIMINAL_STATUS "criminal" +#define MOB_SECURITY_COMMENT_LOG "comments" +#define MOB_SECURITY_NOTES "s_notes" + +#define SECURITY_RECORD_LIST list(MOB_INCIDENTS, MOB_CRIMINAL_STATUS, MOB_SECURITY_COMMENT_LOG, MOB_SECURITY_NOTES) + +// medical record stat types +#define MOB_BLOOD_TYPE "b_type" +#define MOB_DISABILITIES "mi_dis" +#define MOB_AUTOPSY_NOTES "a_stat" +#define MOB_MEDICAL_NOTES "m_notes" +#define MOB_DISEASES "cdi" +#define MOB_CAUSE_OF_DEATH "d_stat" +#define MOB_AUTOPSY_SUBMISSION "aut_sub" +#define MOB_LAST_SCAN_TIME "last_scan_time" +#define MOB_LAST_SCAN_RESULT "last_scan_result" +#define MOB_AUTODOC_DATA "autodoc_data" +#define MOB_AUTODOC_MANUAL "autodoc_manual" + +#define MEDICAL_RECORD_LIST list(MOB_BLOOD, MOB_DISABILITIES, MOB_AUTOPSY_NOTES, MOB_MEDICAL_NOTES, MOB_DISEASES, MOB_CAUSE_OF_DEATH, MOB_AUTOPSY_SUBMISSION, MOB_LAST_SCAN_TIME, MOB_LAST_SCAN_RESULT, MOB_AUTODOC_DATA, MOB_AUTODOC_MANUAL) + +// --------------------------------------------------------------------------------------------------------------- // + +// The actual stat that is set, for now we reduce the useless bullshit no one cares about and keep it minimal. +// --------------------------------------------------------------------------------------------------------------- // + +// gender/sex stats +#define MOB_STAT_SEX_MALE "Male" +#define MOB_STAT_SEX_FEMALE "Female" + +#define MOB_STAT_GENDER_LIST list(MOB_STAT_SEX_MALE, MOB_STAT_SEX_FEMALE) + +// health stats +#define MOB_STAT_HEALTH_DECEASED "Deceased" +#define MOB_STAT_HEALTH_ACTIVE "Active" +#define MOB_STAT_HEALTH_UNFIT "Unfit" + +#define MOB_STAT_HEALTH_LIST list(MOB_STAT_SEX_MALE, MOB_STAT_SEX_FEMALE) + +// Mental stats +#define MOB_STAT_MENTAL_STATUS_STABLE "Stable" +#define MOB_STAT_MENTAL_STATUS_ON_WATCH "Watch" // i.e. potentailly unstable +#define MOB_STAT_MENTAL_STATUS_UNSTABLE "Insane" + +#define MOB_STAT_MENTAL_STATUS_LIST list(MOB_STAT_MENTAL_STATUS_STABLE, MOB_STAT_MENTAL_STATUS_ON_WATCH, MOB_STAT_MENTAL_STATUS_UNSTABLE) + +// crime stats +#define MOB_STAT_CRIME_NONE "None" +#define MOB_STAT_CRIME_ARREST "Arrest" +#define MOB_STAT_CRIME_INCARCERATED "Incarcerated" + +#define MOB_STAT_CRIME_STATUS_LIST list(MOB_STAT_CRIME_NONE, MOB_STAT_CRIME_ARREST, MOB_STAT_CRIME_INCARCERATED) +// ------------------------------------------------------------------------------------------------------------------ // + +// types of records +#define RECORD_TYPE_GENERAL "general" +#define RECORD_TYPE_SECURITY "security" +#define RECORD_TYPE_MEDICAL "medical" +#define RECORD_TYPE_STATIC "locked" // immutable records, keeping it for now I guess. + +#define RECORD_TYPE_LIST list(RECORD_TYPE_GENERAL, RECORD_TYPE_SECURITY, RECORD_TYPE_MEDICAL, RECORD_TYPE_STATIC ) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 068d85a71ba5..c2ea0349fd2f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -254,13 +254,9 @@ if(oldname) //update the datacore records! This is goig to be a bit costly. - var/mob_ref = WEAKREF(src) - for(var/list/L in list(GLOB.data_core.general, GLOB.data_core.medical, GLOB.data_core.security, GLOB.data_core.locked)) - for(var/datum/data/record/record_entry in L) - if(record_entry.fields["ref"] == mob_ref) - record_entry.fields["name"] = newname - record_entry.name = newname - break + for(var/record_type in RECORD_TYPE_LIST) + insert_record_stat(mob_name = oldname, record_type = record_type, stat_type = MOB_WEAKREF, new_stat = WEAKREF(src)) + insert_record_stat(mob_name = oldname, record_type = record_type, stat_type = MOB_NAME, new_stat = newname) //update our pda and id if we have them on our person var/list/searching = GetAllContents(searchDepth = 3) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index ca4eca8a1a49..4cc173dc4dd1 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -32,12 +32,13 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) ) departments += marines_by_squad var/list/manifest_out = list() - for(var/datum/data/record/record_entry in GLOB.data_core.general) - if(record_entry.fields["mob_faction"] != FACTION_MARINE) //we process only USCM humans + for(var/record in GLOB.data_core.general) + var/datum/data/record/record_entry = GLOB.data_core.general[record] // I regret using associated lists for this. + if(record_entry.fields[MOB_REAL_FACTION] != FACTION_MARINE) //we process only USCM humans continue - var/name = record_entry.fields["name"] - var/rank = record_entry.fields["rank"] - var/squad = record_entry.fields["squad"] + var/name = record_entry.fields[MOB_NAME] + var/rank = record_entry.fields[MOB_REAL_RANK] + var/squad = record_entry.fields[MOB_SQUAD] if(isnull(name) || isnull(rank)) continue var/has_department = FALSE @@ -51,8 +52,8 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) if(!manifest_out[department]) manifest_out[department] = list() manifest_out[department] += list(list( - "name" = name, - "rank" = rank + MOB_NAME = name, + MOB_SHOWN_RANK = rank )) has_department = TRUE break @@ -60,8 +61,8 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) if(!manifest_out["Miscellaneous"]) manifest_out["Miscellaneous"] = list() manifest_out["Miscellaneous"] += list(list( - "name" = name, - "rank" = rank + MOB_NAME = name, + MOB_SHOWN_RANK = rank )) return manifest_out @@ -85,14 +86,15 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/dept_flags = NO_FLAGS //Is there anybody in the department?. var/list/squad_sublists = GLOB.ROLES_SQUAD_ALL.Copy() //Are there any marines in the squad? - for(var/datum/data/record/record_entry in GLOB.data_core.general) - if(record_entry.fields["mob_faction"] != FACTION_MARINE) //we process only USCM humans + for(var/entry in GLOB.data_core.general) + var/datum/data/record/record_entry = GLOB.data_core.general[entry] + if(record_entry.fields[MOB_REAL_FACTION] != FACTION_MARINE) //we process only USCM humans continue - var/name = record_entry.fields["name"] - var/rank = record_entry.fields["rank"] - var/real_rank = record_entry.fields["real_rank"] - var/squad_name = record_entry.fields["squad"] + var/name = record_entry.fields[MOB_NAME] + var/rank = record_entry.fields[MOB_SHOWN_RANK] + var/real_rank = record_entry.fields[MOB_REAL_RANK] + var/squad_name = record_entry.fields[MOB_SQUAD] if(isnull(name) || isnull(rank) || isnull(real_rank)) continue @@ -104,7 +106,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) break isactive[name] = active ? "Active" : "Inactive" else - isactive[name] = record_entry.fields["p_stat"] + isactive[name] = record_entry.fields[MOB_HEALTH_STATUS] //cael - to prevent multiple appearances of a player/job combination, add a continue after each line if(real_rank in GLOB.ROLES_CIC) @@ -212,142 +214,45 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) if(H.job in jobs_to_check) manifest_inject(H) -/datum/datacore/proc/manifest_modify(name, ref, assignment, rank, p_stat) - var/datum/data/record/foundrecord +/datum/datacore/proc/manifest_modify(name, ref, assignment, rank, health_status, record_id_ref = null) + var/datum/data/record/found_record = null + found_record = retrieve_record(mob_ref = ref, mob_name = name, record_type =RECORD_TYPE_GENERAL, record_id_ref = record_id_ref) - var/use_name = isnull(ref) - for(var/datum/data/record/record_entry in GLOB.data_core.general) - if(use_name) - if(record_entry.fields["name"] == name) - foundrecord = record_entry - break - else - if(record_entry.fields["ref"] == ref) - foundrecord = record_entry - break - - if(foundrecord) + if(found_record) if(assignment) - foundrecord.fields["rank"] = assignment + found_record.fields[MOB_SHOWN_RANK] = assignment if(rank) - foundrecord.fields["real_rank"] = rank - if(p_stat) - foundrecord.fields["p_stat"] = p_stat - if(!use_name) - if(name) - foundrecord.fields["name"] = name + found_record.fields[MOB_SHOWN_RANK] = rank + if(health_status) + found_record.fields[MOB_HEALTH_STATUS] = health_status + if(name) + found_record.fields[MOB_NAME] = name return TRUE return FALSE /datum/datacore/proc/manifest_inject(mob/living/carbon/human/target) - var/assignment - if(target.job) - assignment = target.job - else - assignment = "Unassigned" - - var/id = add_zero(num2hex(target.gid), 6) //this was the best they could come up with? A large random number? *sigh* - //var/icon/front = new(get_id_photo(H), dir = SOUTH) - //var/icon/side = new(get_id_photo(H), dir = WEST) - - //General Record - var/datum/data/record/record_general = new() - record_general.fields["id"] = id - record_general.fields["name"] = target.real_name - record_general.name = target.real_name - record_general.fields["real_rank"] = target.job - record_general.fields["rank"] = assignment - record_general.fields["squad"] = target.assigned_squad ? target.assigned_squad.name : null - record_general.fields["age"] = target.age - record_general.fields["p_stat"] = "Active" - record_general.fields["m_stat"] = "Stable" - record_general.fields["sex"] = target.gender - record_general.fields["species"] = target.get_species() - record_general.fields["origin"] = target.origin - record_general.fields["faction"] = target.personal_faction - record_general.fields["mob_faction"] = target.faction - record_general.fields["religion"] = target.religion - record_general.fields["ref"] = WEAKREF(target) - //record_general.fields["photo_front"] = front - //record_general.fields["photo_side"] = side - - if(target.gen_record && !jobban_isbanned(target, "Records")) - record_general.fields["notes"] = target.gen_record - else - record_general.fields["notes"] = "No notes found." - general += record_general - - //Medical Record - var/datum/data/record/record_medical = new() - record_medical.fields["id"] = id - record_medical.fields["name"] = target.real_name - record_medical.name = target.name - record_medical.fields["b_type"] = target.blood_type - record_medical.fields["mi_dis"] = "None" - record_medical.fields["mi_dis_d"] = "No minor disabilities have been declared." - record_medical.fields["ma_dis"] = "None" - record_medical.fields["ma_dis_d"] = "No major disabilities have been diagnosed." - record_medical.fields["alg"] = "None" - record_medical.fields["alg_d"] = "No allergies have been detected in this patient." - record_medical.fields["cdi"] = "None" - record_medical.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - record_medical.fields["last_scan_time"] = null - record_medical.fields["last_scan_result"] = "No scan data on record" // body scanner results - record_medical.fields["autodoc_data"] = list() - record_medical.fields["autodoc_manual"] = list() - record_medical.fields["ref"] = WEAKREF(target) - - if(target.med_record && !jobban_isbanned(target, "Records")) - record_medical.fields["notes"] = target.med_record - else - record_medical.fields["notes"] = "No notes found." - medical += record_medical - - //Security Record - var/datum/data/record/record_security = new() - record_security.fields["id"] = id - record_security.fields["name"] = target.real_name - record_security.name = target.real_name - record_security.fields["criminal"] = "None" - record_security.fields["incident"] = "" - record_security.fields["ref"] = WEAKREF(target) - - if(target.sec_record && !jobban_isbanned(target, "Records")) - var/new_comment = list("entry" = target.sec_record, "created_by" = list("name" = "\[REDACTED\]", "rank" = "Military Police"), "deleted_by" = null, "deleted_at" = null, "created_at" = "Pre-Deployment") - record_security.fields["comments"] = list("1" = new_comment) - record_security.fields["notes"] = target.sec_record - security += record_security - - - //Locked Record - var/datum/data/record/record_locked = new() - record_locked.fields["id"] = md5("[target.real_name][target.job]") - record_locked.fields["name"] = target.real_name - record_locked.name = target.real_name - record_locked.fields["rank"] = target.job - record_locked.fields["age"] = target.age - record_locked.fields["sex"] = target.gender - record_locked.fields["b_type"] = target.b_type - record_locked.fields["species"] = target.get_species() - record_locked.fields["origin"] = target.origin - record_locked.fields["faction"] = target.personal_faction - record_locked.fields["religion"] = target.religion - record_locked.fields["ref"] = WEAKREF(target) - - if(target.exploit_record && !jobban_isbanned(target, "Records")) - record_locked.fields["exploit_record"] = target.exploit_record - else - record_locked.fields["exploit_record"] = "No additional information acquired." - locked += record_locked + if(!(target)) // big problemo. + return + + // they already have a record. + if(target.record_id_ref) + return + + var/id_ref = null + if(target.ckey) + id_ref = "[target.ckey]" // should be unique right? + else + id_ref = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) // not a player controlled mob. + target.record_id_ref = id_ref + create_general_record(target) + create_medical_record(target) + create_security_record(target) + create_static_character_record(target) /proc/get_id_photo(mob/living/carbon/human/H) var/icon/preview_icon = null - //var/g = "m" - //if (H.gender == FEMALE) - // g = "f" - var/icon/icobase = H.species.icobase var/icon/temp diff --git a/code/datums/medal_awards.dm b/code/datums/medal_awards.dm index 6949951b7b61..fa3a325b170d 100644 --- a/code/datums/medal_awards.dm +++ b/code/datums/medal_awards.dm @@ -45,9 +45,10 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME // Pick a marine var/list/possible_recipients = list() var/list/recipient_ranks = list() - for(var/datum/data/record/record in GLOB.data_core.general) - var/recipient_name = record.fields["name"] - recipient_ranks[recipient_name] = record.fields["rank"] + for(var/record_name in GLOB.data_core.general) + var/datum/data/record/record = GLOB.data_core.general[record_name] + var/recipient_name = record.fields[MOB_NAME] + recipient_ranks[recipient_name] = record.fields[MOB_REAL_RANK] possible_recipients += recipient_name var/chosen_recipient = tgui_input_list(usr, "Who do you want to award a medal to?", "Medal Recipient", possible_recipients) if(!chosen_recipient) @@ -164,9 +165,10 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME /proc/give_medal_award_prefilled(medal_location, mob/giving_mob, chosen_recipient, recipient_rank, recipient_ckey, reason, _medal_type) var/list/recipient_ranks = list() - for(var/datum/data/record/record in GLOB.data_core.general) - var/recipient_name = record.fields["name"] - recipient_ranks[recipient_name] = record.fields["rank"] + for(var/record_name in GLOB.data_core.general) + var/datum/data/record/record = GLOB.data_core.general[record_name] + var/recipient_name = record.fields[MOB_NAME] + recipient_ranks[recipient_name] = record.fields[MOB_SHOWN_RANK] if(!chosen_recipient) return FALSE @@ -473,7 +475,8 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, // Pick a marine var/list/possible_recipients = list() var/list/recipient_ranks = list() - for(var/datum/data/record/record in GLOB.data_core.general) + for(var/record_name in GLOB.data_core.general) + var/datum/data/record/record = GLOB.data_core.general[record_name] var/recipient_name = record.fields["name"] if(recipient_name == recommendation_giver.real_name) continue diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 975bd5d15cb9..1790d64ff55d 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -619,31 +619,25 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( var/obj/item/card/id/I = wear_id.GetID() if(I) perpref = I.registered_ref + else + perpref = WEAKREF(usr) if(!GLOB.data_core) return - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == perpref) - for(var/datum/data/record/R in GLOB.data_core.security) - if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*")) - holder.icon_state = "hudsec_wanted" - criminal = TRUE - break - else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated")) - holder.icon_state = "hudsec_prisoner" - criminal = TRUE - break - else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released")) - holder.icon_state = "hudsec_released" - criminal = FALSE - break - else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Suspect")) - holder.icon_state = "hudsec_suspect" - break - else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "NJP")) - holder.icon_state = "hudsec_njp" - break + var/datum/data/record/security_record = retrieve_record(mob_ref = perpref, record_type = RECORD_TYPE_SECURITY) + if(!security_record) + return + switch(security_record.fields[MOB_CRIMINAL_STATUS]) + if(MOB_STAT_CRIME_ARREST) + holder.icon_state = "hudsec_wanted" + criminal = TRUE + return + if(MOB_STAT_CRIME_INCARCERATED) + holder.icon_state = "hudsec_prisoner" + criminal = TRUE + return + //Squad HUD /mob/proc/hud_set_squad() diff --git a/code/defines/procs/records.dm b/code/defines/procs/records.dm index 33a11e98cfaf..124e6079918a 100644 --- a/code/defines/procs/records.dm +++ b/code/defines/procs/records.dm @@ -1,50 +1,109 @@ -/proc/CreateGeneralRecord() - var/datum/data/record/general_record = new /datum/data/record() - general_record.fields["name"] = "New Record" - general_record.name = "New Record" - general_record.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) - general_record.fields["rank"] = "Unassigned" - general_record.fields["real_rank"] = "Unassigned" - general_record.fields["sex"] = "Male" - general_record.fields["age"] = "Unknown" - general_record.fields["skin_color"] = "Unknown" - general_record.fields["p_stat"] = "Active" - general_record.fields["m_stat"] = "Stable" - general_record.fields["species"] = "Human" - general_record.fields["origin"] = "Unknown" - general_record.fields["faction"] = "Unknown" - general_record.fields["mob_faction"] = "Unknown" - general_record.fields["religion"] = "Unknown" - GLOB.data_core.general += general_record - return general_record - -/proc/CreateSecurityRecord(name as text, id as text) - var/datum/data/record/security_record = new /datum/data/record() - security_record.fields["name"] = name - security_record.fields["id"] = id - security_record.name = text("Security Record #[id]") - security_record.fields["incidents"] = "None" - GLOB.data_core.security += security_record - return security_record +// mob ref is a failsafe, ideally we just access through the id. +/proc/retrieve_record(record_id_ref = null, mob_name = null, mob_ref = null, record_type = RECORD_TYPE_GENERAL) + if(!record_id_ref && !mob_name && !mob_ref) + return + + var/datum/datacore/database = GLOB.data_core + if(!database) + return // should never happen but who knows. + + var/datum/data/record/retrieved_record = null + var/list/selected_record_type = null + + switch(record_type) + if(RECORD_TYPE_GENERAL) + selected_record_type = database.general + if(RECORD_TYPE_SECURITY) + selected_record_type = database.security + if(RECORD_TYPE_MEDICAL) + selected_record_type = database.medical + if(RECORD_TYPE_STATIC) + selected_record_type = database.locked + else + return + if(record_id_ref) + retrieved_record = selected_record_type[record_id_ref] + else + for(var/record_id_query in selected_record_type) + var/datum/data/record/record = selected_record_type[record_id_query] + if(record.fields[MOB_NAME] == mob_name || record.fields[MOB_WEAKREF] == mob_ref) + retrieved_record = record + break + + return retrieved_record + +/proc/insert_record_stat(record_id_ref = null, mob_name = null, mob_ref = null, record_type = RECORD_TYPE_GENERAL, stat_type = null, new_stat = null) + if(!stat_type || !new_stat) + return FALSE + + var/datum/data/record/retrieved_record = retrieve_record(record_id_ref, mob_name, mob_ref, record_type) + if(!retrieved_record) + return FALSE + retrieved_record.fields[stat_type] = new_stat + + return TRUE + +/proc/create_general_record(mob/living/carbon/human/person) + var/datum/data/record/general_record = new() + general_record.fields[MOB_NAME] = person.real_name ? person.real_name : "Unassigned" + general_record.name = person.real_name ? person.real_name : "New Record" + general_record.fields[MOB_SHOWN_RANK] = person.job ? person.job : "Unassigned" // yes they are the same at the start, but this can change depending on an alt title. + general_record.fields[MOB_REAL_RANK] = person.job ? person.job : "Unassigned" + general_record.fields[MOB_SEX] = person.gender ? person.gender : "Unknown" + general_record.fields[MOB_SQUAD] = person.assigned_squad ? person.assigned_squad.name : null + general_record.fields[MOB_AGE] = person.age ? person.age : "Unknown" + general_record.fields[MOB_HEALTH_STATUS] = MOB_STAT_HEALTH_ACTIVE // always starts as active + general_record.fields[MOB_MENTAL_STATUS] = MOB_STAT_MENTAL_STATUS_STABLE // debatable, haha. + general_record.fields[MOB_SPECIES] = person?.get_species() + general_record.fields[MOB_ORIGIN] = person.origin ? person.origin :"Unknown" + general_record.fields[MOB_SHOWN_FACTION] = person.personal_faction ? person.personal_faction : "Unknown" + general_record.fields[MOB_REAL_FACTION] = person.faction ? person.faction : "Unknown" + general_record.fields[MOB_RELIGION] = person.religion ? person.religion : "Unknown" + general_record.fields[MOB_WEAKREF] = WEAKREF(person) + general_record.fields[MOB_GENERAL_NOTES] = person.gen_record && !jobban_isbanned(person, "Records") ? person.gen_record : "No notes found." + GLOB.data_core.general[person.record_id_ref] = general_record + +/proc/create_security_record(mob/living/carbon/human/person) + var/datum/data/record/security_record = new() + security_record.fields[MOB_NAME] = person.name ? person.name : "Unknown" + security_record.name = text("Security Record") + security_record.fields[MOB_CRIMINAL_STATUS] = MOB_STAT_CRIME_NONE + security_record.fields[MOB_INCIDENTS] = list() + security_record.fields[MOB_WEAKREF] = WEAKREF(person) + security_record.fields[MOB_SECURITY_NOTES] = person.sec_record && !jobban_isbanned(person, "Records") ? person.sec_record : "No notes found." + GLOB.data_core.security[person.record_id_ref] = security_record /proc/create_medical_record(mob/living/carbon/human/person) - var/datum/data/record/medical_record = new /datum/data/record() - medical_record.fields["id"] = null - medical_record.fields["name"] = person.real_name - medical_record.name = person.real_name - medical_record.fields["b_type"] = person.b_type - medical_record.fields["mi_dis"] = "None" - medical_record.fields["mi_dis_d"] = "No minor disabilities have been declared." - medical_record.fields["ma_dis"] = "None" - medical_record.fields["ma_dis_d"] = "No major disabilities have been diagnosed." - medical_record.fields["alg"] = "None" - medical_record.fields["alg_d"] = "No allergies have been detected in this patient." - medical_record.fields["cdi"] = "None" - medical_record.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - medical_record.fields["last_scan_time"] = null - medical_record.fields["last_scan_result"] = "No scan data on record" - medical_record.fields["autodoc_data"] = list() - medical_record.fields["autodoc_manual"] = list() - medical_record.fields["ref"] = WEAKREF(person) - GLOB.data_core.medical += medical_record - return medical_record + var/datum/data/record/medical_record = new() + medical_record.fields[MOB_NAME] = person.real_name ? person.real_name : "Unknown" + medical_record.name = person.real_name ? person.real_name : "New Medical Record" + medical_record.fields[MOB_BLOOD_TYPE] = person.b_type ? person.b_type : "Unknown" + medical_record.fields[MOB_DISABILITIES] = "None" + medical_record.fields[MOB_AUTOPSY_NOTES] = null + medical_record.fields[MOB_MEDICAL_NOTES] = person.med_record && !jobban_isbanned(person, "Records") ? person.med_record : "No notes found." + medical_record.fields[MOB_DISEASES] = "None" + medical_record.fields[MOB_CAUSE_OF_DEATH] = "None" + medical_record.fields[MOB_AUTOPSY_SUBMISSION] = FALSE + medical_record.fields[MOB_LAST_SCAN_TIME] = null + medical_record.fields[MOB_LAST_SCAN_RESULT] = "No scan data on record" + medical_record.fields[MOB_AUTODOC_DATA] = list() + medical_record.fields[MOB_AUTODOC_MANUAL] = list() + medical_record.fields[MOB_WEAKREF] = WEAKREF(person) + GLOB.data_core.medical[person.record_id_ref] = medical_record + +/proc/create_static_character_record(mob/living/carbon/human/person) + var/datum/data/record/record_locked = new() + record_locked.fields[RECORD_UNIQUE_ID] = md5("[person.real_name][person.job]") + record_locked.fields[MOB_NAME] = person.real_name + record_locked.name = person.real_name + record_locked.fields[MOB_REAL_RANK] = person.job + record_locked.fields[MOB_AGE] = person.age + record_locked.fields[MOB_SEX] = person.gender + record_locked.fields[MOB_BLOOD_TYPE] = person.b_type + record_locked.fields[MOB_SPECIES] = person.get_species() + record_locked.fields[MOB_ORIGIN] = person.origin + record_locked.fields[MOB_SHOWN_FACTION] = person.personal_faction + record_locked.fields[MOB_RELIGION] = person.religion + record_locked.fields[MOB_WEAKREF] = WEAKREF(person) + record_locked.fields[MOB_EXPLOIT_RECORD] = !jobban_isbanned(person, "Records") ? person.exploit_record : "No additional information acquired" + GLOB.data_core.locked[person.record_id_ref] = record_locked diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 58c9ad5b5092..d0d0ea14ebb7 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -795,11 +795,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou new_squad.update_free_mar() var/marine_ref = WEAKREF(transfer_marine) - for(var/datum/data/record/t in GLOB.data_core.general) //we update the crew manifest - if(t.fields["ref"] == marine_ref) - t.fields["squad"] = new_squad.name - break - + insert_record_stat( record_id_ref = transfer_marine.record_id_ref, mob_ref = marine_ref, record_type = RECORD_TYPE_GENERAL, stat_type = MOB_SQUAD, new_stat = new_squad.name ) transfer_marine.hud_set_squad() // returns TRUE if transfer_marine's role is at max capacity in the new squad diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index bfa64ab174ed..941a0af9e64b 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -133,6 +133,9 @@ if(!.) //not broken or unpowered if(ishuman(usr)) playsound(src, "keyboard", 15, 1) + // maybe it shouldn't open the UI if you hit the computer with an object? + if(usr.get_active_hand()) + return TRUE /obj/structure/machinery/computer/fixer var/all_configs diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 40b23667636f..cf810f0c85a0 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -1,509 +1,249 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -/obj/structure/machinery/computer/med_data//TODO:SANITY +// I hate the printing sound effect. +#define PRINT_COOLDOWN_TIME 2 MINUTES + +/obj/structure/machinery/computer/double_id/med_data name = "Medical Records" desc = "This can be used to check medical records." icon_state = "medcomp" density = TRUE req_one_access = list(ACCESS_MARINE_MEDBAY, ACCESS_WY_MEDICAL) circuit = /obj/item/circuitboard/computer/med_data - var/obj/item/card/id/scan = null - var/last_user_name = "" - var/last_user_rank = "" - var/authenticated = null - var/rank = null - var/screen = null - var/datum/data/record/active1 = null - var/datum/data/record/active2 = null - var/a_id = null - var/temp = null - var/printing = null - -/obj/structure/machinery/computer/med_data/verb/eject_id() - set category = "Object" - set name = "Eject ID Card" - set src in oview(1) - - if(!usr || usr.is_mob_incapacitated()) return - - if(scan) - to_chat(usr, "You remove \the [scan] from \the [src].") - scan.forceMove(get_turf(src)) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) - usr.put_in_hands(scan) - scan = null - else - to_chat(usr, "There is nothing to remove from the console.") - return - -/obj/structure/machinery/computer/med_data/attackby(obj/item/O as obj, user as mob) - if(istype(O, /obj/item/card/id) && !scan) - if(usr.drop_held_item()) - O.forceMove(src) - scan = O - last_user_name = scan.registered_name - last_user_rank = scan.rank - to_chat(user, "You insert [O].") + // general record for a given target user + var/datum/data/record/target_record_general = null + // medical record for a given target user + var/datum/data/record/target_record_medical = null + // print cooldown + COOLDOWN_DECLARE(print_cooldown) + +/obj/structure/machinery/computer/double_id/med_data/attackby(obj/card, mob/user) + // we only check the target, never the user. + if(user_id_card) + var/obj/item/card/id/id_card = card + if(!retrieve_target_records(id_card)) + return ..() -/obj/structure/machinery/computer/med_data/attack_remote(user as mob) - return src.attack_hand(user) +/obj/structure/machinery/computer/double_id/med_data/proc/retrieve_target_records(obj/item/card/id/target_id) + if(!target_id) + visible_message("[SPAN_BOLD("[src]")] states, \"CARD FAILURE: Unable to read target ID.\"") + return FALSE -/obj/structure/machinery/computer/med_data/attack_hand(mob/user as mob) - if(..()) - return - var/dat - if (src.temp) - dat = text("[src.temp]

Clear Screen") - else - dat = text("Confirm Identity: []
", src, (src.scan ? text("[]", src.scan.name) : "----------")) - if (src.authenticated) - switch(src.screen) - if(1.0) - dat += {" -Search Records -
List Records -
-
Medbot Tracking -
-
Record Maintenance -
{Log Out}
-"} - if(2.0) - dat += "Record List:
" - if(!isnull(GLOB.data_core.general)) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) - dat += text("[]: []
", src, R, R.fields["id"], R.fields["name"]) - //Foreach goto(132) - dat += text("
Back", src) - if(3.0) - dat += text("Records Maintenance
\nBackup To Disk
\nUpload From disk
\nDelete All Records
\n
\nBack", src, src, src, src) - if(4.0) - if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - dat += "
Medical Record

" - dat += "
Name: [active1.fields["name"]] \ - ID: [active1.fields["id"]]
\n \ - Sex: [active1.fields["sex"]]
\n \ - Age: [active1.fields["age"]]
\n \ - Physical Status: [active1.fields["p_stat"]]
\n \ - Mental Status: [active1.fields["m_stat"]]
\ - Photo:
" - else - dat += "General Record Lost!
" - if ((istype(src.active2, /datum/data/record) && GLOB.data_core.medical.Find(src.active2))) - dat += "
\n
Medical Data

\nBlood Type: [active2.fields["b_type"]]
\n
\nMinor Disabilities: [active2.fields["mi_dis"]]
\nDetails: [active2.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [active2.fields["ma_dis"]]
\nDetails: [active2.fields["ma_dis_d"]]
\n
\nAllergies: [active2.fields["alg"]]
\nDetails: [active2.fields["alg_d"]]
\n
\nCurrent Diseases: [active2.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [active2.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[decode(src.active2.fields["notes"])]
\n
\n
Comments/Log

" - var/counter = 1 - while(src.active2.fields[text("com_[]", counter)]) - dat += text("[]
Delete Entry

", src.active2.fields[text("com_[]", counter)], src, counter) - counter++ - dat += text("Add Entry

", src) - dat += text("Delete Record (Medical Only)

", src) - else - dat += "Medical Record Lost!
" - dat += text("New Record

") - dat += text("\nPrint Record
\n", src) - dat += text("\nPrint Latest Bodyscan

\nBack
", src, src) - if(5) - dat += "
Medical Robot Monitor
" - dat += "Back" - dat += "
Medical Robots:" - var/bdat = null - for(var/obj/structure/machinery/bot/medbot/M in GLOB.machines) - - if(M.z != src.z) continue //only find medibots on the same z-level as the computer - var/turf/bl = get_turf(M) - if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up - bdat += "[M.name] - \[[bl.x],[bl.y]\] - [M.on ? "Online" : "Offline"]
" - if((!isnull(M.reagent_glass)) && M.use_beaker) - bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]
" - else - bdat += "Using Internal Synthesizer.
" - if(!bdat) - dat += "
None detected
" - else - dat += "
[bdat]" + target_record_medical = retrieve_record(mob_name = target_id.registered_name, mob_ref = target_id.registered_ref, record_type = RECORD_TYPE_MEDICAL) + target_record_general = retrieve_record(mob_name = target_id.registered_name, mob_ref = target_id.registered_ref, record_type = RECORD_TYPE_GENERAL) - else - dat += text("{Log In}", src) - show_browser(user, dat, "Medical Records", "med_rec") - onclose(user, "med_rec") - return - -/obj/structure/machinery/computer/med_data/Topic(href, href_list) - if(..()) - return + if(!target_record_medical || !target_record_general) + visible_message("[SPAN_BOLD("[src]")] states, \"CARD FAILURE: Unable to retrieve target records.\"") + return FALSE - if (!( GLOB.data_core.general.Find(src.active1) )) - src.active1 = null + return TRUE - if (!( GLOB.data_core.medical.Find(src.active2) )) - src.active2 = null - - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (isRemoteControlling(usr))) - usr.set_interaction(src) - - if (href_list["temp"]) - src.temp = null - - if (href_list["scan"]) - if (src.scan) - - if(ishuman(usr)) - scan.forceMove(usr.loc) +/obj/structure/machinery/computer/double_id/med_data/laptop + name = "Medical Laptop" + desc = "Cheap Weyland-Yutani Laptop." + icon_state = "medlaptop" + density = FALSE - if(!usr.get_active_hand()) - usr.put_in_hands(scan) +// TGUI med +// ----------------------------------------------------------------------------------------------------- // +/obj/structure/machinery/computer/double_id/med_data/tgui_interact(mob/user, datum/tgui/ui) - scan = null + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "MedRec", name) + ui.open() - else - src.scan.forceMove(src.loc) - src.scan = null +/obj/structure/machinery/computer/double_id/med_data/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + var/mob/user = ui.user + playsound(src, pick('sound/machines/computer_typing4.ogg', 'sound/machines/computer_typing5.ogg', 'sound/machines/computer_typing6.ogg'), 5, 1) + switch(action) + if("authenticate") + var/obj/item/id_card = user.get_active_hand() + if (istype(id_card, /obj/item/card/id)) + if(user.drop_held_item()) + id_card.forceMove(src) + user_id_card = id_card + if(authenticate(user, user_id_card)) + return TRUE else - var/obj/item/I = usr.get_active_hand() - if (istype(I, /obj/item/card/id)) - if(usr.drop_held_item()) - I.forceMove(src) - src.scan = I - - else if (href_list["logout"]) - src.authenticated = null - src.screen = null - src.active1 = null - src.active2 = null - - else if (href_list["login"]) - - if (isRemoteControlling(usr)) - src.active1 = null - src.active2 = null - src.authenticated = usr.name - src.rank = "AI" - src.screen = 1 - - else if (istype(src.scan, /obj/item/card/id)) - src.active1 = null - src.active2 = null - - if (src.check_access(src.scan)) - src.authenticated = src.scan.registered_name - src.rank = src.scan.assignment - src.screen = 1 - - if (src.authenticated) - - if(href_list["screen"]) - src.screen = text2num(href_list["screen"]) - if(src.screen < 1) - src.screen = 1 - - src.active1 = null - src.active2 = null - - if (href_list["del_all"]) - src.temp = text("Are you sure you wish to delete all records?
\n\tYes
\n\tNo
", src, src) - - if (href_list["del_all2"]) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - GLOB.data_core.medical -= R - qdel(R) - //Foreach goto(494) - src.temp = "All records deleted." - - if (href_list["field"]) - var/a1 = src.active1 - var/a2 = src.active2 - switch(href_list["field"]) - if("sex") - if (istype(src.active1, /datum/data/record)) - if (src.active1.fields["sex"] == "Male") - src.active1.fields["sex"] = "Female" - else - src.active1.fields["sex"] = "Male" - if("age") - if (istype(src.active1, /datum/data/record)) - var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active1 != a1)) - return - src.active1.fields["age"] = t1 - if("mi_dis") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["mi_dis"] = t1 - if("mi_dis_d") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["mi_dis_d"] = t1 - if("ma_dis") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["ma_dis"] = t1 - if("ma_dis_d") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["ma_dis_d"] = t1 - if("alg") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["alg"] = t1 - if("alg_d") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["alg_d"] = t1 - if("cdi") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["cdi"] = t1 - if("cdi_d") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["cdi_d"] = t1 - if("notes") - if (istype(src.active2, /datum/data/record)) - var/t1 = copytext(html_encode(trim(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) - return - src.active2.fields["notes"] = t1 - if("p_stat") - if (istype(src.active1, /datum/data/record)) - src.temp = text("Physical Condition:
\n\t*Deceased*
\n\t*SSD*
\n\tActive
\n\tPhysically Unfit
\n\tDisabled
", src, src, src, src, src) - if("m_stat") - if (istype(src.active1, /datum/data/record)) - src.temp = text("Mental Condition:
\n\t*Insane*
\n\t*Unstable*
\n\t*Watch*
\n\tStable
", src, src, src, src) - if("b_type") - if (istype(src.active2, /datum/data/record)) - src.temp = text("Blood Type:
\n\tA- A+
\n\tB- B+
\n\tAB- AB+
\n\tO- O+
", src, src, src, src, src, src, src, src) - - - if (href_list["p_stat"]) - if (src.active1) - switch(href_list["p_stat"]) - if("deceased") - src.active1.fields["p_stat"] = "*Deceased*" - if("ssd") - src.active1.fields["p_stat"] = "*SSD*" - if("active") - src.active1.fields["p_stat"] = "Active" - if("unfit") - src.active1.fields["p_stat"] = "Physically Unfit" - if("disabled") - src.active1.fields["p_stat"] = "Disabled" - - if (href_list["m_stat"]) - if (src.active1) - switch(href_list["m_stat"]) - if("insane") - src.active1.fields["m_stat"] = "*Insane*" - if("unstable") - src.active1.fields["m_stat"] = "*Unstable*" - if("watch") - src.active1.fields["m_stat"] = "*Watch*" - if("stable") - src.active1.fields["m_stat"] = "Stable" - - - if (href_list["b_type"]) - if (src.active2) - switch(href_list["b_type"]) - if("an") - src.active2.fields["b_type"] = "A-" - if("bn") - src.active2.fields["b_type"] = "B-" - if("abn") - src.active2.fields["b_type"] = "AB-" - if("on") - src.active2.fields["b_type"] = "O-" - if("ap") - src.active2.fields["b_type"] = "A+" - if("bp") - src.active2.fields["b_type"] = "B+" - if("abp") - src.active2.fields["b_type"] = "AB+" - if("op") - src.active2.fields["b_type"] = "O+" - - - if (href_list["del_r"]) - if (active2) - src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?
\n\tYes
\n\tNo
", src, src) - - if (href_list["del_r2"]) - QDEL_NULL(active2) - - if (href_list["d_rec"]) - var/datum/data/record/R = locate(href_list["d_rec"]) - var/datum/data/record/M = locate(href_list["d_rec"]) - if (!( GLOB.data_core.general.Find(R) )) - src.temp = "Record Not Found!" + if(!user_id_card) return - for(var/datum/data/record/E in GLOB.data_core.medical) - if ((E.fields["ref"] == R.fields["ref"] || E.fields["id"] == R.fields["id"])) - M = E - src.active1 = R - src.active2 = M - src.screen = 4 - - if (href_list["new"]) - if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) ))) - var/datum/data/record/R = new /datum/data/record( ) - R.fields["name"] = src.active1.fields["name"] - R.fields["id"] = src.active1.fields["id"] - R.name = text("Medical Record #[]", R.fields["id"]) - R.fields["b_type"] = "Unknown" - R.fields["mi_dis"] = "None" - R.fields["mi_dis_d"] = "No minor disabilities have been declared." - R.fields["ma_dis"] = "None" - R.fields["ma_dis_d"] = "No major disabilities have been diagnosed." - R.fields["alg"] = "None" - R.fields["alg_d"] = "No allergies have been detected in this patient." - R.fields["cdi"] = "None" - R.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - R.fields["notes"] = "No notes." - GLOB.data_core.medical += R - src.active2 = R - src.screen = 4 - - if (href_list["add_c"]) - if (!( istype(src.active2, /datum/data/record) )) - return - var/a2 = src.active2 - var/t1 = copytext(trim(strip_html(input("Add Comment:", "Med. records", null, null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || src.active2 != a2)) + if(ishuman(user)) + user_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(user_id_card) + else + user_id_card.forceMove(loc) + user_id_card = null + if("logout") + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") + authenticated = FALSE + if(ishuman(user)) + user_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(user_id_card) + else + user_id_card.forceMove(loc) + user_id_card = null + return TRUE + if("print") + if(!authenticated || !target_id_card) + return + + if(!COOLDOWN_FINISHED(src, print_cooldown)) + visible_message("[SPAN_BOLD("[src]")] states, \"PRINT ERROR: system is still on cooldown.\"") + return + COOLDOWN_START(src, print_cooldown, PRINT_COOLDOWN_TIME ) + print_paper() + + if("eject") + if(target_id_card) + if(ishuman(user)) + target_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(target_id_card) + else + target_id_card.forceMove(loc) + visible_message("[SPAN_BOLD("[src]")] states, \"CARD EJECT: Data imprinted. Updating database... Success.\"") + target_record_general = null + target_record_medical = null + target_id_card = null + return TRUE + else + var/obj/item/card/id/id_card = user.get_active_hand() + if (!istype(id_card, /obj/item/card/id)) return - var/counter = 1 - while(src.active2.fields[text("com_[]", counter)]) - counter++ - src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]
[t1]") - - if (href_list["del_c"]) - if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) - src.active2.fields[text("com_[]", href_list["del_c"])] = "Deleted" - - if (href_list["search"]) - var/t1 = stripped_input(usr, "Search String: (Name, DNA, or ID)", "Med. records") - if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.is_mob_restrained() || ((!in_range(src, usr)) && (!isRemoteControlling(usr))))) + if(!retrieve_target_records(id_card)) + ui.close() return - src.active1 = null - src.active2 = null - t1 = lowertext(t1) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]))) - src.active2 = R - if (!active2) - temp = "Could not locate record [t1]." - else - for(var/datum/data/record/E in GLOB.data_core.general) - if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])) - src.active1 = E - src.screen = 4 - - if (href_list["print_p"]) - if (!( src.printing )) - src.printing = 1 - var/datum/data/record/record1 = null - var/datum/data/record/record2 = null - if ((istype(src.active1, /datum/data/record) && GLOB.data_core.general.Find(src.active1))) - record1 = active1 - if ((istype(src.active2, /datum/data/record) && GLOB.data_core.medical.Find(src.active2))) - record2 = active2 - playsound(src.loc, 'sound/machines/fax.ogg', 15, 1) - sleep(40) - var/obj/item/paper/P = new /obj/item/paper( src.loc ) - P.info = "
Medical Record

" - if (record1) - P.info += text("Name: []
\nID: []
\nSex: []
\nAge: []
\nPhysical Status: []
\nMental Status: []
", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["p_stat"], record1.fields["m_stat"]) - P.name = text("Medical Record ([])", record1.fields["name"]) - else - P.info += "General Record Lost!
" - P.name = "Medical Record" - if (record2) - P.info += "
\n
Medical Data

\nBlood Type: [record2.fields["b_type"]]
\n
\nMinor Disabilities: [record2.fields["mi_dis"]]
\nDetails: [record2.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [record2.fields["ma_dis"]]
\nDetails: [record2.fields["ma_dis_d"]]
\n
\nAllergies: [record2.fields["alg"]]
\nDetails: [record2.fields["alg_d"]]
\n
\nCurrent Diseases: [record2.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [record2.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[decode(record2.fields["notes"])]
\n
\n
Comments/Log

" - var/counter = 1 - while(record2.fields[text("com_[]", counter)]) - P.info += text("[]
", record2.fields[text("com_[]", counter)]) - counter++ - else - P.info += "Medical Record Lost!
" - P.info += "" - P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME],[]/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),GLOB.game_year,worldtime2text()) - src.printing = null - - if(href_list["print_bs"])//Prints latest body scan - if(!(src.printing)) - src.printing = 1 - var/datum/data/record/record - if ((istype(src.active1, /datum/data/record) && GLOB.data_core.general.Find(src.active1))) - record = active1 - if(!record) return - playsound(src.loc, 'sound/machines/fax.ogg', 15, 1) - sleep(40) - var/datum/asset/asset = get_asset_datum(/datum/asset/simple/paper) - var/obj/item/paper/P = new /obj/item/paper( src.loc ) - P.name = text("Scan: [], []",record.fields["name"],worldtime2text()) - P.info += text("

Official Weyland-Yutani Document
Scan Record

[]

\n
",record.fields["name"]) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["name"] == record.fields["name"]) - if(R.fields["last_scan_time"] && R.fields["last_scan_result"]) - P.info += R.fields["last_scan_result"] - break - else - P.info += "No scan on record." - P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME], []/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),GLOB.game_year,worldtime2text()) - src.printing = null - - - - src.add_fingerprint(usr) - src.updateUsrDialog() - return - -/obj/structure/machinery/computer/med_data/emp_act(severity) - . = ..() - if(inoperable()) - return - - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if(prob(10/severity)) - switch(rand(1,6)) - if(1) - R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" - if(2) - R.fields["sex"] = pick("Male", "Female") - if(3) - R.fields["age"] = rand(5, 85) - if(4) - R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+") - if(5) - R.fields["p_stat"] = pick("*SSD*", "Active", "Physically Unfit", "Disabled") - if(6) - R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") - continue - - else if(prob(1)) - GLOB.data_core.medical -= R - qdel(R) - continue - - -/obj/structure/machinery/computer/med_data/laptop - name = "Medical Laptop" - desc = "Cheap Weyland-Yutani Laptop." - icon_state = "medlaptop" - density = FALSE + if(user.drop_held_item()) + id_card.forceMove(src) + target_id_card = id_card + visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") + update_static_data(user) + return TRUE + return FALSE + if("updateStatRecord") + if(!insert_record_stat(mob_name = target_id_card.registered_name, mob_ref = target_id_card.registered_ref, record_type = params["record_type"], stat_type = params["stat"], new_stat = params["new_value"])) + visible_message("[SPAN_BOLD("[src]")] states, \"DATACORE FAILURE: Unable to update relevant database logs.\"") + return TRUE + if("submitReport") + if(!target_record_medical.fields[MOB_CAUSE_OF_DEATH]) + visible_message("[SPAN_BOLD("[src]")] states, \"LOG ERROR: You must select a cause of death before submitting a report.\"") + return + target_record_medical.fields[MOB_AUTOPSY_SUBMISSION] = TRUE + return TRUE + +/obj/structure/machinery/computer/double_id/med_data/proc/print_paper() + playsound(loc, 'sound/machines/fax.ogg', 15, 1) + var/contents = {"

Medical Report

+ Prepared By: [user_id_card?.registered_name ? user_id_card.registered_name : "Unknown"]
+ For: [target_id_card.registered_name ? target_id_card.registered_name : "Unregistered"]
+
+

General Information

+ Name: [target_id_card.registered_name ? target_id_card.registered_name : "Unregistered"]
+ Sex: [target_record_general?.fields[MOB_SEX]]
+ Age: [target_record_general?.fields[MOB_AGE]]
+ Blood Type: [target_record_medical?.fields[MOB_BLOOD_TYPE]]
+
+

Medical Notes

+ General Notes: [target_record_medical?.fields[MOB_MEDICAL_NOTES]]
+ Psychiatric History: [target_record_general?.fields[MOB_MENTAL_STATUS]]
+ Disease History: [target_record_medical?.fields[MOB_DISEASES]]
+ Disability History: [target_record_medical?.fields[MOB_DISABILITIES]]
+
+ "} + + // autopsy report gets shwacked ontop if it exists and the target stat is dead + if(target_record_general.fields[MOB_HEALTH_STATUS] == MOB_STAT_HEALTH_DECEASED && target_record_medical.fields[MOB_AUTOPSY_SUBMISSION]) + contents += {"

Autopsy Report

+ Autopsy Notes: [target_record_medical.fields[MOB_AUTOPSY_NOTES]]
+ Cause Of Death: [target_record_medical.fields[MOB_CAUSE_OF_DEATH]]
+ "} + + var/obj/item/paper/med_report = new (loc) + med_report.name = "Medical Report" + med_report.info += contents + med_report.update_icon() + + visible_message(SPAN_NOTICE("[src] prints out a paper.")) + return TRUE + +/obj/structure/machinery/computer/double_id/med_data/ui_static_data(mob/user) + var/list/data = list() + // immutable data + data["general_record"] = list( + list( + value = target_record_general?.fields[MOB_NAME], + message = "Name: " + ), + list( + value = target_record_general?.fields[MOB_AGE], + message ="Age: " + ), + list( + value = target_record_general?.fields[MOB_SEX], + message ="Sex: " + ), + list( + value = target_record_medical?.fields[MOB_BLOOD_TYPE], + message = "Blood Type: " + ) + ) + + return data + +/obj/structure/machinery/computer/double_id/med_data/ui_data(mob/user) + var/list/data = list() + + data["medical_record"] = list( + list( + record_type = RECORD_TYPE_MEDICAL, + stat = MOB_MEDICAL_NOTES, + value = target_record_medical?.fields[MOB_MEDICAL_NOTES], + message = "General Notes: " + ), + list( + record_type = RECORD_TYPE_GENERAL, + stat = MOB_MENTAL_STATUS, + value = target_record_general?.fields[MOB_MENTAL_STATUS], + message = "Psychiatric History: " + ), + list( + record_type = RECORD_TYPE_MEDICAL, + stat = MOB_DISEASES, + value = target_record_medical?.fields[MOB_DISEASES], + message = "Disease History: " + ), + list( + record_type = RECORD_TYPE_MEDICAL, + stat = MOB_DISABILITIES, + value = target_record_medical?.fields[MOB_DISABILITIES], + message = "Disability History: " + ) + ) + data["death"] = list( + record_type = RECORD_TYPE_MEDICAL, + stat = MOB_CAUSE_OF_DEATH, + value = target_record_medical?.fields[MOB_CAUSE_OF_DEATH], + message = "Cause Of Death: ") + data["health"] = list( + record_type = RECORD_TYPE_GENERAL, + stat = MOB_HEALTH_STATUS, + value = target_record_general?.fields[MOB_HEALTH_STATUS], + message = "Health Status: ") + data["autopsy"] = list( + record_type = RECORD_TYPE_MEDICAL, + stat = MOB_AUTOPSY_NOTES, + value = target_record_medical?.fields[MOB_AUTOPSY_NOTES], + message = "Autopsy Notes: ") + data["existingReport"] = target_record_medical?.fields[MOB_AUTOPSY_SUBMISSION] + data["authenticated"] = authenticated + data["has_id"] = !!target_id_card + data["id_name"] = target_id_card ? target_id_card.registered_name : "-----" + + return data diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 4138d89908d4..fb61fed9a66a 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -1,489 +1,147 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - -/obj/structure/machinery/computer/secure_data//TODO:SANITY +/obj/structure/machinery/computer/secure_data name = "Security Records" desc = "Used to view and edit personnel's security records" icon_state = "security" req_access = list(ACCESS_MARINE_BRIG) circuit = /obj/item/circuitboard/computer/secure_data - var/obj/item/card/id/scan = null + // if the user currently logged into the system + var/authenticated = FALSE + // ID of the user currently griefing the logs + var/obj/item/card/id/user_id_card = null var/obj/item/device/clue_scanner/scanner = null - var/rank = null - var/screen = 1 - var/datum/data/record/active1 = null - var/datum/data/record/active2 = null - var/a_id = null - var/temp = null - var/printing = null - var/can_change_id = 0 - var/list/Perp - var/tempname = null - //Sorting Variables - var/sortBy = "name" - var/order = 1 // -1 = Descending - 1 = Ascending - -/obj/structure/machinery/computer/secure_data/attackby(obj/item/O as obj, user as mob) - - if(istype(O, /obj/item/device/clue_scanner) && !scanner) - var/obj/item/device/clue_scanner/S = O - if(!S.print_list) - to_chat(user, SPAN_WARNING("There are no prints stored in \the [S]!")) - return + // the names of all living human mobs. + var/list/human_mob_names = list() + // the name of the mob we select to view security logs from. + var/target_mob + // target's general record + var/list/target_general_record = list() + + // target security related logs, it needs to be separate because otherwise it's a pain to parse in tgui. + var/list/crime_stat = list() + var/list/incident = list() + var/list/notes = list() + +/obj/structure/machinery/computer/secure_data/proc/authenticate(mob/user, obj/item/card/id/id_card) + if(!id_card) + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH ERROR: Authority confirmation card is missing!\"") + return FALSE + + if(check_access(id_card)) + authenticated = TRUE + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGIN: Welcome, [id_card.registered_name]. Access granted.\"") + update_static_data(user) + return TRUE + + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH ERROR: You have not enough authority! Access denied.\"") + return FALSE + +/obj/structure/machinery/computer/secure_data/attackby(obj/card, mob/user) + if(!operable()) + to_chat(user, SPAN_NOTICE("You tried to inject [card] but [src] remains silent.")) + return - if(usr.drop_held_item()) - O.forceMove(src) - scanner = O - to_chat(user, "You insert [O].") + if(istype(card, /obj/item/card/id)) + if(user_id_card) + to_chat(user, "Remove the card first.") + return - ..() + var/obj/item/card/id/idcard = card + if(!authenticate(user, card) && !is_not_allowed(user)) + return + user_id_card = idcard + if(user.drop_held_item()) + idcard.forceMove(src) + update_static_data(user) + else + ..() -/obj/structure/machinery/computer/secure_data/attack_remote(mob/user as mob) - return attack_hand(user) +/obj/structure/machinery/computer/secure_data/verb/eject_id() + set category = "Object" + set name = "Eject ID Card" + set src in oview(1) -//Someone needs to break down the dat += into chunks instead of long ass lines. -/obj/structure/machinery/computer/secure_data/attack_hand(mob/user as mob) - if(..() || inoperable()) - to_chat(user, SPAN_INFO("It does not appear to be working.")) + if(!usr || usr.is_mob_incapacitated()) return - if(!allowed(usr)) - to_chat(user, SPAN_WARNING("Access denied.")) - return + if(user_id_card) + user_id_card.loc = get_turf(src) + if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + usr.put_in_hands(user_id_card) + if(operable()) + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") + else + to_chat(usr, "You remove [user_id_card] from [src].") + authenticated = FALSE + user_id_card = null + else + to_chat(usr, "There is nothing to remove from the console.") + return + +// dump the general records, get all of the names. Immutable data. +/obj/structure/machinery/computer/secure_data/proc/retrieve_human_mob_names() + var/list/mob_names + + // No, we can't use GLOB.human_mob_list since a mob is removed from that list when it gets deleted. + for(var/record in GLOB.data_core.general) + var/datum/data/record/new_record = GLOB.data_core.general[record] + mob_names += new_record.fields[MOB_NAME] - if(!is_mainship_level(z)) - to_chat(user, SPAN_DANGER("Unable to establish a connection: \black You're too far away from the station!")) + return mob_names + +// to make accessing the records more performant we only retrieve the security logs when a new target is selected in tgui or the record itself is updated. +/obj/structure/machinery/computer/secure_data/proc/retrieve_target_record(username) + if(!username) return - var/dat - if (temp) - dat = text("[]

Clear Screen", temp, src) - else - switch(screen) - if(1.0) - dat += {" -

"} - dat += text("Search Records
", src) - dat += text("New Record
", src) - if(scanner) - dat += text("Read Fingerprint
", src) - dat += {" -

- - - - -
Records:
- - - - - - -"} - if(!isnull(GLOB.data_core.general)) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) - var/crimstat = "" - for(var/datum/data/record/E in GLOB.data_core.security) - if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - crimstat = E.fields["criminal"] - var/background - switch(crimstat) - if("*Arrest*") - background = "'background-color:#990c28;'" - if("Incarcerated") - background = "'background-color:#a16832;'" - if("Released") - background = "'background-color:#2981b3;'" - if("Suspect") - background = "'background-color:#686A6C;'" - if("NJP") - background = "'background-color:#faa20a;'" - if("None") - background = "'background-color:#008743;'" - if("") - background = "'background-color:#FFFFFF;'" - crimstat = "No Record." - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", crimstat) - dat += "
NameIDRankCriminal Status
[][][][]

" - dat += text("Record Maintenance

", src) - if(2.0) - dat += "Records Maintenance
" - dat += "
Delete All Records

Back" - if(3.0) - dat += "
Security Record

" - if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - dat += text(" \ -
\ - Name: [active1.fields["name"]]
\ - ID: [active1.fields["id"]]
\n \ - Sex: [active1.fields["sex"]]
\n \ - Age: [active1.fields["age"]]
\n \ - Rank: [active1.fields["rank"]]
\n \ - Physical Status: [active1.fields["p_stat"]]
\n \ - Mental Status: [active1.fields["m_stat"]]
Photo:
\ - \ -

Update front photo

Update side photo
\ -
") - else - dat += "General Record Lost!
" - if ((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) - dat += text("
\n
Security Data

\n \ - Criminal Status: []
\n \ - Incidents: [active2.fields["incident"]]
\n \ - \n
\n
Comments/Log

", \ - src, active2.fields["criminal"]) - if(islist(active2.fields["comments"])) - var/counter = 1 - for(var/com_i in active2.fields["comments"]) - var/comment = active2.fields["comments"][com_i] - var/comment_markup = text("[] / [] ([])\n", comment["created_at"], comment["created_by"]["name"], comment["created_by"]["rank"]) - if (isnull(comment["deleted_by"])) - comment_markup += text("Delete comment", src, counter) - comment_markup += text("
[]", comment["entry"]) - else - comment_markup += text("
Comment deleted by [] at []", comment["deleted_by"], comment["deleted_at"]) - counter++ - dat += "[comment_markup]

" - else - dat += "No comments

" - dat += text("Add comment

", src) - else - dat += "Security Record Lost!
" - dat += text("New Security Record

", src) - dat += text("\nPrint Record
\nBack
", src, src) - if(4.0) - if(!Perp.len) - dat += text("ERROR. String could not be located.

Back", src) - else - dat += {" - - "} - dat += text("", tempname) - dat += {" - -
Search Results for '[]':
- - - - - - - "} - for(var/i=1, i<=Perp.len, i += 2) - var/crimstat = "" - var/datum/data/record/R = Perp[i] - if(istype(Perp[i+1],/datum/data/record/)) - var/datum/data/record/E = Perp[i+1] - crimstat = E.fields["criminal"] - var/background - switch(crimstat) - if("*Arrest*") - background = "'background-color:#BB1133;'" - if("Incarcerated") - background = "'background-color:#B6732F;'" - if("Released") - background = "'background-color:#3BB9FF;'" - if("Suspect") - background = "'background-color:#686A6C;'" - if("NJP") - background = "'background-color:#faa20a;'" - if("None") - background = "'background-color:#1AAFFF;'" - if("") - background = "" - crimstat = "No Record." - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", crimstat) - dat += "
NameIDRankCriminal Status
[][][][]

" - dat += text("
Return to index.", src) - if(5) - dat += generate_fingerprint_menu() - - show_browser(user, dat, "Security Records", "secure_rec", "size=600x400") - return + // lowkey this use of associated lists for the record_id is unnecessary in the new implementation, whatever, in 10 years someone can refactor it again. + var/datum/data/record/target_sec_record = retrieve_record(mob_name = username, record_type = RECORD_TYPE_SECURITY) + var/datum/data/record/target_gen_record = retrieve_record(mob_name = username, record_type = RECORD_TYPE_GENERAL) + target_general_record = list( + list(value = target_gen_record?.fields[MOB_NAME],message = "Name: "), + list(value = target_gen_record?.fields[MOB_AGE], message ="Age: "), + list(value = target_gen_record?.fields[MOB_SEX], message ="Sex: "), + ) + + crime_stat = list( + record_type = RECORD_TYPE_SECURITY, + stat = MOB_CRIMINAL_STATUS, + value = target_sec_record?.fields[MOB_CRIMINAL_STATUS], + message = "Criminal Status: " + ) + incident = list( + record_type = RECORD_TYPE_SECURITY, + stat = MOB_INCIDENTS, + value = target_sec_record?.fields[MOB_INCIDENTS], + message = "Incidents: " + ) + notes = list( + record_type = RECORD_TYPE_SECURITY, + stat = MOB_SECURITY_NOTES, + value = target_sec_record?.fields[MOB_SECURITY_NOTES], + message ="Security Notes: " + ) + + if(!target_gen_record || !crime_stat) + visible_message("[SPAN_BOLD("[src]")] states, \"DATACORE FAILURE: Unable to retrieve database logs.\"") + return FALSE + return TRUE + + +/obj/structure/machinery/computer/secure_data/attack_hand(mob/user as mob) + if(..() || inoperable()) + return -/*Revised /N -I can't be bothered to look more of the actual code outside of switch but that probably needs revising too. -What a mess.*/ -/obj/structure/machinery/computer/secure_data/Topic(href, href_list) - if(..()) + if(!retrieve_human_mob_names()) + visible_message("[SPAN_BOLD("[src]")] states, \"DATACORE FAILURE: Unable to retrieve database logs.\"") return - if (!( GLOB.data_core.general.Find(active1) )) - active1 = null - if (!( GLOB.data_core.security.Find(active2) )) - active2 = null - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (isSilicon(usr))) - usr.set_interaction(src) - switch(href_list["choice"]) -// SORTING! - if("Sorting") - // Reverse the order if clicked twice - if(sortBy == href_list["sort"]) - if(order == 1) - order = -1 - else - order = 1 - else - // New sorting order! - sortBy = href_list["sort"] - order = initial(order) -//BASIC FUNCTIONS - if("Clear Screen") - temp = null - - if ("Return") - screen = 1 - active1 = null - active2 = null - - if("read_fingerprint") - screen = 5 - - if("print_report") - var/obj/item/paper/fingerprint/P = new /obj/item/paper/fingerprint(src, scanner.print_list) - P.forceMove(loc) - var/refkey = "" - for(var/obj/effect/decal/prints/print in scanner.print_list) - refkey += print.criminal_name - P.name = "fingerprint report ([md5(refkey)])" - playsound(loc, 'sound/machines/twobeep.ogg', 15, 1) - - if("return_menu") - screen = 1 - - if("return_clear") - QDEL_NULL_LIST(scanner.print_list) - scanner.update_icon() - scanner.forceMove(get_turf(src)) - scanner = null - screen = 1 - -//RECORD FUNCTIONS - if("Search Records") - var/t1 = input("Search String: (Partial Name or ID or Rank)", "Secure. records", null, null) as text - if ((!t1 || usr.stat || usr.is_mob_restrained() || !in_range(src, usr))) - return - Perp = new/list() - t1 = lowertext(t1) - var/list/components = splittext(t1, " ") - if(components.len > 5) - return //Lets not let them search too greedily. - for(var/datum/data/record/R in GLOB.data_core.general) - var/temptext = R.fields["name"] + " " + R.fields["id"] + " " + R.fields["rank"] - for(var/i = 1, i<=components.len, i++) - if(findtext(temptext,components[i])) - var/prelist = new/list(2) - prelist[1] = R - Perp += prelist - for(var/i = 1, i<=Perp.len, i+=2) - for(var/datum/data/record/E in GLOB.data_core.security) - var/datum/data/record/R = Perp[i] - if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - Perp[i+1] = E - tempname = t1 - screen = 4 - - if("Record Maintenance") - screen = 2 - active1 = null - active2 = null - - if ("Browse Record") - var/datum/data/record/R = locate(href_list["d_rec"]) - var/S = locate(href_list["d_rec"]) - if (!( GLOB.data_core.general.Find(R) )) - temp = "Record Not Found!" - else - for(var/datum/data/record/E in GLOB.data_core.security) - if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) - S = E - active1 = R - active2 = S - screen = 3 - - - if ("Print Record") - if (!( printing )) - printing = 1 - var/datum/data/record/record1 = null - var/datum/data/record/record2 = null - if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - record1 = active1 - if ((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) - record2 = active2 - sleep(50) - var/obj/item/paper/P = new /obj/item/paper( loc ) - P.info = "
Security Record

" - if (record1) - P.info += text("Name: []
\nID: []
\nSex: []
\nAge: []
\nRank: []
\nPhysical Status: []
\nMental Status: []
Criminal Status: []
", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["rank"], record1.fields["p_stat"], record1.fields["m_stat"], record2.fields["criminal"]) - P.name = text("Security Record ([])", record1.fields["name"]) - else - P.info += "General Record Lost!
" - P.name = "Security Record" - if (record2) - P.info += text("
\n
Security Data

\nIncidents: [record2.fields["incident"]]
\n
\n
Comments/Log

") - if(islist(record2.fields["comments"]) || length(record2.fields["comments"]) > 0) - for(var/com_i in record2.fields["comments"]) - var/comment = record2.fields["comments"][com_i] - var/comment_markup = text("[] / [] ([])
", comment["created_at"], comment["created_by"]["name"], comment["created_by"]["rank"]) - if (isnull(comment["deleted_by"])) - comment_markup += comment["entry"] - else - comment_markup += text("Comment deleted by [] at []", comment["deleted_by"], comment["deleted_at"]) - P.info += "[comment_markup]

" - else - P.info += text("No comments
") - else - P.info += "Security Record Lost!
" - P.info += "" - printing = null - updateUsrDialog() -//RECORD DELETE - if ("Delete All Records") - temp = "" - temp += "Are you sure you wish to delete all Security records?
" - temp += "Yes
" - temp += "No" - - if ("Purge All Records") - for(var/datum/data/record/R in GLOB.data_core.security) - GLOB.data_core.security -= R - qdel(R) - temp = "All Security records deleted." - - if ("Add Entry") - if (!(istype(active2, /datum/data/record))) - return - var/a2 = active2 - var/t1 = copytext(trim(strip_html(input("Your name and time will be added to this new comment.", "Add a comment", null, null) as message)),1,MAX_MESSAGE_LEN) - if((!t1 || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isSilicon(usr))) || active2 != a2)) - return - var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) - var/new_comment = list("entry" = t1, "created_by" = list("name" = "", "rank" = ""), "deleted_by" = null, "deleted_at" = null, "created_at" = created_at) - if(istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/U = usr - new_comment["created_by"] = list("name" = U.get_authentification_name(), "rank" = U.get_assignment()) - if(!islist(active2.fields["comments"])) - active2.fields["comments"] = list("1" = new_comment) - else - var/new_com_i = length(active2.fields["comments"]) + 1 - active2.fields["comments"]["[new_com_i]"] = new_comment - to_chat(usr, text("You have added a new comment to the Security Record of [].", active2.fields["name"])) + user.set_interaction(src) + tgui_interact(user) - if ("Delete Entry") - if(!islist(active2.fields["comments"])) - return - if(active2.fields["comments"][href_list["del_c"]]) - var/updated_comments = active2.fields["comments"] - var/deleter = "" - if(istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/U = usr - deleter = "[U.get_authentification_name()] ([U.get_assignment()])" - updated_comments[href_list["del_c"]]["deleted_by"] = deleter - updated_comments[href_list["del_c"]]["deleted_at"] = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) - active2.fields["comments"] = updated_comments - to_chat(usr, text("You have deleted a comment from the Security Record of [].", active2.fields["name"])) -//RECORD CREATE - if ("New Record (Security)") - if ((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) ))) - active2 = CreateSecurityRecord(active1.fields["name"], active1.fields["id"]) - screen = 3 - - if ("New Record (General)") - active1 = CreateGeneralRecord() - active2 = null - -//FIELD FUNCTIONS - if ("Edit Field") - if (is_not_allowed(usr)) - return - var/a1 = active1 - switch(href_list["field"]) - if("name") - if (istype(active1, /datum/data/record)) - var/t1 = reject_bad_name(input(usr, "Please input name:", "Secure. records", active1.fields["name"]) as text|null) - if (!t1 || active1 != a1) - return - message_admins("[key_name(usr)] has changed the record name of [active1.fields["name"]] to [t1]") - active1.fields["name"] = t1 - if("sex") - if (istype(active1, /datum/data/record)) - if (active1.fields["sex"] == "Male") - active1.fields["sex"] = "Female" - else - active1.fields["sex"] = "Male" - if("age") - if (istype(active1, /datum/data/record)) - var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num - if (!t1 || active1 != a1) - return - active1.fields["age"] = t1 - if("criminal") - if (istype(active2, /datum/data/record)) - temp = "
Criminal Status:
" - temp += "" - if("rank") - //This was so silly before the change. Now it actually works without beating your head against the keyboard. /N - if (istype(active1, /datum/data/record) && GLOB.uscm_highcom_paygrades.Find(rank)) - temp = "
Occupation:
" - temp += "" - else - alert(usr, "You do not have the required rank to do this!") - if("species") - if (istype(active1, /datum/data/record)) - var/t1 = copytext(trim(strip_html(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN) - if (!t1 || active1 != a1) - return - active1.fields["species"] = t1 - - -//TEMPORARY MENU FUNCTIONS - else//To properly clear as per clear screen. - temp=null - switch(href_list["choice"]) - if ("Change Rank") - if (active1) - active1.fields["rank"] = href_list["rank"] - if(href_list["rank"] in GLOB.joblist) - active1.fields["real_rank"] = href_list["real_rank"] - - if ("Change Criminal Status") - if (active2) - switch(href_list["criminal2"]) - if("none") - active2.fields["criminal"] = "None" - if("arrest") - active2.fields["criminal"] = "*Arrest*" - if("incarcerated") - active2.fields["criminal"] = "Incarcerated" - if("released") - active2.fields["criminal"] = "Released" - if("suspect") - active2.fields["criminal"] = "Suspect" - if("njp") - active2.fields["criminal"] = "NJP" - - for(var/mob/living/carbon/human/H in GLOB.human_mob_list) - H.sec_hud_set_security_status() - - add_fingerprint(usr) - updateUsrDialog() - return +/obj/structure/machinery/computer/secure_data/attack_remote(mob/user as mob) + return attack_hand(user) + +/obj/structure/machinery/computer/secure_data/bullet_act() + return FALSE /obj/structure/machinery/computer/secure_data/proc/generate_fingerprint_menu() var/dat = "" @@ -521,24 +179,108 @@ What a mess.*/ if(prob(10/severity)) switch(rand(1,6)) if(1) - R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" + R.fields[MOB_NAME] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) - R.fields["sex"] = pick("Male", "Female") + R.fields[MOB_SEX] = pick(MOB_STAT_SEX_MALE, MOB_STAT_SEX_FEMALE) if(3) - R.fields["age"] = rand(5, 85) + R.fields[MOB_AGE] = rand(5, 85) if(4) - R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Released", "Suspect", "NJP") + R.fields[MOB_CRIMINAL_STATUS] = pick(MOB_STAT_CRIME_STATUS_LIST) if(5) - R.fields["p_stat"] = pick("*Unconscious*", "Active", "Physically Unfit") + R.fields[MOB_HEALTH_STATUS] = pick(MOB_STAT_HEALTH_LIST) if(6) - R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") - continue - - else if(prob(1)) - GLOB.data_core.security -= R - qdel(R) + R.fields[MOB_MENTAL_STATUS] = pick(MOB_STAT_MENTAL_STATUS_LIST) continue /obj/structure/machinery/computer/secure_data/detective_computer icon = 'icons/obj/structures/machinery/computer.dmi' icon_state = "messyfiles" + +// TGUI SEC +// ------------------------------------------------------------------------------------------------------ // +/obj/structure/machinery/computer/secure_data/tgui_interact(mob/user, datum/tgui/ui) + + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "SecRec", name) + ui.open() + +/obj/structure/machinery/computer/secure_data/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + + var/mob/user = ui.user + playsound(src, "keyboard_alt", 5, 1) + switch(action) + if("authenticate") + var/obj/item/id_card = user.get_active_hand() + if (istype(id_card, /obj/item/card/id)) + if(user.drop_held_item()) + id_card.forceMove(src) + user_id_card = id_card + if(authenticate(user, user_id_card)) + return TRUE + else + if(!user_id_card) + return + if(ishuman(user)) + user_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(user_id_card) + else + user_id_card.forceMove(loc) + user_id_card = null + if("logout") + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") + authenticated = FALSE + if(ishuman(user)) + user_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(user_id_card) + else + user_id_card.forceMove(loc) + user_id_card = null + target_mob = null + return TRUE + if("selectTarget") + var/name = params["new_user"] + if(name == target_mob) + target_mob = null // deselected the mob in tgui. + return + target_mob = name + if(!retrieve_target_record(name)) + target_mob = null + return + + return TRUE + if("updateStatRecord") + if(!insert_record_stat(mob_name = target_mob, record_type = params["record_type"], stat_type = params["stat"], new_stat = params["new_value"])) + visible_message("[SPAN_BOLD("[src]")] states, \"DATACORE FAILURE: Unable to update relevant database logs.\"") + return + retrieve_target_record(target_mob) + if(params["stat"] == MOB_CRIMINAL_STATUS) + for(var/mob/living/carbon/human/human as anything in GLOB.human_mob_list) + if(human.name == target_mob) + human.sec_hud_set_security_status() + return TRUE + return TRUE + +/obj/structure/machinery/computer/secure_data/ui_static_data(mob/user) + var/list/data = list() + data["mob_names"] = human_mob_names + return data + +/obj/structure/machinery/computer/secure_data/ui_data(mob/user) + var/list/data = list() + + data["human_mob_list"] = GLOB.human_mob_list + data["selected_target_name"] = target_mob ? target_mob : FALSE + data["crime_stat"] = crime_stat + data["incident"] = incident + data["notes"] = notes + data["general_record"] = target_general_record + data["id_name"] = user_id_card ? user_id_card?.name : "-----" + data["authenticated"] = authenticated + + return data diff --git a/code/game/machinery/computer/sentencing.dm b/code/game/machinery/computer/sentencing.dm index 3aa9b5a032a8..478cd3a7f7b8 100644 --- a/code/game/machinery/computer/sentencing.dm +++ b/code/game/machinery/computer/sentencing.dm @@ -198,15 +198,9 @@ // Update criminal record. if (incident.criminal_gid) - for (var/datum/data/record/R in GLOB.data_core.security) - if (R.fields["id"] == incident.criminal_gid) - var/datum/data/record/found_record = R + var/datum/data/record/target_sec_record = retrieve_record(mob_name = incident.criminal_name, record_type = RECORD_TYPE_SECURITY) + target_sec_record.fields[MOB_INCIDENTS] += "Crime: [incident.charges_to_string()] Notes: [incident.notes] " - found_record.fields["incident"] += "
\ - Crime: [incident.charges_to_string()].
\ - Notes: [incident.notes].
" - - break var/obj/item/paper/incident/paper = new /obj/item/paper/incident(loc) paper.incident = incident diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm deleted file mode 100644 index cc4d93f5a24c..000000000000 --- a/code/game/machinery/computer/skills.dm +++ /dev/null @@ -1,369 +0,0 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - -/obj/structure/machinery/computer/skills//TODO:SANITY - name = "Employment Records" - desc = "Used to view personnel's employment records" - icon_state = "medlaptop" - req_one_access = list(ACCESS_MARINE_DATABASE) - circuit = /obj/item/circuitboard/computer/skills - var/obj/item/card/id/scan = null - var/authenticated = null - var/rank = null - var/screen = null - var/datum/data/record/active1 = null - var/a_id = null - var/temp = null - var/printing = null - var/can_change_id = 0 - var/list/Perp - var/tempname = null - //Sorting Variables - var/sortBy = "name" - var/order = 1 // -1 = Descending - 1 = Ascending - - -/obj/structure/machinery/computer/skills/attackby(obj/item/O as obj, user as mob) - if(istype(O, /obj/item/card/id) && !scan) - if(usr.drop_held_item()) - O.forceMove(src) - scan = O - to_chat(user, "You insert [O].") - ..() - -/obj/structure/machinery/computer/skills/attack_remote(mob/user as mob) - return attack_hand(user) - -//Someone needs to break down the dat += into chunks instead of long ass lines. -/obj/structure/machinery/computer/skills/attack_hand(mob/user as mob) - if(..()) - return - if (src.z > 6) - to_chat(user, SPAN_DANGER("Unable to establish a connection: \black You're too far away from the station!")) - return - var/dat - - if (temp) - dat = "[temp]

Clear Screen" - else - dat = "Confirm Identity: [scan ? scan.name : "----------"]
" - if (authenticated) - switch(screen) - if(1.0) - dat += {" -

"} - dat += "Search Records
" - dat += "New Record
" - dat += {" -

- - - - -
Records:
- - - - - - -"} - if(!isnull(GLOB.data_core.general)) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) - for(var/datum/data/record/E in GLOB.data_core.security) - dat += "" - dat += "" - dat += "" - dat += "
NameIDRankFingerprints
[R.fields["name"]][R.fields["id"]][R.fields["rank"]]

" - dat += "Record Maintenance

" - dat += "{Log Out}" - if(2.0) - dat += "Records Maintenance
" - dat += "
Delete All Records

Back" - if(3.0) - dat += "
Employment Record

" - if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - dat += " \ -
\ - Name: [active1.fields["name"]]
\ - ID: [active1.fields["id"]]
\n \ - Sex: [active1.fields["sex"]]
\n \ - Age: [active1.fields["age"]]
\n \ - Rank: [active1.fields["rank"]]
\n \ - Physical Status: [active1.fields["p_stat"]]
\n \ - Mental Status: [active1.fields["m_stat"]]

\n \ - Employment/skills summary:
[decode(active1.fields["notes"])]
Photo:
\ -
" - else - dat += "General Record Lost!
" - dat += "\nDelete Record (ALL)

\nPrint Record
\nBack
" - if(4.0) - if(!Perp.len) - dat += "ERROR. String could not be located.

Back" - else - dat += {" - - "} - dat += "" - dat += {" - -
Search Results for '[tempname]':
- - - - - - - "} - for(var/i=1, i<=Perp.len, i += 2) - var/crimstat = "" - var/datum/data/record/R = Perp[i] - if(istype(Perp[i+1],/datum/data/record/)) - var/datum/data/record/E = Perp[i+1] - crimstat = E.fields["criminal"] - dat += "" - dat += "" - dat += "" - dat += "" - dat += "
NameIDRankFingerprints
[R.fields["name"]][R.fields["id"]][R.fields["rank"]][crimstat]

" - dat += "
Return to index." - else - dat += "{Log In}" - show_browser(user, dat, "Employment Records", "secure_rec", "size=600x400") - onclose(user, "secure_rec") - return - -/*Revised /N -I can't be bothered to look more of the actual code outside of switch but that probably needs revising too. -What a mess.*/ -/obj/structure/machinery/computer/skills/Topic(href, href_list) - if(..()) - return - if (!( GLOB.data_core.general.Find(active1) )) - active1 = null - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (isRemoteControlling(usr))) - usr.set_interaction(src) - switch(href_list["choice"]) -// SORTING! - if("Sorting") - // Reverse the order if clicked twice - if(sortBy == href_list["sort"]) - if(order == 1) - order = -1 - else - order = 1 - else - // New sorting order! - sortBy = href_list["sort"] - order = initial(order) -//BASIC FUNCTIONS - if("Clear Screen") - temp = null - - if ("Return") - screen = 1 - active1 = null - - if("Confirm Identity") - if (scan) - if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hands(scan) - else - scan.forceMove(get_turf(src)) - scan = null - else - var/obj/item/I = usr.get_active_hand() - if (istype(I, /obj/item/card/id)) - if(usr.drop_held_item()) - I.forceMove(src) - scan = I - - if("Log Out") - authenticated = null - screen = null - active1 = null - - if("Log In") - if (isRemoteControlling(usr)) - src.active1 = null - src.authenticated = usr.name - src.rank = "AI" - src.screen = 1 - else if (istype(scan, /obj/item/card/id)) - active1 = null - if(check_access(scan)) - authenticated = scan.registered_name - rank = scan.paygrade - screen = 1 -//RECORD FUNCTIONS - if("Search Records") - var/t1 = input("Search String: (Partial Name or ID or Fingerprints or Rank)", "Secure. records", null, null) as text - if ((!( t1 ) || usr.stat || !( authenticated ) || usr.is_mob_restrained() || !in_range(src, usr))) - return - Perp = new/list() - t1 = lowertext(t1) - var/list/components = splittext(t1, " ") - if(components.len > 5) - return //Lets not let them search too greedily. - for(var/datum/data/record/R in GLOB.data_core.general) - var/temptext = R.fields["name"] + " " + R.fields["id"] + " " + R.fields["rank"] - for(var/i = 1, i<=components.len, i++) - if(findtext(temptext,components[i])) - var/prelist = new/list(2) - prelist[1] = R - Perp += prelist - for(var/i = 1, i<=Perp.len, i+=2) - for(var/datum/data/record/E in GLOB.data_core.security) - var/datum/data/record/R = Perp[i] - if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - Perp[i+1] = E - tempname = t1 - screen = 4 - - if("Record Maintenance") - screen = 2 - active1 = null - - if ("Browse Record") - var/datum/data/record/R = locate(href_list["d_rec"]) - if (!( GLOB.data_core.general.Find(R) )) - temp = "Record Not Found!" - else - for(var/datum/data/record/E in GLOB.data_core.security) - active1 = R - screen = 3 - - if ("Print Record") - if (!( printing )) - printing = 1 - sleep(50) - var/obj/item/paper/P = new /obj/item/paper( loc ) - P.info = "
Employment Record

" - if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - P.info += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
\nSex: [active1.fields["sex"]]
\nAge: [active1.fields["age"]]
\nPhysical Status: [active1.fields["p_stat"]]
\nMental Status: [active1.fields["m_stat"]]
\nEmployment/Skills Summary:
\n[decode(active1.fields["notes"])]
" - P.name = "Employment Record ([active1.fields["name"]])" - else - P.info += "General Record Lost!
" - P.name = "Employment Record (???)" - P.info += "" - - printing = null -//RECORD DELETE - if ("Delete All Records") - temp = "" - temp += "Are you sure you wish to delete all Employment records?
" - temp += "Yes
" - temp += "No" - - if ("Purge All Records") - for(var/datum/data/record/R in GLOB.data_core.security) - GLOB.data_core.security -= R - qdel(R) - temp = "All Employment records deleted." - - if ("Delete Record (ALL)") - if (active1) - temp = "
Are you sure you wish to delete the record (ALL)?
" - temp += "Yes
" - temp += "No" -//RECORD CREATE - if ("New Record (General)") - active1 = CreateGeneralRecord() - -//FIELD FUNCTIONS - if ("Edit Field") - var/a1 = active1 - switch(href_list["field"]) - if("name") - if (istype(active1, /datum/data/record)) - var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text) - if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr)))) || active1 != a1) - return - message_admins("[key_name(usr)] has changed the record name of [active1.fields["name"]] to [t1]") - active1.fields["name"] = t1 - if("id") - if (istype(active1, /datum/data/record)) - var/t1 = copytext(trim(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || active1 != a1)) - return - active1.fields["id"] = t1 - - if("sex") - if (istype(active1, /datum/data/record)) - if (active1.fields["sex"] == "Male") - active1.fields["sex"] = "Female" - else - active1.fields["sex"] = "Male" - if("age") - if (istype(active1, /datum/data/record)) - var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num - if ((!( t1 ) || !( authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || active1 != a1)) - return - active1.fields["age"] = t1 - if("rank") - //This was so silly before the change. Now it actually works without beating your head against the keyboard. /N - if(istype(active1, /datum/data/record) && GLOB.uscm_highcom_paygrades.Find(rank)) - temp = "
Occupation:
" - temp += "" - else - alert(usr, "You do not have the required rank to do this!") - if("species") - if (istype(active1, /datum/data/record)) - var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN) - if ((!( t1 ) || !( authenticated ) || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!isRemoteControlling(usr))) || active1 != a1)) - return - active1.fields["species"] = t1 - -//TEMPORARY MENU FUNCTIONS - else//To properly clear as per clear screen. - temp=null - switch(href_list["choice"]) - if ("Change Rank") - if (active1) - active1.fields["rank"] = href_list["rank"] - if(href_list["rank"] in GLOB.joblist) - active1.fields["real_rank"] = href_list["real_rank"] - - if ("Delete Record (ALL) Execute") - if (active1) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])) - GLOB.data_core.medical -= R - qdel(R) - QDEL_NULL(active1) - else - temp = "This function does not appear to be working at the moment. Our apologies." - - add_fingerprint(usr) - updateUsrDialog() - return - -/obj/structure/machinery/computer/skills/emp_act(severity) - . = ..() - if(inoperable()) - return - - for(var/datum/data/record/R in GLOB.data_core.security) - if(prob(10/severity)) - switch(rand(1,6)) - if(1) - R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" - if(2) - R.fields["sex"] = pick("Male", "Female") - if(3) - R.fields["age"] = rand(5, 85) - if(4) - R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Released") - if(5) - R.fields["p_stat"] = pick("*Unconscious*", "Active", "Physically Unfit") - if(6) - R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") - continue - - else if(prob(1)) - GLOB.data_core.security -= R - qdel(R) - continue - diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 1793b87c72ae..1e0da9cab722 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -353,20 +353,15 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) - var/occupant_ref = WEAKREF(occupant) - //Delete them from datacore. - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if((R.fields["ref"] == occupant_ref)) - GLOB.data_core.medical -= R - qdel(R) - for(var/datum/data/record/T in GLOB.data_core.security) - if((T.fields["ref"] == occupant_ref)) - GLOB.data_core.security -= T - qdel(T) - for(var/datum/data/record/G in GLOB.data_core.general) - if((G.fields["ref"] == occupant_ref)) - GLOB.data_core.general -= G - qdel(G) + var/mob/living/carbon/human/cryo_pod = occupant + if(cryo_pod.record_id_ref) + QDEL_NULL(GLOB.data_core.medical[cryo_pod.record_id_ref]) + QDEL_NULL(GLOB.data_core.general[cryo_pod.record_id_ref]) + QDEL_NULL(GLOB.data_core.security[cryo_pod.record_id_ref]) + GLOB.data_core.medical -= cryo_pod.record_id_ref + GLOB.data_core.general -= cryo_pod.record_id_ref + GLOB.data_core.security -= cryo_pod.record_id_ref + icon_state = "body_scanner_open" set_light(0) diff --git a/code/game/machinery/medical_pod/autodoc.dm b/code/game/machinery/medical_pod/autodoc.dm index 937afa0cdb4d..dd2e6530ae19 100644 --- a/code/game/machinery/medical_pod/autodoc.dm +++ b/code/game/machinery/medical_pod/autodoc.dm @@ -273,7 +273,7 @@ surgery_list += create_autodoc_surgery(null,EXTERNAL_SURGERY,"blood") return surgery_list -/obj/structure/machinery/medical_pod/autodoc/proc/surgery_op(mob/living/carbon/M) +/obj/structure/machinery/medical_pod/autodoc/proc/surgery_op(mob/living/carbon/human/M) set background = 1 if(M.stat == DEAD||!ishuman(M)) @@ -284,12 +284,10 @@ var/mob/living/carbon/human/H = M var/datum/data/record/N = null var/human_ref = WEAKREF(H) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == human_ref) - N = R + N = retrieve_record(record_id_ref = H.record_id_ref, mob_ref = human_ref, record_type = RECORD_TYPE_MEDICAL) if(isnull(N)) - visible_message("\The [src] buzzes: No records found for occupant.") - src.go_out() //kick them out too. + visible_message("[src] buzzes: No records found for occupant.") + go_out() //kick them out too. return var/list/surgery_todo_list = N.fields["autodoc_manual"] @@ -702,14 +700,12 @@ var/list/surgeryqueue = list() var/datum/data/record/N = null var/occupant_ref = WEAKREF(connected.occupant) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == occupant_ref) - N = R + N = retrieve_record(record_id_ref = connected.occupant.record_id_ref, mob_ref = occupant_ref, record_type = RECORD_TYPE_MEDICAL) if(isnull(N)) N = create_medical_record(connected.occupant) - if(!isnull(N.fields["autodoc_manual"])) - for(var/datum/autodoc_surgery/A in N.fields["autodoc_manual"]) + if(!isnull(N.fields[MOB_AUTODOC_MANUAL])) + for(var/datum/autodoc_surgery/A in N.fields[MOB_AUTODOC_MANUAL]) switch(A.type_of_surgery) if(EXTERNAL_SURGERY) switch(A.surgery_procedure) @@ -815,30 +811,28 @@ // manual surgery handling var/datum/data/record/N = null var/occupant_ref = WEAKREF(connected.occupant) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == occupant_ref) - N = R + N = retrieve_record(record_id_ref = connected.occupant.record_id_ref, mob_ref = occupant_ref, record_type = RECORD_TYPE_MEDICAL) if(isnull(N)) N = create_medical_record(connected.occupant) var/needed = 0 // this is to stop someone just choosing everything if(href_list["brute"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"brute") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"brute") updateUsrDialog() if(href_list["burn"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"burn") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"burn") updateUsrDialog() if(href_list["toxin"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"toxin") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"toxin") updateUsrDialog() if(href_list["dialysis"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"dialysis") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"dialysis") updateUsrDialog() if(href_list["blood"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"blood") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,EXTERNAL_SURGERY,"blood") updateUsrDialog() if(href_list["eyes"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,ORGAN_SURGERY,"eyes",0,connected.occupant.internal_organs_by_name["eyes"]) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,ORGAN_SURGERY,"eyes",0,connected.occupant.internal_organs_by_name["eyes"]) updateUsrDialog() if(href_list["organdamage"]) for(var/obj/limb/L in connected.occupant.limbs) @@ -848,10 +842,10 @@ // we can't deal with these continue if(I.damage > 0) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,ORGAN_SURGERY,"damage",0,I) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,ORGAN_SURGERY,"damage",0,I) needed++ if(!needed) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,ORGAN_SURGERY,"damage",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,ORGAN_SURGERY,"damage",1) updateUsrDialog() if(href_list["larva"]) N.fields["autodoc_manual"] += create_autodoc_surgery("chest",ORGAN_SURGERY,"larva",0) @@ -861,21 +855,21 @@ if(L) for(var/datum/wound/W in L.wounds) if(W.internal) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"internal") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"internal") needed++ break if(!needed) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,LIMB_SURGERY,"internal",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,LIMB_SURGERY,"internal",1) updateUsrDialog() if(href_list["broken"]) for(var/obj/limb/L in connected.occupant.limbs) if(L) if(L.status & LIMB_BROKEN) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"broken") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"broken") needed++ if(!needed) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,LIMB_SURGERY,"broken",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,LIMB_SURGERY,"broken",1) updateUsrDialog() if(href_list["missing"]) @@ -883,10 +877,10 @@ if(L) if(L.status & LIMB_DESTROYED) if(!(L.parent.status & LIMB_DESTROYED) && L.name != "head") - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"missing") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"missing") needed++ if(!needed) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,LIMB_SURGERY,"missing",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,LIMB_SURGERY,"missing",1) updateUsrDialog() if(href_list["shrapnel"]) @@ -896,10 +890,10 @@ if(L.implants.len) for(var/I in L.implants) if(!is_type_in_list(I,known_implants)) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"shrapnel") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"shrapnel") needed++ if(!needed) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,LIMB_SURGERY,"shrapnel",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,LIMB_SURGERY,"shrapnel",1) updateUsrDialog() if(href_list["facial"]) @@ -908,9 +902,9 @@ if(istype(L,/obj/limb/head)) var/obj/limb/head/J = L if(J.disfigured) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"facial") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"facial") else - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"facial",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"facial",1) updateUsrDialog() break @@ -918,15 +912,15 @@ for(var/obj/limb/L in connected.occupant.limbs) if(L) if(connected.occupant.incision_depths[L.name] != SURGERY_DEPTH_SURFACE) - N.fields["autodoc_manual"] += create_autodoc_surgery(L,LIMB_SURGERY,"open") + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(L,LIMB_SURGERY,"open") needed++ if(href_list["open"]) - N.fields["autodoc_manual"] += create_autodoc_surgery(null,LIMB_SURGERY,"open",1) + N.fields[MOB_AUTODOC_MANUAL] += create_autodoc_surgery(null,LIMB_SURGERY,"open",1) updateUsrDialog() // The rest if(href_list["clear"]) - N.fields["autodoc_manual"] = list() + N.fields[MOB_AUTODOC_MANUAL] = list() updateUsrDialog() if(href_list["refresh"]) updateUsrDialog() diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index 73e5a87b2304..5904073a1fb6 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -160,21 +160,19 @@ var/mob/living/carbon/human/H = connected.occupant var/datum/data/record/N = null var/human_ref = WEAKREF(H) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == human_ref) - N = R + N = retrieve_record(record_id_ref = H.record_id_ref, mob_ref = human_ref, record_type = RECORD_TYPE_MEDICAL) if(isnull(N)) N = create_medical_record(H) var/list/od = connected.get_occupant_data() var/dat dat = format_occupant_data(od) - N.fields["last_scan_time"] = od["stationtime"] + N.fields[MOB_LAST_SCAN_TIME] = od["stationtime"] // I am sure you are wondering why this is still here. And indeed why the rest of the autodoc html shit is here. // The answer is : it is used in the medical records computer to print out the results of their last scan data // Do I want to make it so that data from a tgui static data proc can go into a piece of paper? no // Do I want to remove the feature from medical records computers? no // and so here we are. - N.fields["last_scan_result"] = dat + N.fields[MOB_LAST_SCAN_RESULT] = dat if (!last_health_display) last_health_display = new(H) @@ -182,9 +180,9 @@ last_health_display.target_mob = H N.fields["last_tgui_scan_result"] = last_health_display.ui_data(user, DETAIL_LEVEL_BODYSCAN) - N.fields["autodoc_data"] = generate_autodoc_surgery_list(H) - visible_message(SPAN_NOTICE("\The [src] pings as it stores the scan report of [H.real_name]")) - playsound(src.loc, 'sound/machines/screen_output1.ogg', 25) + N.fields[MOB_AUTODOC_DATA] = generate_autodoc_surgery_list(H) + visible_message(SPAN_NOTICE("[src] pings as it stores the scan report of [H.real_name]")) + playsound(loc, 'sound/machines/screen_output1.ogg', 25) last_health_display.look_at(user, DETAIL_LEVEL_BODYSCAN, bypass_checks = TRUE) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 3b84d2433e88..afdbb6afd221 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -308,13 +308,11 @@ if(ishuman(stasis_mob) && hasHUD(user,"medical")) var/mob/living/carbon/human/H = stasis_mob var/stasis_ref = WEAKREF(H) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == stasis_ref) - if(!(R.fields["last_scan_time"])) - . += "No scan report on record\n" - else - . += "Scan from [R.fields["last_scan_time"]]\n" - break + var/datum/data/record/medical_record = retrieve_record(record_id_ref = H.record_id_ref, mob_ref = stasis_ref, record_type = RECORD_TYPE_MEDICAL) + if(!medical_record.fields[MOB_LAST_SCAN_TIME]) + . += "No scan report on record\n" + else + . += "Scan from [medical_record.fields[MOB_LAST_SCAN_TIME]]\n" diff --git a/code/game/objects/items/circuitboards/computer.dm b/code/game/objects/items/circuitboards/computer.dm index ecdfba00719d..e78f83d9622d 100644 --- a/code/game/objects/items/circuitboards/computer.dm +++ b/code/game/objects/items/circuitboards/computer.dm @@ -49,7 +49,7 @@ /obj/item/circuitboard/computer/med_data name = "Circuit board (Medical Records)" - build_path = /obj/structure/machinery/computer/med_data + build_path = /obj/structure/machinery/computer/double_id/med_data /obj/item/circuitboard/computer/pandemic name = "Circuit board (PanD.E.M.I.C. 2200)" @@ -65,7 +65,7 @@ /obj/item/circuitboard/computer/card name = "Circuit board (ID Computer)" - build_path = /obj/structure/machinery/computer/card + build_path = /obj/structure/machinery/computer/double_id/card /obj/item/circuitboard/computer/teleporter name = "Circuit board (Teleporter)" @@ -75,16 +75,10 @@ name = "Circuit board (Security Records)" build_path = /obj/structure/machinery/computer/secure_data -/obj/item/circuitboard/computer/skills - name = "Circuit board (Employment Records)" - build_path = /obj/structure/machinery/computer/skills - /obj/item/circuitboard/computer/stationalert name = "Circuit board (Station Alerts)" build_path = /obj/structure/machinery/computer/station_alert - - /obj/item/circuitboard/computer/air_management name = "Circuit board (Atmospheric Monitor)" build_path = /obj/structure/machinery/computer/general_air_control diff --git a/code/game/objects/items/pamphlets.dm b/code/game/objects/items/pamphlets.dm index d8bbb2a01432..ad5b86c9f26b 100644 --- a/code/game/objects/items/pamphlets.dm +++ b/code/game/objects/items/pamphlets.dm @@ -97,7 +97,7 @@ var/obj/item/card/id/ID = user.get_idcard() ID.set_assignment((user.assigned_squad ? (user.assigned_squad.name + " ") : "") + "Spotter") - GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), "Spotter") + GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), "Spotter", record_id_ref = user.record_id_ref) /obj/item/pamphlet/skill/machinegunner name = "heavy machinegunner instructional pamphlet" diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index 21e6fed4f825..73d4042a6fa4 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -102,20 +102,17 @@ //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GLOB.RoleAuthority.roles_for_mode[target.job], TRUE) - //Delete them from datacore. - var/target_ref = WEAKREF(target) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if((R.fields["ref"] == target_ref)) - GLOB.data_core.medical -= R - qdel(R) - for(var/datum/data/record/T in GLOB.data_core.security) - if((T.fields["ref"] == target_ref)) - GLOB.data_core.security -= T - qdel(T) - for(var/datum/data/record/G in GLOB.data_core.general) - if((G.fields["ref"] == target_ref)) - GLOB.data_core.general -= G - qdel(G) + var/mob/living/carbon/human/mob_cryo = null + if(ishuman(target)) + mob_cryo = target + + if(mob_cryo) + QDEL_NULL(GLOB.data_core.medical[mob_cryo.record_id_ref]) + QDEL_NULL(GLOB.data_core.general[mob_cryo.record_id_ref]) + QDEL_NULL(GLOB.data_core.security[mob_cryo.record_id_ref]) + GLOB.data_core.medical -= mob_cryo.record_id_ref + GLOB.data_core.general -= mob_cryo.record_id_ref + GLOB.data_core.security -= mob_cryo.record_id_ref if(target.key) target.ghostize(FALSE) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 12111e12be3a..c419e9f04eba 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2038,11 +2038,10 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(job_title) find_assigned_slot(job_title, is_late_join) if(check_datacore && !(be_random_body && be_random_name)) - for(var/datum/data/record/record as anything in GLOB.data_core.locked) - if(record.fields["name"] == real_name) - be_random_body = TRUE - be_random_name = TRUE - break + var/datum/data/record/old_record = retrieve_record(record_id_ref = character.record_id_ref, record_type = RECORD_TYPE_STATIC) + if(old_record.fields[MOB_NAME] == real_name) + be_random_body = TRUE + be_random_name = TRUE if(be_random_name) real_name = random_name(gender) diff --git a/code/modules/cm_marines/equipment/kit_boxes.dm b/code/modules/cm_marines/equipment/kit_boxes.dm index 149c68f2abda..8a2669c97b9e 100644 --- a/code/modules/cm_marines/equipment/kit_boxes.dm +++ b/code/modules/cm_marines/equipment/kit_boxes.dm @@ -298,7 +298,7 @@ if(specialist_assignment) user.put_in_hands(spec_box) card.set_assignment((user.assigned_squad && squad_assignment_update ? (user.assigned_squad.name + " ") : "") + card.assignment + " ([specialist_assignment])") - GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), card.assignment) + GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), card.assignment, user.record_id_ref) return TRUE return FALSE diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index 6d1aba4aca70..1259b97b8043 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -16,27 +16,21 @@ #define CARDCON_DEPARTMENT_INSPECTION "PMC Investigations" #define CARDCON_DEPARTMENT_SPECIALTY "PMC Specialists" -/obj/structure/machinery/computer/card - name = "Identification Computer" - desc = "Terminal for programming USCM employee ID card access." - icon_state = "id" - req_access = list(ACCESS_MARINE_DATABASE) - circuit = /obj/item/circuitboard/computer/card +// Parent code for computers that take a user and target card id +// ------------------------------------------------------------------------------------------------------------------------------- // +/obj/structure/machinery/computer/double_id + name = "Computer" + desc = "Terminal that takes a user and target ID" + // user who is modifying the target var/obj/item/card/id/user_id_card + // the poor soul whos status needs to be updated as deceased. var/obj/item/card/id/target_id_card + // if we are currently authenticated and logged in. + var/authenticated = FALSE // What factions we are able to modify var/list/factions = list(FACTION_MARINE) - var/printing - - var/is_weyland = FALSE - var/authenticated = FALSE - -/obj/structure/machinery/computer/card/wey_yu - is_weyland = TRUE - req_access = list(ACCESS_WY_DATABASE) - factions = list(FACTION_WY, FACTION_PMC) -/obj/structure/machinery/computer/card/proc/authenticate(mob/user, obj/item/card/id/id_card) +/obj/structure/machinery/computer/double_id/proc/authenticate(mob/user, obj/item/card/id/id_card) if(!id_card) visible_message("[SPAN_BOLD("[src]")] states, \"AUTH ERROR: Authority confirmation card is missing!\"") return FALSE @@ -50,13 +44,104 @@ visible_message("[SPAN_BOLD("[src]")] states, \"AUTH ERROR: You have not enough authority! Access denied.\"") return FALSE -/obj/structure/machinery/computer/card/tgui_interact(mob/user, datum/tgui/ui) +/obj/structure/machinery/computer/double_id/attackby(obj/card, mob/user) + if(!operable()) + to_chat(user, SPAN_NOTICE("You tried to inject [card] but [src] remains silent.")) + return + + if(istype(card, /obj/item/card/id)) + if(user_id_card && target_id_card) + to_chat(user, "Both slots are full already. Remove a card first.") + return + + var/obj/item/card/id/idcard = card + if(!user_id_card) + if(!authenticate(user, card)) + return + user_id_card = idcard + else + target_id_card = idcard + visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") + if(user.drop_held_item()) + idcard.forceMove(src) + update_static_data(user) + else + ..() + +/obj/structure/machinery/computer/double_id/verb/eject_id() + set category = "Object" + set name = "Eject ID Card" + set src in oview(1) + + if(!usr || usr.is_mob_incapacitated()) + return + + if(user_id_card) + user_id_card.loc = get_turf(src) + if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + usr.put_in_hands(user_id_card) + if(operable()) // Powered. Console can response. + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") + else + to_chat(usr, "You remove [user_id_card] from [src].") + authenticated = FALSE // No card - no access + user_id_card = null + + else if(target_id_card) + target_id_card.loc = get_turf(src) + if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + usr.put_in_hands(target_id_card) + if(operable()) // Powered. Make comp proceed ejection + GLOB.data_core.manifest_modify(target_id_card.registered_name, target_id_card.registered_ref, target_id_card.assignment, target_id_card.rank) + target_id_card.name = text("[target_id_card.registered_name]'s ID Card ([target_id_card.assignment])") + visible_message("[SPAN_BOLD("[src]")] states, \"CARD EJECT: Data imprinted. Updating database... Success.\"") + else + to_chat(usr, "You remove [target_id_card] from [src].") + target_id_card = null + + else + to_chat(usr, "There is nothing to remove from the console.") + return + +//made these procs part of the parent since it has the same functionality anyway +/obj/structure/machinery/computer/double_id/attack_hand(mob/user as mob) + if(..() || inoperable()) + return + user.set_interaction(src) + tgui_interact(user) + +/obj/structure/machinery/computer/double_id/attack_remote(mob/user as mob) + return attack_hand(user) + +/obj/structure/machinery/computer/double_id/bullet_act() + return FALSE +// ------------------------------------------------------------------------------------------------------------------------------- // + +// Identification Computer +// ------------------------------------------------------------------------------------------------------------------------------- // +/obj/structure/machinery/computer/double_id/card + name = "Identification Computer" + desc = "Terminal for programming USCM employee ID card access." + icon_state = "id" + req_access = list(ACCESS_MARINE_DATABASE) + circuit = /obj/item/circuitboard/computer/card + factions = list(FACTION_MARINE) + var/printing + var/is_centcom = FALSE + var/is_weyland = FALSE + +/obj/structure/machinery/computer/double_id/card/wey_yu + is_weyland = TRUE + req_access = list(ACCESS_WY_DATABASE) + factions = list(FACTION_WY, FACTION_PMC) + +/obj/structure/machinery/computer/double_id/card/tgui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if (!ui) ui = new(user, src, "CardMod", name) ui.open() -/obj/structure/machinery/computer/card/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) +/obj/structure/machinery/computer/double_id/card/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -68,10 +153,11 @@ if("PRG_authenticate") var/obj/item/I = user.get_active_hand() if (istype(I, /obj/item/card/id)) + if(!authenticate(user, I)) + return if(user.drop_held_item()) I.forceMove(src) user_id_card = I - if(authenticate(user, user_id_card)) return TRUE // Well actualy we have no button for auth card ejection, so just spit it back in user's face else @@ -300,7 +386,7 @@ log_idmod(target_id_card, " [user.real_name] changed the account number to '[account]'. ", key_name_admin(user)) return TRUE -/obj/structure/machinery/computer/card/ui_static_data(mob/user) +/obj/structure/machinery/computer/double_id/card/ui_static_data(mob/user) var/list/data = list() data["station_name"] = MAIN_SHIP_NAME data["weyland_access"] = is_weyland @@ -397,7 +483,7 @@ return data -/obj/structure/machinery/computer/card/ui_data(mob/user) +/obj/structure/machinery/computer/double_id/card/ui_data(mob/user) var/list/data = list() data["station_name"] = MAIN_SHIP_NAME @@ -413,86 +499,6 @@ return data -/obj/structure/machinery/computer/card/attackby(obj/O, mob/user) - if(istype(O, /obj/item/card/id)) - if(!operable()) - to_chat(user, SPAN_NOTICE("You tried to inject \the [O] but \the [src] remains silent.")) - return - var/obj/item/card/id/idcard = O - if(check_access(idcard)) - if(!user_id_card) - if(user.drop_held_item()) - O.forceMove(src) - user_id_card = O - authenticate(user, user_id_card) - else if(!target_id_card) - if(user.drop_held_item()) - O.forceMove(src) - target_id_card = O - update_static_data(user) - visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") - else - to_chat(user, "Both slots are full already. Remove a card first.") - else - if(!target_id_card) - if(user.drop_held_item()) - O.forceMove(src) - target_id_card = O - update_static_data(user) - visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") - else - to_chat(user, "Both slots are full already. Remove a card first.") - else - ..() - -/obj/structure/machinery/computer/card/attack_remote(mob/user as mob) - return attack_hand(user) - -/obj/structure/machinery/computer/card/bullet_act() - return 0 - -/obj/structure/machinery/computer/card/verb/eject_id() - set category = "Object" - set name = "Eject ID Card" - set src in oview(1) - - if(!usr || usr.is_mob_incapacitated()) return - - if(user_id_card) - user_id_card.loc = get_turf(src) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) - usr.put_in_hands(user_id_card) - if(operable()) // Powered. Console can response. - visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") - else - to_chat(usr, "You remove \the [user_id_card] from \the [src].") - authenticated = FALSE // No card - no access - user_id_card = null - - else if(target_id_card) - target_id_card.loc = get_turf(src) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) - usr.put_in_hands(target_id_card) - if(operable()) // Powered. Make comp proceed ejection - GLOB.data_core.manifest_modify(target_id_card.registered_name, target_id_card.registered_ref, target_id_card.assignment, target_id_card.rank) - target_id_card.name = text("[target_id_card.registered_name]'s ID Card ([target_id_card.assignment])") - visible_message("[SPAN_BOLD("[src]")] states, \"CARD EJECT: Data imprinted. Updating database... Success.\"") - else - to_chat(usr, "You remove \the [target_id_card] from \the [src].") - target_id_card = null - - else - to_chat(usr, "There is nothing to remove from the console.") - return - -/obj/structure/machinery/computer/card/attack_hand(mob/user as mob) - if(..()) - return - if(inoperable()) - return - user.set_interaction(src) - tgui_interact(user) - #undef CARDCON_DEPARTMENT_MISC #undef CARDCON_DEPARTMENT_MARINE #undef CARDCON_DEPARTMENT_SECURITY @@ -502,58 +508,47 @@ #undef CARDCON_DEPARTMENT_AUXCOM #undef CARDCON_DEPARTMENT_ENGINEERING #undef CARDCON_DEPARTMENT_COMMAND - #undef CARDCON_DEPARTMENT_CORP_LEAD #undef CARDCON_DEPARTMENT_CORP_SECURITY #undef CARDCON_DEPARTMENT_CORPORATE #undef CARDCON_DEPARTMENT_PMC #undef CARDCON_DEPARTMENT_INSPECTION #undef CARDCON_DEPARTMENT_SPECIALTY +// ------------------------------------------------------------------------------------------------------------------------------- // + //This console changes a marine's squad. It's very simple. //It also does not: change or increment the squad count (used in the login randomizer), nor does it check for jobs. //Which means you could get sillyiness like "Alpha Sulaco Chief Medical Officer" or "Delta Logistics Officer". //But in the long run it's not really a big deal. -/obj/structure/machinery/computer/squad_changer +// Squad Changer +// ------------------------------------------------------------------------------------------------------------------------------- // +/obj/structure/machinery/computer/double_id/squad_changer name = "Squad Distribution Computer" desc = "You can use this to change someone's squad." icon_state = "guest" req_access = list(ACCESS_MARINE_DATABASE) - var/obj/item/card/id/ID_to_modify = null var/mob/living/carbon/human/person_to_modify = null var/faction = FACTION_MARINE -/obj/structure/machinery/computer/squad_changer/verb/eject_id() - set category = "Object" - set name = "Eject ID Card" - set src in view(1) - - if(!usr || usr.is_mob_incapacitated()) return - - if(ishuman(usr) && ID_to_modify) - to_chat(usr, "You remove \the [ID_to_modify] from \the [src].") - ID_to_modify.forceMove(get_turf(src)) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) - usr.put_in_hands(ID_to_modify) - ID_to_modify = null - person_to_modify = null - else - to_chat(usr, "There is nothing to remove from \the [src].") - return +/obj/structure/machinery/computer/double_id/squad_changer/tgui_interact(mob/user, datum/tgui/ui) -/obj/structure/machinery/computer/squad_changer/tgui_interact(mob/user, datum/tgui/ui) + // only the registered user should be able to mess with the squad changer + if(user_id_card && target_id_card) + if(user.name != user_id_card.registered_name) + return ui = SStgui.try_update_ui(user, src, ui) if (!ui) ui = new(user, src, "SquadMod", name) ui.open() -/obj/structure/machinery/computer/squad_changer/ui_act(action, params) +/obj/structure/machinery/computer/double_id/squad_changer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return - var/mob/user = usr + var/mob/user = ui.user // Please stay close, marine if(person_to_modify && !(person_to_modify.Adjacent(src))) @@ -561,31 +556,69 @@ playsound(src, pick('sound/machines/computer_typing4.ogg', 'sound/machines/computer_typing5.ogg', 'sound/machines/computer_typing6.ogg'), 5, 1) switch(action) - if("PRG_eject") - if(ID_to_modify) + if("authenticate") + // we place the user id into the machine + var/obj/item/card = user.get_active_hand() + if (istype(card, /obj/item/card/id)) + if(!authenticate(user, card)) + return + if(user.drop_held_item()) + card.forceMove(src) + user_id_card = card + return TRUE + // we eject the user id from the machine + else + if(!user_id_card) + return if(ishuman(user)) - ID_to_modify.forceMove(user.loc) + user_id_card.forceMove(user.loc) if(!user.get_active_hand()) - user.put_in_hands(ID_to_modify) - ID_to_modify = null + user.put_in_hands(user_id_card) else - ID_to_modify.forceMove(loc) - ID_to_modify = null - visible_message("[SPAN_BOLD("[src]")] states, \"CARD EJECT: ID modification protocol disabled.\"") + user_id_card.forceMove(loc) + user_id_card = null + if("logout") + visible_message("[SPAN_BOLD("[src]")] states, \"AUTH LOGOUT: Session end confirmed.\"") + authenticated = FALSE + if(ishuman(user)) + user_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(user_id_card) + else + user_id_card.forceMove(loc) + user_id_card = null + return TRUE + if("eject") + // we eject the target id from the machine + if(target_id_card) + if(ishuman(user)) + target_id_card.forceMove(user.loc) + if(!user.get_active_hand()) + user.put_in_hands(target_id_card) + else + target_id_card.forceMove(loc) + + target_id_card = null + visible_message("[SPAN_BOLD("[src]")] states, \"CARD EJECT: Data imprinted. Updating database... Success.\"") + person_to_modify = null return TRUE + // we place the target id into the machine else - var/obj/item/I = user.get_active_hand() - if (istype(I, /obj/item/card/id)) - if(user.drop_held_item()) - I.forceMove(src) - ID_to_modify = I - visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") - return TRUE + var/obj/item/card = user.get_active_hand() + if (!istype(card, /obj/item/card/id)) + return + if(user.drop_held_item()) + card.forceMove(src) + target_id_card = card + visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") + update_static_data(user) + return TRUE + return FALSE if("PRG_squad") if( - istype(ID_to_modify) && istype(person_to_modify) && \ + istype(target_id_card) && istype(person_to_modify) && \ person_to_modify.skills.get_skill_level(SKILL_FIREARMS) && \ - person_to_modify.real_name == ID_to_modify.registered_name && \ + person_to_modify.real_name == target_id_card.registered_name && \ person_to_modify.Adjacent(src) ) var/datum/squad/selected = get_squad_by_name(params["name"]) @@ -594,12 +627,12 @@ if(GLOB.RoleAuthority.check_squad_capacity(person_to_modify, selected)) visible_message("[SPAN_BOLD("[src]")] states, \"CAPACITY ERROR: [selected] can't have another [person_to_modify.job].\"") return TRUE - if(transfer_marine_to_squad(person_to_modify, selected, person_to_modify.assigned_squad, ID_to_modify)) + if(transfer_marine_to_squad(person_to_modify, selected, person_to_modify.assigned_squad, target_id_card)) visible_message("[SPAN_BOLD("[src]")] states, \"DATABASE LOG: [person_to_modify] was assigned to [selected] Squad.\"") return TRUE else visible_message("[SPAN_BOLD("[src]")] states, \"DATABASE ERROR: There was an error assigning [person_to_modify] to [selected] Squad.\"") - else if(!istype(ID_to_modify)) + else if(!istype(target_id_card)) to_chat(usr, SPAN_WARNING("You need to insert a card to modify.")) else if(!istype(person_to_modify) || !person_to_modify.Adjacent(src)) visible_message("[SPAN_BOLD("[src]")] states, \"SCANNER ERROR: You need to keep the hand of the person to be assigned to Squad!\"") @@ -607,9 +640,10 @@ visible_message("[SPAN_BOLD("[src]")] states, \"QUALIFICATION ERROR: You cannot assign untrained civilians to squads!\"") else visible_message("[SPAN_BOLD("[src]")] states, \"ID ERROR: The ID in the machine is not owned by the person whose hand is scanned!\"") + person_to_modify = null // smooth brain edge case. return TRUE -/obj/structure/machinery/computer/squad_changer/ui_data(mob/user) +/obj/structure/machinery/computer/double_id/squad_changer/ui_data(mob/user) // Please stay close, marine if(person_to_modify && !(person_to_modify.Adjacent(src))) person_to_modify = null @@ -618,11 +652,12 @@ data["human"] = person_to_modify.name else data["human"] = null - data["id_name"] = ID_to_modify ? ID_to_modify.name : "-----" - data["has_id"] = !!ID_to_modify + data["id_name"] = target_id_card?.name + data["authenticated"] = authenticated + data["has_id"] = !!target_id_card return data -/obj/structure/machinery/computer/squad_changer/ui_static_data(mob/user) +/obj/structure/machinery/computer/double_id/squad_changer/ui_static_data(mob/user) var/list/data = list() var/list/squads = list() for(var/datum/squad/current_squad in GLOB.RoleAuthority.squads) @@ -635,71 +670,34 @@ data["squads"] = squads return data -/obj/structure/machinery/computer/squad_changer/attackby(obj/O as obj, mob/user as mob) - if(user) - add_fingerprint(user) - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(istype(O, /obj/item/card/id)) - if(!operable()) - to_chat(usr, SPAN_NOTICE("You tried to insert [O] but \the [src] remains silent.")) - return - var/obj/item/card/id/idcard = O - if(!ID_to_modify) - H.drop_held_item() - idcard.forceMove(src) - ID_to_modify = idcard - visible_message("[SPAN_BOLD("[src]")] states, \"CARD FOUND: Preparing ID modification protocol.\"") - else - to_chat(H, SPAN_NOTICE("Remove the inserted card first.")) - else if(istype(O, /obj/item/grab)) - var/obj/item/grab/G = O - if(ismob(G.grabbed_thing)) - if(!operable()) - to_chat(usr, SPAN_NOTICE("You place [G.grabbed_thing]'s hand on scanner but \the [src] remains silent.")) - return - var/isxenos = isxeno(G.grabbed_thing) - H.visible_message(SPAN_NOTICE("You hear a beep as [G.grabbed_thing]'s [isxenos ? "limb" : "hand"] is scanned to \the [name].")) - visible_message("[SPAN_BOLD("[src]")] states, \"SCAN ENTRY: [isxenos ? "Unknown lifeform detected! Forbidden operation!" : "Scanned, please stay close until operation's end."]\"") - playsound(H.loc, 'sound/machines/screen_output1.ogg', 25, 1) - // No Xeno Squads, please! - if(!isxenos) - person_to_modify = G.grabbed_thing - else - ..() - - -/obj/structure/machinery/computer/squad_changer/attack_remote(mob/user as mob) - return attack_hand(user) +/obj/structure/machinery/computer/double_id/squad_changer/attack_alien(mob/living/carbon/xenomorph/xeno_user) + xeno_user.visible_message(SPAN_NOTICE("You hear a beep as [xeno_user]'s limb is scanned to [name].")) + visible_message("[SPAN_BOLD("[src]")] states, \"SCAN ENTRY: Unknown lifeform detected! Forbidden operation!\"") + playsound(xeno_user.loc, 'sound/machines/screen_output1.ogg', 25, 1) + return XENO_ATTACK_ACTION -/obj/structure/machinery/computer/squad_changer/bullet_act() - return 0 - -/obj/structure/machinery/computer/squad_changer/attack_hand(mob/user as mob) +/obj/structure/machinery/computer/double_id/squad_changer/attack_hand(mob/user as mob) if(..()) return + if(user) add_fingerprint(user) - usr.set_interaction(src) - if(!operable()) + if(!user_id_card || !target_id_card || person_to_modify || user.name == user_id_card.registered_name) return - if(allowed(user)) - tgui_interact(user) - else - var/isxenos = isxeno(user) - user.visible_message(SPAN_NOTICE("You hear a beep as [user]'s [isxenos ? "limb" : "hand"] is scanned to \the [name].")) - visible_message("[SPAN_BOLD("[src]")] states, \"SCAN ENTRY: [isxenos ? "Unknown lifeform detected! Forbidden operation!" : "Scanned, please stay close until operation's end."]\"") - playsound(user.loc, 'sound/machines/screen_output1.ogg', 25, 1) - // No Xeno Squads, please! - if(!isxenos) - person_to_modify = user + + user.visible_message(SPAN_NOTICE("You hear a beep as [user]'s hand is scanned to [name].")) + visible_message("[SPAN_BOLD("[src]")] states, \"SCAN ENTRY: Scanned, please stay close until operation's end.\"") + playsound(user.loc, 'sound/machines/screen_output1.ogg', 25, 1) + person_to_modify = user /// How often the sensor data is updated #define SENSORS_UPDATE_PERIOD 10 SECONDS //How often the sensor data updates. /// The job sorting ID associated with otherwise unknown jobs #define UNKNOWN_JOB_ID 998 +// ------------------------------------------------------------------------------------------------------------------------------- // + /obj/structure/machinery/computer/crew name = "crew monitoring computer" desc = "Used to monitor active health sensors built into the wearer's uniform. You can see that the console highlights ship areas with BLUE and remote locations with RED." diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index 84a27622959a..8df319cb484d 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -227,10 +227,8 @@ fteam = " [marine_human.assigned_fireteam]" else //listed marine was deleted or gibbed, all we have is their name - for(var/datum/data/record/marine_record as anything in GLOB.data_core.general) - if(marine_record.fields["name"] == marine) - role = marine_record.fields["real_rank"] - break + var/datum/data/record/marine_record = retrieve_record(mob_name = marine, record_type = RECORD_TYPE_GENERAL) + role = marine_record[MOB_REAL_RANK] mob_state = "Dead" mob_name = marine @@ -658,25 +656,19 @@ return var/marine_ref = WEAKREF(wanted_marine) - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == marine_ref) - for(var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] == E.fields["id"]) - if(!findtext(R.fields["ma_crim"],"Insubordination.")) - R.fields["criminal"] = "*Arrest*" - if(R.fields["ma_crim"] == "None") - R.fields["ma_crim"] = "Insubordination." - else - R.fields["ma_crim"] += "Insubordination." + var/marked_insub = insert_record_stat(record_id_ref = wanted_marine.record_id_ref,mob_ref = marine_ref, record_type = RECORD_TYPE_SECURITY, stat_type = MOB_CRIMINAL_STATUS, new_stat = MOB_STAT_CRIME_ARREST) + if(!marked_insub) + visible_message("Unable to mark [wanted_marine] for insubordiantion at this time, please contact QM at your earliest availability") // records fucked + return - var/insub = "[icon2html(src, usr)] [SPAN_BOLDNOTICE("[wanted_marine] has been reported for insubordination. Logging to enlistment file.")]" - if(isRemoteControlling(usr)) - usr << insub - else - visible_message(insub) - to_chat(wanted_marine, "[icon2html(src, wanted_marine)] Overwatch: You've been reported for insubordination by your overwatch officer.") - wanted_marine.sec_hud_set_security_status() - return + var/insub = "[icon2html(src, usr)] [SPAN_BOLDNOTICE("[wanted_marine] has been reported for insubordination. Logging to enlistment file.")]" + if(isRemoteControlling(usr)) + to_chat(usr, insub) + else + visible_message(insub) + to_chat(wanted_marine, "[icon2html(src, wanted_marine)] Overwatch: You've been reported for insubordination by your overwatch officer.") + wanted_marine.sec_hud_set_security_status() + return /obj/structure/machinery/computer/overwatch/proc/transfer_squad() if(!usr) diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index b1a7fe48f9a9..d4998cb88c9a 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -32,7 +32,7 @@ . = ..() if(!auto_squad_name || (should_block_game_interaction(new_human) && !ert_squad)) return - if(!GLOB.data_core.manifest_modify(new_human.real_name, WEAKREF(new_human), assignment, rank)) + if(!GLOB.data_core.manifest_modify(new_human.real_name, WEAKREF(new_human), assignment, rank, new_human.record_id_ref)) GLOB.data_core.manifest_inject(new_human) var/obj/item/card/id/ID = new_human.get_idcard() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0ea2b3856da1..9983997d6900 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1179,7 +1179,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/mob/living/carbon/human/H = mind.original if(istype(H)) ref = WEAKREF(H) - GLOB.data_core.manifest_modify(name, ref, null, null, "*Deceased*") + GLOB.data_core.manifest_modify(name, ref, null, null, MOB_STAT_HEALTH_DECEASED) /mob/dead/observer/verb/view_kill_feed() diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index c97e4344cabf..67e9361a9583 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -12,7 +12,7 @@ - GLOB.data_core.manifest_modify(real_name, WEAKREF(src), null, null, "*Deceased*") + GLOB.data_core.manifest_modify(real_name, WEAKREF(src), null, null, MOB_STAT_HEALTH_DECEASED, record_id_ref = record_id_ref) if(is_a_synth) spawn_gibs() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index dcbab12c7291..284512868b40 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -455,11 +455,8 @@ if(perpref) var/criminal = "None" - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == perpref) - for (var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] == E.fields["id"]) - criminal = R.fields["criminal"] + var/datum/data/record/security_record = retrieve_record(mob_ref = perpref, record_type = RECORD_TYPE_SECURITY) + criminal = security_record.fields[MOB_CRIMINAL_STATUS] msg += "Criminal status:" if(!observer) @@ -468,10 +465,7 @@ msg += "\[[criminal]\]\n" msg += "Security records: \[View\]" - if(!observer) - msg += " \[Add comment\]\n" - else - msg += "\n" + msg += "\n" if(hasHUD(user,"medical")) var/cardcolor = holo_card_color if(!cardcolor) cardcolor = "none" @@ -480,15 +474,12 @@ // scan reports var/datum/data/record/N = null var/me_ref = WEAKREF(src) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if (R.fields["ref"] == me_ref) - N = R - break + N = retrieve_record(mob_ref = me_ref, record_type = RECORD_TYPE_MEDICAL) if(!isnull(N)) - if(!(N.fields["last_scan_time"])) + if(!(N.fields[MOB_LAST_SCAN_TIME])) msg += "No scan report on record\n" else - msg += "Scan from [N.fields["last_scan_time"]]\n" + msg += "Scan from [N.fields[MOB_LAST_SCAN_TIME]]\n" if(hasHUD(user,"squadleader")) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index eb19593bde46..23e5b6ab1905 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -506,24 +506,20 @@ perpref = I.registered_ref if(perpref) - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == perpref) - for(var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] == E.fields["id"]) - - var/setcriminal = tgui_input_list(usr, "Specify a new criminal status for this person.", "Security HUD", list("None", "*Arrest*", "Incarcerated", "Released", "Suspect", "NJP", "Cancel")) - - if(hasHUD(usr, "security")) - if(setcriminal != "Cancel") - R.fields["criminal"] = setcriminal - modified = 1 - sec_hud_set_security_status() + var/datum/data/record/security_record = retrieve_record(mob_ref = perpref, record_type = RECORD_TYPE_SECURITY) + var/setcriminal = tgui_input_list(usr, "Specify a new criminal status for this person.", "Security HUD", list(MOB_STAT_CRIME_NONE, MOB_STAT_CRIME_ARREST, MOB_STAT_CRIME_INCARCERATED, "Cancel")) + if(setcriminal == "Cancel") + return + if(hasHUD(usr, "security")) + security_record.fields[MOB_CRIMINAL_STATUS] = setcriminal + modified = TRUE + sec_hud_set_security_status() if(!modified) to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person.")) - if(href_list["secrecord"]) + if(href_list["secrecord"] && (hasHUD(usr,"security") || isobserver(usr))) if(hasHUD(usr,"security") || isobserver(usr)) var/perpref = null var/read = 0 @@ -532,115 +528,47 @@ var/obj/item/card/id/ID = wear_id.GetID() if(istype(ID)) perpref = ID.registered_ref - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == perpref) - for(var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] == E.fields["id"]) - if(hasHUD(usr,"security") || isobserver(usr)) - to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]") - to_chat(usr, "Incidents: [R.fields["incident"]]") - to_chat(usr, "\[View Comment Log\]") - read = 1 + var/datum/data/record/security_record = retrieve_record(mob_ref = perpref, record_type = RECORD_TYPE_SECURITY) + if(hasHUD(usr,"security") || isobserver(usr) && security_record) + to_chat(usr, "Name: [security_record.fields[MOB_NAME]] Criminal Status: [security_record.fields[MOB_CRIMINAL_STATUS]]") + for(var/i in 1 to length(security_record.fields[MOB_INCIDENTS])) + to_chat(usr, "Incidents: [security_record.fields[MOB_INCIDENTS][i]]") + read = TRUE if(!read) to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person.")) - if(href_list["secrecordComment"] && (hasHUD(usr,"security") || isobserver(usr))) - var/perpref = null - if(wear_id) - var/obj/item/card/id/ID = wear_id.GetID() - if(istype(ID)) - perpref = ID.registered_ref - - var/read = 0 - - if(perpref) - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] != perpref) - continue - for(var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] != E.fields["id"]) - continue - read = 1 - if(!islist(R.fields["comments"])) - to_chat(usr, "
No comments") - continue - var/comment_markup = "" - for(var/com_i in R.fields["comments"]) - var/comment = R.fields["comments"][com_i] - comment_markup += text("
[] / [] ([])
", comment["created_at"], comment["created_by"]["name"], comment["created_by"]["rank"]) - if (isnull(comment["deleted_by"])) - comment_markup += text("[]
", comment["entry"]) - continue - comment_markup += text("Comment deleted by [] at []
", comment["deleted_by"], comment["deleted_at"]) - to_chat(usr, comment_markup) - if(!isobserver(usr)) - to_chat(usr, "\[Add comment\]
") - - if(!read) - to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person.")) - - if(href_list["secrecordadd"] && hasHUD(usr,"security")) + if(href_list["medical"]) + if(!hasHUD(usr,"medical")) + return var/perpref = null if(wear_id) var/obj/item/card/id/ID = wear_id.GetID() if(istype(ID)) perpref = ID.registered_ref - if(perpref) - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] != perpref) - continue - for(var/datum/data/record/R in GLOB.data_core.security) - if(R.fields["id"] != E.fields["id"]) - continue - var/t1 = copytext(trim(strip_html(input("Your name and time will be added to this new comment.", "Add a comment", null, null) as message)), 1, MAX_MESSAGE_LEN) - if(!(t1) || usr.stat || usr.is_mob_restrained()) - return - var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) - var/new_comment = list("entry" = t1, "created_by" = list("name" = "", "rank" = ""), "deleted_by" = null, "deleted_at" = null, "created_at" = created_at) - if(istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/U = usr - new_comment["created_by"]["name"] = U.get_authentification_name() - new_comment["created_by"]["rank"] = U.get_assignment() - if(!islist(R.fields["comments"])) - R.fields["comments"] = list("1" = new_comment) - else - var/new_com_i = length(R.fields["comments"]) + 1 - R.fields["comments"]["[new_com_i]"] = new_comment - to_chat(usr, "You have added a new comment to the Security Record of [R.fields["name"]]. \[View Comment Log\]") + var/modified = FALSE - if(href_list["medical"]) - if(hasHUD(usr,"medical")) - var/perpref = null - if(wear_id) - var/obj/item/card/id/ID = wear_id.GetID() - if(istype(ID)) - perpref = ID.registered_ref - - var/modified = FALSE - - if(perpref) - for(var/datum/data/record/E in GLOB.data_core.general) - if(E.fields["ref"] == perpref) - for(var/datum/data/record/R in GLOB.data_core.general) - if(R.fields["id"] == E.fields["id"]) + if(!perpref) + return - var/setmedical = tgui_input_list(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"], list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")) + var/datum/data/record/health_record = retrieve_record(mob_ref = perpref, record_type = RECORD_TYPE_GENERAL) + var/setmedical = tgui_input_list(usr, "Specify a new medical status for this person.", "Medical HUD", health_record.fields[MOB_HEALTH_STATUS], list(MOB_STAT_HEALTH_DECEASED, MOB_STAT_HEALTH_UNFIT, MOB_STAT_HEALTH_ACTIVE, "Cancel")) - if(hasHUD(usr,"medical")) - if(setmedical != "Cancel") - R.fields["p_stat"] = setmedical - modified = 1 + if(!hasHUD(usr,"medical") || setmedical == "Cancel") + return - spawn() - if(istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/U = usr - U.handle_regular_hud_updates() + health_record.fields[MOB_HEALTH_STATUS] = setmedical + modified = TRUE + spawn() + if(istype(usr,/mob/living/carbon/human)) + var/mob/living/carbon/human/user = usr + user.handle_regular_hud_updates() - if(!modified) - to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person.")) + if(!modified) + to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person.")) +/* TODO: refactor in the future as part of the new medical record system if(href_list["medrecord"]) if(hasHUD(usr,"medical")) var/perpref = null @@ -720,6 +648,7 @@ if(istype(usr,/mob/living/carbon/human)) var/mob/living/carbon/human/U = usr R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]
[t1]") + */ if(href_list["medholocard"]) change_holo_card(usr) @@ -766,11 +695,10 @@ return var/me_ref = WEAKREF(src) - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if(R.fields["ref"] == me_ref) - if(R.fields["last_scan_time"] && R.fields["last_scan_result"]) - tgui_interact(usr) - break + + var/datum/data/record/medical_record = retrieve_record(mob_ref = me_ref, record_type = RECORD_TYPE_MEDICAL) + if(medical_record.fields[MOB_LAST_SCAN_TIME] && medical_record.fields[MOB_LAST_SCAN_RESULT]) + tgui_interact(usr) ..() return diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index ec8083da0d46..82645edb3d92 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -171,6 +171,9 @@ /// Stored image references associated with focus-fire. var/image/focused_fire_marker + // in the case of player controlled mobs it's the ckey, otherwise the original implementation of a large ass number. + var/record_id_ref = null + /client/var/cached_human_playtime /client/proc/get_total_human_playtime(skip_cache = FALSE) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1a43138421e4..5d87a2aad8a8 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -7,7 +7,7 @@ return if(undefibbable && stat == DEAD || spawned_corpse) - GLOB.data_core.manifest_modify(real_name, WEAKREF(src), null, null, "*Deceased*") + GLOB.data_core.manifest_modify(real_name, WEAKREF(src), null, null, MOB_STAT_HEALTH_DECEASED, record_id_ref = record_id_ref) SShuman.processable_human_list -= src if(hardcore) qdel(src) //We just delete the corpse on WO to keep things simple and lag-free diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 119c846a93a2..29304cf65b5e 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -103,26 +103,28 @@ /obj/structure/filingcabinet/security/proc/populate() - if(virgin) - for(var/datum/data/record/G in GLOB.data_core.general) - var/datum/data/record/S - for(var/datum/data/record/R in GLOB.data_core.security) - if((R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"])) - S = R - break - if(S) - var/obj/item/paper/P = new /obj/item/paper(src) - P.info = "
Security Record

" - P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]
\nSex: [G.fields["sex"]]
\nAge: [G.fields["age"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" - P.info += "
\n
Security Data

\nCriminal Status: [S.fields["criminal"]]
\n
\nIncidents: [S.fields["incident"]]
\n
\n
Comments/Log

" - var/counter = 1 - while(S.fields["com_[counter]"]) - P.info += "[S.fields["com_[counter]"]]
" - counter++ - P.info += "" - P.name = "Security Record ([G.fields["name"]])" - virgin = 0 //tabbing here is correct- it's possible for people to try and use it - //before the records have been generated, so we do this inside the loop. + if(!virgin) + return + for(var/record_name in GLOB.data_core.general) + var/datum/data/record/G = GLOB.data_core.general[record_name] // yeah I know single letter vars, but like plz. + var/datum/data/record/S + for(var/record_id in GLOB.data_core.security) + var/datum/data/record/R = GLOB.data_core.security[record_id] + if((R.fields["name"] == G.fields["name"])) + S = R + break + if(S) + var/obj/item/paper/P = new /obj/item/paper(src) + P.info = "
Security Record

" + P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]
\nSex: [G.fields["sex"]]
\nAge: [G.fields["age"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" + P.info += "
\n
Security Data

\nCriminal Status: [S.fields["criminal"]]
\n
\nIncidents: [S.fields["incident"]]
\n
\n
Comments/Log

" + var/counter = 1 + while(S.fields["com_[counter]"]) + P.info += "[S.fields["com_[counter]"]]
" + counter++ + P.info += "" + P.name = "Security Record ([G.fields["name"]])" + virgin = 0 //tabbing here is correct- it's possible for people to try and use it before the records have been generated, so we do this inside the loop. /obj/structure/filingcabinet/security/attack_hand() populate() @@ -135,27 +137,28 @@ var/virgin = 1 /obj/structure/filingcabinet/medical/proc/populate() - if(virgin) - for(var/datum/data/record/G in GLOB.data_core.general) - var/datum/data/record/M - for(var/datum/data/record/R as anything in GLOB.data_core.medical) - if((R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"])) - M = R - break - if(M) - var/obj/item/paper/P = new /obj/item/paper(src) - P.info = "
Medical Record

" - P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]
\nSex: [G.fields["sex"]]
\nAge: [G.fields["age"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" - - P.info += "
\n
Medical Data

\nBlood Type: [M.fields["b_type"]]
\n
\nMinor Disabilities: [M.fields["mi_dis"]]
\nDetails: [M.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [M.fields["ma_dis"]]
\nDetails: [M.fields["ma_dis_d"]]
\n
\nAllergies: [M.fields["alg"]]
\nDetails: [M.fields["alg_d"]]
\n
\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [M.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[M.fields["notes"]]
\n
\n
Comments/Log

" - var/counter = 1 - while(M.fields["com_[counter]"]) - P.info += "[M.fields["com_[counter]"]]
" - counter++ - P.info += "" - P.name = "Medical Record ([G.fields["name"]])" - virgin = 0 //tabbing here is correct- it's possible for people to try and use it - //before the records have been generated, so we do this inside the loop. + if(!virgin) + return + for(var/record in GLOB.data_core.general) + var/datum/data/record/G = GLOB.data_core.general[record] + var/datum/data/record/M + for(var/record_name in GLOB.data_core.medical) + var/datum/data/record/R = GLOB.data_core.medical[record_name] + if((R.fields[MOB_NAME] == G.fields[MOB_NAME])) + M = R + break + if(M) + var/obj/item/paper/P = new /obj/item/paper(src) + P.info = "
Medical Record

" + P.info += "Name: [G.fields[MOB_NAME]] ID: [G.fields["id"]]
\nSex: [G.fields["sex"]]
\nAge: [G.fields["age"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" + P.info += "
\n
Medical Data

\nBlood Type: [M.fields["b_type"]]
\n
\nMinor Disabilities: [M.fields["mi_dis"]]
\nDetails: [M.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [M.fields["ma_dis"]]
\nDetails: [M.fields["ma_dis_d"]]
\n
\nAllergies: [M.fields["alg"]]
\nDetails: [M.fields["alg_d"]]
\n
\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [M.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[M.fields["notes"]]
\n
\n
Comments/Log

" + var/counter = 1 + while(M.fields["com_[counter]"]) + P.info += "[M.fields["com_[counter]"]]
" + counter++ + P.info += "" + P.name = "Medical Record ([G.fields["name"]])" + virgin = 0 //tabbing here is correct- it's possible for people to try and use it before the records have been generated, so we do this inside the loop. /obj/structure/filingcabinet/medical/attack_hand() populate() diff --git a/colonialmarines.dme b/colonialmarines.dme index 9bce54ec30d8..f4b4c99e52a9 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -932,7 +932,6 @@ #include "code\game\machinery\computer\robots_props.dm" #include "code\game\machinery\computer\security.dm" #include "code\game\machinery\computer\sentencing.dm" -#include "code\game\machinery\computer\skills.dm" #include "code\game\machinery\computer\station_alert.dm" #include "code\game\machinery\door_display\door_display.dm" #include "code\game\machinery\doors\airlock.dm" diff --git a/maps/map_files/BigRed/BigRed.dmm b/maps/map_files/BigRed/BigRed.dmm index 82871ec53f85..2d9a38bcec9e 100644 --- a/maps/map_files/BigRed/BigRed.dmm +++ b/maps/map_files/BigRed/BigRed.dmm @@ -16768,7 +16768,7 @@ /turf/open/floor, /area/bigredv2/outside/office_complex) "aXu" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor{ icon_state = "white" }, @@ -17841,7 +17841,7 @@ /area/bigredv2/outside/admin_building) "bbm" = ( /obj/structure/surface/table, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /turf/open/floor{ @@ -38915,7 +38915,7 @@ }, /area/bigredv2/caves_north) "tLO" = ( -/obj/structure/machinery/computer/med_data{ +/obj/structure/machinery/computer/double_id/med_data{ density = 0; pixel_y = 16 }, diff --git a/maps/map_files/BigRed/sprinkles/40.viro_open.dmm b/maps/map_files/BigRed/sprinkles/40.viro_open.dmm index f58cfc3b7977..9a4d04da1563 100644 --- a/maps/map_files/BigRed/sprinkles/40.viro_open.dmm +++ b/maps/map_files/BigRed/sprinkles/40.viro_open.dmm @@ -473,7 +473,7 @@ /area/bigredv2/outside/virology) "bF" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 8 }, /turf/open/floor{ diff --git a/maps/map_files/BigRed/standalone/medbay-v3.dmm b/maps/map_files/BigRed/standalone/medbay-v3.dmm index 80397d168ba7..f179757905da 100644 --- a/maps/map_files/BigRed/standalone/medbay-v3.dmm +++ b/maps/map_files/BigRed/standalone/medbay-v3.dmm @@ -181,7 +181,7 @@ }, /area/bigredv2/outside/medical) "aF" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor{ icon_state = "whitegreenfull" }, diff --git a/maps/map_files/CORSAT/Corsat.dmm b/maps/map_files/CORSAT/Corsat.dmm index 01777db10275..0870765a1fc5 100644 --- a/maps/map_files/CORSAT/Corsat.dmm +++ b/maps/map_files/CORSAT/Corsat.dmm @@ -2996,7 +2996,7 @@ /area/corsat/omega/offices) "aiR" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/card, +/obj/structure/machinery/computer/double_id/card, /obj/structure/machinery/computer/guestpass, /turf/open/floor/corsat{ dir = 5; @@ -3781,9 +3781,6 @@ dir = 8 }, /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/skills{ - dir = 4 - }, /turf/open/floor/corsat{ dir = 8; icon_state = "bluegrey" @@ -5709,7 +5706,7 @@ /area/corsat/gamma/medbay/morgue) "aqS" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/corsat{ dir = 1; icon_state = "greenwhite" @@ -16441,7 +16438,7 @@ /obj/structure/machinery/light{ dir = 8 }, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /obj/structure/surface/table/woodentable/fancy, @@ -16525,9 +16522,6 @@ }, /area/corsat/gamma/biodome/complex) "aTV" = ( -/obj/structure/machinery/computer/skills{ - dir = 4 - }, /obj/structure/surface/table/woodentable/fancy, /turf/open/floor/corsat{ dir = 1; @@ -27978,7 +27972,7 @@ /area/corsat/omega/complex) "bAK" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/corsat{ @@ -28101,7 +28095,7 @@ /area/corsat/gamma/medbay) "bBd" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/corsat{ dir = 4; icon_state = "greenwhite" @@ -29019,7 +29013,6 @@ /area/corsat/sigma/airlock/control) "bDO" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/skills, /turf/open/floor/corsat{ dir = 9; icon_state = "bluegrey" @@ -29334,7 +29327,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /turf/open/floor/corsat{ @@ -38736,7 +38729,7 @@ /area/corsat/omega/hangar/office) "eoZ" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 8 }, /turf/open/floor/corsat{ @@ -45648,9 +45641,6 @@ /area/corsat/theta/airlock/control) "jok" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/skills{ - dir = 8 - }, /turf/open/floor/corsat{ dir = 6; icon_state = "purplewhite" @@ -54317,7 +54307,7 @@ /area/corsat/gamma/residential) "pVL" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /turf/open/floor/corsat{ @@ -55521,7 +55511,7 @@ /area/corsat/sigma/airlock/south) "qLI" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 1 }, /turf/open/floor/corsat{ @@ -65079,7 +65069,7 @@ /obj/structure/pipes/standard/simple/hidden/green{ dir = 4 }, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /turf/open/floor/corsat{ diff --git a/maps/map_files/DesertDam/Desert_Dam.dmm b/maps/map_files/DesertDam/Desert_Dam.dmm index 0c33d3d251f8..cc94d1536022 100644 --- a/maps/map_files/DesertDam/Desert_Dam.dmm +++ b/maps/map_files/DesertDam/Desert_Dam.dmm @@ -26737,7 +26737,7 @@ }, /area/desert_dam/building/security/southern_hallway) "bGP" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /obj/structure/machinery/light{ dir = 1 }, @@ -39194,7 +39194,7 @@ /turf/open/floor/wood, /area/desert_dam/building/medical/CMO) "cvl" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/wood, /area/desert_dam/building/medical/CMO) "cvm" = ( @@ -39381,7 +39381,7 @@ }, /area/desert_dam/building/medical/lobby) "cvP" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /obj/structure/window/reinforced{ dir = 1 }, @@ -40946,7 +40946,7 @@ }, /area/desert_dam/building/medical/office2) "cAD" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/prison{ dir = 1; icon_state = "whitered" @@ -40989,7 +40989,7 @@ }, /area/desert_dam/building/medical/emergency_room) "cAI" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/prison{ dir = 1; icon_state = "whitered" @@ -43715,7 +43715,7 @@ }, /area/desert_dam/building/medical/virology_wing) "cIO" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/prison{ dir = 1; icon_state = "whitegreen" @@ -43958,7 +43958,7 @@ /area/desert_dam/building/medical/treatment_room) "cJC" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/prison{ @@ -43980,7 +43980,7 @@ }, /area/desert_dam/building/medical/treatment_room) "cJF" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/prison{ dir = 10; icon_state = "whitegreenfull" @@ -51496,7 +51496,7 @@ /turf/open/desert/dirt, /area/desert_dam/exterior/valley/bar_valley_dam) "dun" = ( -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /obj/structure/surface/table/woodentable/fancy, /turf/open/floor{ dir = 8; @@ -51625,7 +51625,7 @@ }, /area/desert_dam/interior/caves/temple) "duU" = ( -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /obj/structure/surface/table/woodentable/fancy, /turf/open/floor/wood, /area/desert_dam/building/administration/office) @@ -51652,7 +51652,7 @@ }, /area/desert_dam/building/administration/overseer_office) "duZ" = ( -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /obj/structure/surface/table/woodentable/fancy, /turf/open/floor{ dir = 8; diff --git a/maps/map_files/FOP_v2_Cellblocks/Prison_Station_FOP.dmm b/maps/map_files/FOP_v2_Cellblocks/Prison_Station_FOP.dmm index d1dd76922ee1..435f0efc39e4 100644 --- a/maps/map_files/FOP_v2_Cellblocks/Prison_Station_FOP.dmm +++ b/maps/map_files/FOP_v2_Cellblocks/Prison_Station_FOP.dmm @@ -606,7 +606,7 @@ /area/space) "abs" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/prison{ @@ -747,7 +747,7 @@ /area/prison/research/secret/bioengineering) "abL" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/prison{ icon_state = "whitepurplefull" }, @@ -5206,7 +5206,7 @@ /area/prison/research/RD) "anT" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/carpet, @@ -8593,7 +8593,7 @@ /area/prison/medbay) "axl" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/prison{ @@ -11502,7 +11502,7 @@ /area/prison/medbay) "aFO" = ( /obj/structure/surface/table/reinforced, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/prison{ dir = 10; icon_state = "whitegreenfull" @@ -15130,7 +15130,7 @@ /area/prison/command/secretary_office) "aQH" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/carpet, /area/prison/command/secretary_office) "aQI" = ( @@ -34990,7 +34990,7 @@ /area/prison/cellblock/highsec/south/south) "bYA" = ( /obj/structure/surface/table/woodentable, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/prison, /area/prison/security/head) "bYB" = ( diff --git a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm index fcbdcc4fdc33..2cffb715245e 100644 --- a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm +++ b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm @@ -3885,9 +3885,6 @@ /area/fiorina/tumor/servers) "ctC" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/skills{ - dir = 4 - }, /turf/open/floor/prison{ dir = 10; icon_state = "whitegreenfull" @@ -4340,7 +4337,7 @@ health = 80 }, /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4 }, /turf/open/floor/prison{ @@ -23963,7 +23960,7 @@ /area/fiorina/tumor/servers) "ouH" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 1 }, /turf/open/floor/plating/plating_catwalk, @@ -26175,7 +26172,7 @@ /area/fiorina/tumor/ice_lab) "pSU" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/wood, /area/fiorina/station/security/wardens) "pTj" = ( @@ -34552,7 +34549,6 @@ /area/fiorina/tumor/fiberbush) "uXw" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/skills, /turf/open/floor/plating/prison, /area/fiorina/station/transit_hub) "uXB" = ( @@ -38356,9 +38352,6 @@ /area/fiorina/tumor/servers) "xro" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/skills{ - dir = 4 - }, /turf/open/floor/prison{ icon_state = "bluefull" }, diff --git a/maps/map_files/FOP_v3_Sciannex/sprinkles/10.scavshipholder.dmm b/maps/map_files/FOP_v3_Sciannex/sprinkles/10.scavshipholder.dmm index b2a660473a19..3627a6f43574 100644 --- a/maps/map_files/FOP_v3_Sciannex/sprinkles/10.scavshipholder.dmm +++ b/maps/map_files/FOP_v3_Sciannex/sprinkles/10.scavshipholder.dmm @@ -236,7 +236,7 @@ /area/template_noop) "pw" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 1 }, /turf/open/floor/plating/plating_catwalk, diff --git a/maps/map_files/Kutjevo/Kutjevo.dmm b/maps/map_files/Kutjevo/Kutjevo.dmm index b1beb0dfc2b1..fcebcd699b96 100644 --- a/maps/map_files/Kutjevo/Kutjevo.dmm +++ b/maps/map_files/Kutjevo/Kutjevo.dmm @@ -10003,7 +10003,7 @@ /turf/open/floor/kutjevo/colors/cyan, /area/kutjevo/interior/complex/med) "nCt" = ( -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 4 }, /obj/structure/surface/table/reinforced/prison, @@ -10308,7 +10308,7 @@ /turf/open/auto_turf/sand/layer0, /area/kutjevo/exterior/Northwest_Colony) "nRk" = ( -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 4 }, /obj/structure/surface/table/reinforced/prison, diff --git a/maps/map_files/LV624/LV624.dmm b/maps/map_files/LV624/LV624.dmm index a9baa8a1efc7..cef6ec156aaf 100644 --- a/maps/map_files/LV624/LV624.dmm +++ b/maps/map_files/LV624/LV624.dmm @@ -11849,7 +11849,7 @@ /area/lv624/lazarus/hop) "aYM" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /obj/structure/machinery/light/small{ dir = 8 }, diff --git a/maps/map_files/New_Varadero/New_Varadero.dmm b/maps/map_files/New_Varadero/New_Varadero.dmm index 5c85b09864e1..aa72961e43fc 100644 --- a/maps/map_files/New_Varadero/New_Varadero.dmm +++ b/maps/map_files/New_Varadero/New_Varadero.dmm @@ -8151,11 +8151,6 @@ "fla" = ( /obj/structure/machinery/faxmachine, /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/skills{ - dir = 4; - layer = 3.1; - pixel_y = 18 - }, /turf/open/floor/wood, /area/varadero/interior/research) "fmu" = ( @@ -15597,7 +15592,7 @@ /area/varadero/interior/caves/east) "kfJ" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_y = 3 }, /turf/open/floor/shiva{ @@ -24585,7 +24580,7 @@ }, /area/varadero/interior/maintenance/security) "pOz" = ( -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 8 }, /obj/structure/surface/table/reinforced/prison, diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index aaeb160aeef1..5c9f67e67dab 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -5907,7 +5907,7 @@ /area/almayer/medical/morgue) "aEO" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 8 }, /obj/structure/machinery/light{ @@ -10756,7 +10756,7 @@ }, /area/almayer/living/cryo_cells) "bho" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /turf/open/floor/almayer{ icon_state = "sterile_green_side" }, @@ -11315,7 +11315,7 @@ /area/almayer/engineering/upper_engineering/starboard) "blZ" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop, +/obj/structure/machinery/computer/double_id/med_data/laptop, /turf/open/floor/almayer{ icon_state = "sterile_green_corner" }, @@ -12860,7 +12860,7 @@ /area/almayer/hallways/lower/starboard_midship_hallway) "bwR" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 1; pixel_y = -4 }, @@ -26781,10 +26781,10 @@ /area/almayer/squads/req) "eYu" = ( /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/squad_changer{ +/obj/structure/machinery/computer/double_id/squad_changer{ pixel_x = -9 }, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ pixel_x = 9 }, /turf/open/floor/almayer{ @@ -30074,7 +30074,7 @@ "gkK" = ( /obj/structure/pipes/standard/simple/hidden/supply, /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 8 }, /turf/open/floor/almayer{ @@ -32038,14 +32038,10 @@ /area/almayer/hallways/lower/port_umbilical) "gTH" = ( /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/skills{ - dir = 4; - pixel_y = 18 - }, /obj/structure/machinery/computer/secure_data{ dir = 4 }, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 4; pixel_y = -18 }, @@ -37475,7 +37471,7 @@ /area/almayer/living/port_emb) "iQB" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 4; layer = 3.2; pixel_y = 4 @@ -54020,7 +54016,7 @@ "oug" = ( /obj/structure/surface/table/reinforced/almayer_B, /obj/structure/pipes/standard/simple/hidden/supply, -/obj/structure/machinery/computer/squad_changer{ +/obj/structure/machinery/computer/double_id/squad_changer{ dir = 8; layer = 2.99; pixel_y = 8 @@ -56386,7 +56382,7 @@ /area/almayer/command/combat_correspondent) "phw" = ( /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 8 }, /turf/open/floor/almayer{ @@ -59386,7 +59382,7 @@ pixel_y = 9; req_access_txt = "28" }, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 1; pixel_x = 6; pixel_y = -4 @@ -63643,9 +63639,6 @@ }, /area/almayer/maint/upper/mess) "rGU" = ( -/obj/structure/machinery/computer/skills{ - req_one_access_txt = "200" - }, /obj/structure/surface/table/woodentable/fancy, /turf/open/floor/carpet, /area/almayer/command/corporateliaison) @@ -65410,7 +65403,7 @@ /area/almayer/living/grunt_rnr) "smw" = ( /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 8 }, /obj/item/device/flashlight/lamp{ @@ -80355,7 +80348,7 @@ /area/almayer/living/grunt_rnr) "xjt" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 4; pixel_x = 2 }, @@ -81999,7 +81992,7 @@ }, /area/almayer/hallways/upper/starboard) "xMA" = ( -/obj/structure/machinery/computer/med_data, +/obj/structure/machinery/computer/double_id/med_data, /obj/structure/sign/safety/terminal{ pixel_x = 8; pixel_y = -32 diff --git a/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm b/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm index 46200d9f79e4..691837302fba 100644 --- a/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm +++ b/maps/map_files/Whiskey_Outpost_v2/Whiskey_Outpost_v2.dmm @@ -758,7 +758,7 @@ /area/whiskey_outpost/inside/cic) "cJ" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 8 }, /turf/open/floor/prison{ @@ -1731,7 +1731,7 @@ /area/whiskey_outpost/outside/south/very_far) "gA" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 1 }, /turf/open/floor/prison{ @@ -1749,7 +1749,7 @@ /area/whiskey_outpost/inside/cic) "gE" = ( /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/computer/squad_changer{ +/obj/structure/machinery/computer/double_id/squad_changer{ dir = 1; layer = 2.99 }, @@ -10709,7 +10709,7 @@ /area/whiskey_outpost/inside/supply) "On" = ( /obj/structure/surface/table/reinforced/prison, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ pixel_x = -6; pixel_y = 3 }, diff --git a/maps/shuttles/ert_shuttle_big.dmm b/maps/shuttles/ert_shuttle_big.dmm index a07c57e00a20..048982a8f7df 100644 --- a/maps/shuttles/ert_shuttle_big.dmm +++ b/maps/shuttles/ert_shuttle_big.dmm @@ -328,7 +328,7 @@ /area/shuttle/ert) "tf" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/card, +/obj/structure/machinery/computer/double_id/card, /turf/open/floor/almayer{ icon_state = "plate" }, @@ -653,7 +653,7 @@ /area/shuttle/ert) "Mx" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/computer/med_data/laptop{ +/obj/structure/machinery/computer/double_id/med_data/laptop{ dir = 8 }, /turf/open/floor/almayer{ diff --git a/maps/templates/Chinook.dmm b/maps/templates/Chinook.dmm index bc16f23270fa..04da33b251df 100644 --- a/maps/templates/Chinook.dmm +++ b/maps/templates/Chinook.dmm @@ -376,7 +376,7 @@ }, /area/adminlevel/chinook/sec) "bc" = ( -/obj/structure/machinery/computer/card, +/obj/structure/machinery/computer/double_id/card, /obj/structure/surface/table/reinforced/black, /turf/open/floor/carpet{ desc = "Plush, waterproof carpet. Apparently it's fire resistant while remaining quite soft."; @@ -1950,7 +1950,7 @@ /area/adminlevel/chinook/engineering) "fK" = ( /obj/structure/surface/table/reinforced/black, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 4 }, /turf/open/floor/carpet{ @@ -8247,7 +8247,7 @@ }, /area/adminlevel/chinook/sec) "Ah" = ( -/obj/structure/machinery/computer/card, +/obj/structure/machinery/computer/double_id/card, /obj/structure/surface/table/reinforced/black, /turf/open/floor/carpet{ desc = "Plush, waterproof carpet. Apparently it's fire resistant while remaining quite soft."; @@ -11790,7 +11790,7 @@ /turf/open/floor/kutjevo/multi_tiles, /area/adminlevel/chinook/event) "Me" = ( -/obj/structure/machinery/computer/card, +/obj/structure/machinery/computer/double_id/card, /obj/structure/machinery/light{ dir = 1 }, @@ -15238,7 +15238,7 @@ }, /area/adminlevel/chinook) "Xh" = ( -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 1 }, /obj/structure/machinery/light, @@ -15933,7 +15933,7 @@ "Zj" = ( /obj/structure/machinery/light, /obj/structure/surface/table/reinforced/almayer_B, -/obj/structure/machinery/computer/card{ +/obj/structure/machinery/computer/double_id/card{ dir = 1 }, /turf/open/floor/almayer{ diff --git a/tgui/packages/tgui/interfaces/MedRec.tsx b/tgui/packages/tgui/interfaces/MedRec.tsx new file mode 100644 index 000000000000..d2443577d8c8 --- /dev/null +++ b/tgui/packages/tgui/interfaces/MedRec.tsx @@ -0,0 +1,291 @@ +import { Fragment, useState } from 'react'; + +import { useBackend } from '../backend'; +import { + Box, + Button, + Dropdown, + Flex, + Icon, + Input, + Section, + Stack, + Tabs, +} from '../components'; +import { Window } from '../layouts'; +import { CompCommon, GeneralRecord, GenericStat } from './Records/types'; + +// Medical Record Type +interface MedicalRec extends CompCommon { + medical_record: GenericStat[]; + general_record: GeneralRecord[]; + health: GenericStat; + autopsy: GenericStat; + existingReport: GenericStat; + death: GenericStat; +} + +export const MedRec = (props) => { + const [selectedTab, setSelectedTab] = useState(1); + return ( + + + + + setSelectedTab(1)} + > + Health Status + + setSelectedTab(2)} + > + Medical Record + + + {selectedTab === 1 && } + {selectedTab === 2 && } + + + + ); +}; + +const MedicalRecord = (props) => { + const { act, data } = useBackend(); + const [selectedTab, setSelectedTab] = useState(1); + const { authenticated, has_id } = data; + return ( + <> +
act('print')} /> + } + /> + {!!has_id && !!authenticated && ( + + + setSelectedTab(1)} + > + Medical Notes + + setSelectedTab(2)} + > + Autopsy Report + + + {selectedTab === 1 && } + {selectedTab === 2 && } + + )} + + ); +}; + +const MedicalNotes = (props) => { + const { act, data } = useBackend(); + const { medical_record } = data; + + return ( +
+ {medical_record.map((record, index) => ( + + + {record.message} + + + act('updateStatRecord', { + record_type: record.record_type, + stat: record.stat, + new_value: value, + }) + } + /> + + + + ))} +
+ ); +}; + +const AutopsyReport = (props) => { + const { act, data } = useBackend(); + const { health, autopsy, existingReport, death, id_name } = data; + return ( +
+ + {health.value === 'Deceased' && !existingReport && ( + + + {autopsy.message} + + + act('updateStatRecord', { + record_type: autopsy.record_type, + stat: autopsy.stat, + new_value: value, + }) + } + /> + + + + + + {death.message} + + + act('updateStatRecord', { + record_type: death.record_type, + stat: death.stat, + new_value: value, + }) + } + displayText={death.value ? death.value : 'NONE'} + /> + + + + +
+ ); +}; + +const HealthStatus = (props) => { + const { act, data } = useBackend(); + const { general_record, health, authenticated, has_id, id_name } = data; + + return ( + <> +
{ + act(authenticated ? 'logout' : 'authenticate'); + }} + /> + } + > +
+ {!!has_id && !!authenticated && ( +
+ + + + + act('updateStatRecord', { + record_type: health.record_type, + stat: health.stat, + new_value: value, + }) + } + displayText={health.value} + /> + + + + {general_record.map(({ value, message }, index) => ( + + {message} {value} + + ))} + + + + + + + +
+ )} + + ); +}; + +// Constants +const healthStatusOptions = ['Unfit', 'Deceased', 'Active']; + +const deathOptions = [ + 'Organ Failure', + 'Decapitation', + 'Burn Trauma', + 'Bullet Wound', + 'Blunt Force Trauma', + 'Blood Loss', + 'Disease', +]; + +const colors = { + Deceased: 'red', + Active: 'blue', + Unfit: 'yellow', +}; diff --git a/tgui/packages/tgui/interfaces/Records/types.tsx b/tgui/packages/tgui/interfaces/Records/types.tsx new file mode 100644 index 000000000000..8d90d61e41a5 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/types.tsx @@ -0,0 +1,28 @@ +// Generic types so far used only by SecRec and ModRec +import { BooleanLike } from 'common/react'; + +// all mutable stats from dm are passed in this format. +export type GenericStat = { + record_type: string; + stat: string; + value: string; + message: string; +}; + +// For now the general record data is immutable, keep it separate for that reason. +export type GeneralRecord = { + value: string; + message: string; +}; + +// ui is very similar for both record systems. +export type CompCommon = { + // shared + authenticated: BooleanLike; + id_name: string; + + // not shared but future record UI will most likely have it as well, I think it's fine to keep it here. + has_id: boolean; + selected_target_name: string; + human_mob_list: string[]; +}; diff --git a/tgui/packages/tgui/interfaces/SecRec.tsx b/tgui/packages/tgui/interfaces/SecRec.tsx new file mode 100644 index 000000000000..8b914a3704a2 --- /dev/null +++ b/tgui/packages/tgui/interfaces/SecRec.tsx @@ -0,0 +1,259 @@ +import React, { useState } from 'react'; + +import { useBackend } from '../backend'; +import { + Box, + Button, + Dropdown, + Flex, + Icon, + Input, + Section, + Stack, + Tabs, +} from '../components'; +import { Window } from '../layouts'; +import { CompCommon, GeneralRecord, GenericStat } from './Records/types'; + +// Security Record Type +interface SecurityRec extends CompCommon { + incident: GenericStat; + notes: GenericStat; + general_record: GeneralRecord[]; + crime_stat: GenericStat; +} + +export const SecRec = (props) => { + const { data } = useBackend(); + const { authenticated, selected_target_name } = data; + const [selectedTab, setSelectedTab] = useState(1); + const [searchQuery, setSearchQuery] = useState(''); + + return ( + + + + + setSelectedTab(1)} + > + Crew Manifest + + {!!authenticated && !!selected_target_name && ( + <> + setSelectedTab(2)} + > + Criminal Status + + setSelectedTab(3)} + > + Criminal History + + + )} + + {selectedTab === 1 && ( + + )} + {selectedTab === 2 && !!authenticated && !!selected_target_name && ( + + )} + {selectedTab === 3 && !!authenticated && !!selected_target_name && ( + + )} + + + + ); +}; +const CrimeHist = (props) => { + const { data, act } = useBackend(); + const [selectedTab, setSelectedTab] = useState(1); + const { incident, notes } = data; + + return ( + <> +
+ + + setSelectedTab(1)} + > + General Notes + + setSelectedTab(2)} + > + Incident Report + + + {selectedTab === 1 && } + {selectedTab === 2 && } + + + ); +}; + +const GeneralNotes = ({ act, notes }) => ( +
+ + {notes.message} + + {notes.value} + + + + New note entry: + + { + act('updateStatRecord', { + record_type: notes.record_type, + stat: notes.stat, + new_value: value, + }); + }} + /> + + + + +
+); + +const IncidentReport = ({ incident }) => ( +
+ + Incident Reports: + {incident.value.map((report, index) => ( + + {report} + + ))} + +
+); + +const CrewManifest = ({ searchQuery, setSearchQuery }) => { + const { act, data } = useBackend(); + const { human_mob_list, selected_target_name, authenticated, id_name } = data; + + return ( + <> +
{ + act(authenticated ? 'logout' : 'authenticate'); + }} + /> + } + /> + {!!authenticated && ( +
+ setSearchQuery(value)} + /> + {human_mob_list + .filter((record) => + record.toLowerCase().includes(searchQuery.toLowerCase()), + ) + .map((record, index) => ( + + {record} + +
+ )} + + ); +}; + +const CrimeStat = (props) => { + const { act, data } = useBackend(); + const { general_record, crime_stat } = data; + + return ( +
+ + + + + act('updateStatRecord', { + record_type: crime_stat.record_type, + stat: crime_stat.stat, + new_value: value, + }) + } + displayText={crime_stat.value} + /> + + + + {general_record.map(({ value, message }, index) => ( + + {message} {value} + + ))} + + + + + + + +
+ ); +}; + +// Constants +const crimeStatusOptions = ['Arrest', 'None', 'Incarcerated']; + +const colors = { + Arrest: 'red', + None: 'blue', + Incarcerated: 'orange', +}; diff --git a/tgui/packages/tgui/interfaces/SquadMod.jsx b/tgui/packages/tgui/interfaces/SquadMod.jsx index 0890335000d8..e97d28752a64 100644 --- a/tgui/packages/tgui/interfaces/SquadMod.jsx +++ b/tgui/packages/tgui/interfaces/SquadMod.jsx @@ -4,39 +4,44 @@ import { Window } from '../layouts'; export const SquadMod = (props) => { const { act, data } = useBackend(); - const { squads = [], human, id_name, has_id } = data; + const { squads = [], human, id_name, has_id, authenticated } = data; return ( - + -
- - - - - {!has_id && ( - - - Insert ID of person, that you want transfer. - - - )} - {!human && ( +
{ + act(authenticated ? 'logout' : 'authenticate'); + }} + /> + } + > +
+ {!!has_id && !!authenticated && ( +
+ - Ask or force person, to place hand on my scanner. + {human + ? `Selected for squad transfer: ${human}` + : 'Ask or force person to place hand on my scanner.'} - )} - {!!human && ( - - Selected for squad transfer: {human} - - )} - -
- {!!(human && has_id) && ( +
+
+ )} + {!!human && !!has_id && !!authenticated && (
{squads.map((entry) => (