diff --git a/SQL/beestation_schema.sql b/SQL/beestation_schema.sql index 526eeb02626..632d928b17a 100644 --- a/SQL/beestation_schema.sql +++ b/SQL/beestation_schema.sql @@ -118,6 +118,10 @@ CREATE TABLE IF NOT EXISTS `SS13_characters` ( `preferred_pilot_role` VARCHAR(32) NOT NULL COLLATE 'utf8mb4_general_ci', `flavor_text` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci', `lizard_hiss_style` VARCHAR(32) NOT NULL COLLATE 'utf8mb4_general_ci', + `silicon_flavor_text` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci', + `general_record` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci', + `security_record` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci', + `medical_record` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci', PRIMARY KEY (`slot`, `ckey`) USING BTREE ) COLLATE='utf8mb4_general_ci' ENGINE=InnoDB; diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 4418113c6fd..34a71559d57 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -262,6 +262,12 @@ G.fields["gender"] = "Other" G.fields["photo_front"] = photo_front G.fields["photo_side"] = photo_side + //NSV13 - Roleplaying Records General Records - Start + if(C?.prefs?.active_character?.general_record) + G.fields["past_records"] = C.prefs.active_character.general_record + else + G.fields["past_records"] = "" + //NSV13 - Roleplaying Records General Records - Stop general += G //Medical Record @@ -279,6 +285,12 @@ M.fields["cdi"] = "None" M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." M.fields["notes"] = "No notes." + //NSV13 - Roleplaying Records Medical Records - Start + if(C?.prefs?.active_character?.medical_record) + M.fields["past_records"] = C.prefs.active_character.medical_record + else + M.fields["past_records"] = "" + //NSV13 - Roleplaying Records Medical Records - Stop medical += M //Security Record @@ -289,6 +301,12 @@ S.fields["citation"] = list() S.fields["crim"] = list() S.fields["notes"] = "No notes." + //NSV13 - Roleplaying Records Security Records - Start + if(C?.prefs?.active_character?.security_record) + S.fields["past_records"] = C.prefs.active_character.security_record + else + S.fields["past_records"] = "" + //NSV13 - Roleplaying Records Security Records - Stop security += S //Locked Record diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 43671b8c325..6225bacad8b 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -40,7 +40,7 @@ return ..() -/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = FALSE) +/datum/dna/proc/transfer_identity(mob/living/carbon/human/destination, transfer_SE = FALSE) if(!istype(destination)) return destination.dna.unique_enzymes = unique_enzymes @@ -51,7 +51,7 @@ destination.dna.features = features.Copy() destination.dna.real_name = real_name destination.dna.temporary_mutations = temporary_mutations.Copy() - destination.flavour_text = destination.dna.features["flavour_text"] //Update the flavor_text to use new dna text //NSV13 + destination.flavour_text = destination.client.prefs.active_character.flavor_text //Update the flavor_text to use new dna text //NSV13 if(transfer_SE) destination.dna.mutation_index = mutation_index destination.dna.default_mutation_genes = default_mutation_genes @@ -360,7 +360,6 @@ //Do not use force_transfer_mutations for stuff like cloners without some precautions, otherwise some conditional mutations could break (timers, drill hat etc) if(newfeatures) dna.features = newfeatures - flavour_text = dna.features["flavour_text"] //Update the flavor_text to use new dna text //NSV13 if(mrace) var/datum/species/newrace = new mrace.type diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 49696fe8914..9508c88cf77 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -113,11 +113,13 @@ dat += "Fingerprint: [active1.fields["fingerprint"]] " dat += "Physical Status: [active1.fields["p_stat"]] " dat += "Mental Status: [active1.fields["m_stat"]] " + dat += "General Records:View " //NSV13 - Roleplaying Records else dat += "General Record Lost!" dat += "
Medical Data" if(active2 in GLOB.data_core.medical) + dat += "Medical Records:View " //NSV13 - Roleplaying Records dat += "Blood Type: [active2.fields["blood_type"]] " dat += "DNA: [active2.fields["b_dna"]] " dat += "
Minor Disabilities:
 [active2.fields["mi_dis"]] " @@ -196,6 +198,21 @@ src.active1 = null src.active2 = null else if(href_list["choice"]) + //NSV13 - Roleplaying Records - Start + if(href_list["choice"] == "View Past Medical") + if(istype(active2, /datum/data/record)) + temp = "
Medical Records:
" + temp += "" + + if(href_list["choice"] == "View Past General") + if(istype(active1, /datum/data/record)) + temp = "
General Records:
" + temp += "" + //NSV13 - Roleplaying Records - End // SORTING! if(href_list["choice"] == "Sorting") // Reverse the order if clicked twice @@ -516,10 +533,34 @@ final_paper_text += text("Name: [] ID: []
\nGender: []
\nSex: []
\nAge: []
", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["gender"], src.active1.fields["sex"], src.active1.fields["age"]) //NSV13 final_paper_text += "\nSpecies: [active1.fields["species"]]
" final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"]) + //NSV13 - Roleplaying Records - Start + if(!(active1.fields["past_records"] == "")) + final_paper_text += "\nGeneral Records:\n[active1.fields["past_records"]]\n" else final_paper_text += "General Record Lost!
" if(active2 in GLOB.data_core.medical) - final_paper_text += text("
\n
Medical Data

\nBlood Type: []
\nDNA: []
\n
\nMinor Disabilities: []
\nDetails: []
\n
\nMajor Disabilities: []
\nDetails: []
\n
\nAllergies: []
\nDetails: []
\n
\nCurrent Diseases: [] (per disease info placed in log/comment section)
\nDetails: []
\n
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", src.active2.fields["blood_type"], src.active2.fields["b_dna"], src.active2.fields["mi_dis"], src.active2.fields["mi_dis_d"], src.active2.fields["ma_dis"], src.active2.fields["ma_dis_d"], src.active2.fields["alg"], src.active2.fields["alg_d"], src.active2.fields["cdi"], src.active2.fields["cdi_d"], src.active2.fields["notes"]) + final_paper_text += "
\n
Medical Data
" + if(!(active2.fields["past_records"] == "")) + final_paper_text += "\nMedical Records:\n[active2.fields["past_records"]]
\n" + final_paper_text += "
\nBlood Type: [active2.fields["blood_type"]]" + final_paper_text += "
\nDNA: [active2.fields["b_dna"]]" + final_paper_text += "
\n" + final_paper_text += "
\nMinor Disabilities: [active2.fields["mi_dis"]]" + final_paper_text += "
\nDetails: [active2.fields["mi_dis_d"]]" + final_paper_text += "
\n" + final_paper_text += "
\nMajor Disabilities: [active2.fields["ma_dis"]]" + final_paper_text += "
\nDetails: [active2.fields["ma_dis_d"]]" + final_paper_text += "
\n" + final_paper_text += "
\nAllergies: [active2.fields["alg"]]" + final_paper_text += "
\nDetails: [active2.fields["alg_d"]]" + final_paper_text += "
\n" + final_paper_text += "
\nCurrent Diseases: [active2.fields["cdi"]] (per disease info placed in log/comment section)" + final_paper_text += "
\nDetails: [active2.fields["cdi_d"]]" + final_paper_text += "
\n" + final_paper_text += "
\nImportant Notes:" + final_paper_text += "
\n\t[active2.fields["notes"]]" + final_paper_text += "
\n" + //NSV13 - Roleplaying Records - End var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) final_paper_text += text("[]
", src.active2.fields[text("com_[]", counter)]) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index c989b0c8547..f2b7766a00c 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -356,6 +356,7 @@ Fingerprint: [active1.fields["fingerprint"]]  Physical Status: [active1.fields["p_stat"]]  Mental Status: [active1.fields["m_stat"]]  + General Records:View 

Print photo
@@ -363,11 +364,12 @@

Print photo
Update side photo
- "} + "} //NSV13 - TEXT AMENDED, "GENERAL RECORDS" - Roleplaying Records else dat += "
General Record Lost!
" if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) dat += "Security Data" + dat += "
Security Records: View" //NSV13 - Roleplaying Records dat += "
Criminal Status: [active2.fields["criminal"]]" dat += "

Citations: Add New" @@ -455,6 +457,21 @@ What a mess.*/ if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr) || IsAdminGhost(usr)) usr.set_machine(src) switch(href_list["choice"]) + //NSV13 - Roleplaying Records - Start + if("View Past Security") + if(istype(active2, /datum/data/record)) + temp = "
Security Records:
" + temp += "" + + if("View Past General") + if(istype(active1, /datum/data/record)) + temp = "
General Records:
" + temp += "" + //NSV13 - Roleplaying Records - End // SORTING! if("Sorting") // Reverse the order if clicked twice @@ -557,11 +574,19 @@ What a mess.*/ final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields["name"], active1.fields["id"], active1.fields["gender"], active1.fields["age"]) final_paper_text += "\nSpecies: [active1.fields["species"]]
" final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"]) + //NSV13 - Roleplaying Records - Start + if(!(active1.fields["past_records"] == "")) + final_paper_text += "\nGeneral Records:\n[active1.fields["past_records"]]\n" + //NSV13 - Roleplaying Records - End else final_paper_text += "General Record Lost!
" if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) - final_paper_text += text("
\n
Security Data

\nCriminal Status: []", active2.fields["criminal"]) - + //NSV13 - Roleplaying Records - Start + final_paper_text += text("
\n
Security Data

\n") + if(!(active2.fields["past_records"] == "")) + final_paper_text += "\nSecurity Records:\n[active2.fields["past_records"]]\n" + final_paper_text += text("Criminal Status: []", active2.fields["criminal"]) + //NSV13 - Roleplaying Records - End final_paper_text += "
\n
\nCrimes:
\n" final_paper_text +={" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 11319ebfd6a..401e4131f8b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -139,6 +139,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/shop_name = "[CONFIG_GET(string/metacurrency_name)] Shop" dat += "[shop_name]" dat += "OOC Preferences" + dat += "Roleplay Settings" //NSV13 - Roleplay Tab dat += "" @@ -191,18 +192,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Body Model:[active_character.features["body_model"] == MALE ? "Masculine" : "Feminine"]
" dat += "Age:[active_character.age]
" - //NSV13 FLAVOR TEXT RELATED START - dat += "Set Flavor Text" - if(length(active_character.flavor_text) <= 40) - if(!length(active_character.flavor_text)) - dat += "\[...\]" - else - dat += "[active_character.flavor_text]" - else - dat += "[copytext_char(active_character.flavor_text, 1, 37)]...
" - - dat += "
Special Names:
" - //NSV13 FLAVOR TEXT RELATED END + dat += "Special Names:
" var/old_group for(var/custom_name_id in GLOB.preferences_custom_names) var/namedata = GLOB.preferences_custom_names[custom_name_id] @@ -900,6 +890,95 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "" dat += "
" + if(4) //NSV13 - Roleplay Tab - Start + dat += "
" + var/name + var/unspaced_slots = 0 + for(var/datum/character_save/CS as anything in character_saves) + unspaced_slots++ + if(unspaced_slots > 4) + dat += "
" + unspaced_slots = 0 + name = CS.real_name + if(!name) + name = "Character [CS.slot_number]" + if(CS.slot_locked) + dat += "[name] (Locked) " + else + dat += "[name] " + dat += "
" + + dat += "

Flavor Text

" + dat += "
" + + dat += "Set Flavor Text
" + if(length(active_character.flavor_text) <= 40) + if(!length(active_character.flavor_text)) + dat += "\[...\]" + else + dat += "[active_character.flavor_text]" + else + dat += "[copytext_char(active_character.flavor_text, 1, 40)]...
" + + dat += "
" + + dat += "Set Silicon Examine Text
" + if(length(active_character.silicon_flavor_text) <= 40) + if(!length(active_character.silicon_flavor_text)) + dat += "\[...\]" + else + dat += "[active_character.silicon_flavor_text]" + else + dat += "[copytext_char(active_character.silicon_flavor_text, 1, 40)]...
" + + dat += "
" + + dat += "" + dat += "" + dat += "
" + + dat += "

General Record

" + dat += "Set General Record
" + + if(length(active_character.general_record) <= 40) + if(!length(active_character.general_record)) + dat += "\[...\]" + else + dat += "[html_encode(active_character.general_record)]" + else + dat += "[copytext_char(active_character.general_record, 1, 40)]..." + + dat += "
" + + + dat += "

Medical Record

" + dat += "Set Medical Record
" + + if(length(active_character.medical_record) <= 40) + if(!length(active_character.medical_record)) + dat += "\[...\]" + else + dat += "[html_encode(active_character.medical_record)]" + else + dat += "[copytext_char(active_character.medical_record, 1, 40)]..." + + dat += "
" + + + dat += "

Security Record

" + dat += "Set Security Record
" + + if(length(active_character.security_record) <= 40) + if(!length(active_character.security_record)) + dat += "\[...\]" + else + dat += "[html_encode(active_character.security_record)]" + else + dat += "[copytext_char(active_character.security_record, 1, 40)]..." + + dat += "
" + dat += "
" + //NSV13 - Roleplay Tab - End dat += "
" if(!IS_GUEST_KEY(user.key)) @@ -1785,17 +1864,38 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("syndiecrew") var/client/C = (istype(user, /client)) ? user : user.client C.select_syndie_role() - + //NSV13 - Roleplay Stuff if("flavor_text") - var/msg = capped_multiline_input(usr, "Set the flavor text for your 'examine' verb.\nThe rules are the following;\nNo Memes.\nNothing that people can't see at a glance.\nNothing that's Out Of Character.\nNothing that breaks the game.", "Flavor Text", active_character.flavor_text) + var/msg = input(usr, "Set the flavor text for your 'examine' verb.\nThe rules are the following;\nNo Memes.\nNothing that people can't see at a glance.\nNothing that's Out Of Character.\nNothing that breaks the game.", "Flavor Text", active_character.flavor_text) as message|null if(msg) - active_character.flavor_text = html_decode(strip_html(msg)) + active_character.flavor_text = html_decode(strip_html_simple(msg)) if("lizard_hiss_style") if(active_character.lizard_hiss_style == LIZARD_HISS_EXPANDED) active_character.lizard_hiss_style = LIZARD_HISS_LEGACY else active_character.lizard_hiss_style = LIZARD_HISS_EXPANDED - //NSV13 end + + if("silicon_flavor_text") + var/msg = input(usr, "Set the flavor text in your 'examine' verb. This is for describing what people can tell by looking at your character.", "Silicon Flavor Text", active_character.silicon_flavor_text) as message|null + if(!isnull(msg)) + active_character.silicon_flavor_text = html_decode(strip_html_simple(msg)) + + if("general_record") + var/msg = input(usr, "Set your general record. This is more or less public information, available from security, medical and command consoles", "General Record", active_character.general_record) as message|null + if(!isnull(msg)) + active_character.general_record = html_decode(strip_html_simple(msg)) + + if("medical_record") + var/msg = input(usr, "Set your medical record. ", "Medical Record", active_character.medical_record) as message|null + if(!isnull(msg)) + active_character.medical_record = html_decode(strip_html_simple(msg)) + + if("security_record") + var/msg = input(usr, "Set your security record. ", "Medical Record", active_character.security_record) as message|null + if(!isnull(msg)) + active_character.security_record = html_decode(strip_html_simple(msg)) + + //NSV13 - END if ("preferred_map") var/maplist = list() var/default = "Default" diff --git a/code/modules/client/preferences2/character_save.dm b/code/modules/client/preferences2/character_save.dm index 4f3fef3911b..59fc38cad52 100644 --- a/code/modules/client/preferences2/character_save.dm +++ b/code/modules/client/preferences2/character_save.dm @@ -75,10 +75,15 @@ var/preferred_squad = "Able" //NSV13 - Pilots var/preferred_pilot_role = PILOT_COMBAT - //NSV13 - Added Flavor Text + //NSV13 - Roleplaying Stuff - Start var/flavor_text = "" //Nsv13 - lizard hiss style pref var/lizard_hiss_style = LIZARD_HISS_EXPANDED + var/silicon_flavor_text = "" + var/general_record = "" + var/security_record = "" + var/medical_record = "" + //NSV13 - Roleplaying Stuff - End /datum/character_save/New() real_name = get_default_name() @@ -157,18 +162,26 @@ SAFE_READ_QUERY(31, loadout_tmp) equipped_gear = json_decode(loadout_tmp) - //NSV13 squads + //NSV13 - Start SAFE_READ_QUERY(32, preferred_squad) - //NSV13 pilot role SAFE_READ_QUERY(33, preferred_pilot_role) - //NSV13 flavor text SAFE_READ_QUERY(34, flavor_text) //NSV13 lizard hiss style SAFE_READ_QUERY(35, lizard_hiss_style) + SAFE_READ_QUERY(36, silicon_flavor_text) + + SAFE_READ_QUERY(37, general_record) + + SAFE_READ_QUERY(38, security_record) + + SAFE_READ_QUERY(39, medical_record) + //NSV13 - Stop + + //Sanitize. Please dont put query reads below this point. Please. real_name = reject_bad_name(real_name, pref_species.allow_numbers_in_name) @@ -249,8 +262,13 @@ all_quirks = SANITIZE_LIST(all_quirks) - - flavor_text = html_decode(strip_html(flavor_text)) //NSV13 added flavor text + //NSV13 - Roleplay Stuff - Start + flavor_text = html_decode(strip_html(flavor_text)) + silicon_flavor_text = html_decode(strip_html(silicon_flavor_text)) + general_record = sanitize_text(general_record) + security_record = sanitize_text(security_record) + medical_record = sanitize_text(medical_record) + //NSV13 - Roleplay Stuff - Stop return TRUE @@ -313,7 +331,7 @@ if(IS_GUEST_KEY(C.ckey)) return - // Get ready for a disgusting query //NSV13 adds squads, pilot role and flavor text prefs + // Get ready for a disgusting query //NSV13 adds squads, pilot role and roleplaying prefs var/datum/DBQuery/insert_query = SSdbcore.NewQuery({" REPLACE INTO [format_table_name("characters")] ( slot, @@ -351,7 +369,11 @@ preferred_squad, preferred_pilot_role, flavor_text, - lizard_hiss_style + lizard_hiss_style, + silicon_flavor_text, + general_record, + security_record, + medical_record ) VALUES ( :slot, :ckey, @@ -388,7 +410,11 @@ :preferred_squad, :preferred_pilot_role, :flavor_text, - :lizard_hiss_style + :lizard_hiss_style, + :silicon_flavor_text, + :general_record, + :security_record, + :medical_record ) "}, list( // Now for the above but in a fucking monsterous list @@ -427,7 +453,11 @@ "preferred_squad" = preferred_squad, "preferred_pilot_role" = preferred_pilot_role, "flavor_text" = flavor_text, - "lizard_hiss_style" = lizard_hiss_style + "lizard_hiss_style" = lizard_hiss_style, + "silicon_flavor_text" = silicon_flavor_text, + "general_record" = general_record, + "security_record" = security_record, + "medical_record" = medical_record )) if(!insert_query.warn_execute()) diff --git a/code/modules/client/preferences2/preferences2.dm b/code/modules/client/preferences2/preferences2.dm index 3a4c4f1d983..a57181f360e 100644 --- a/code/modules/client/preferences2/preferences2.dm +++ b/code/modules/client/preferences2/preferences2.dm @@ -216,7 +216,11 @@ preferred_squad, preferred_pilot_role, flavor_text, - lizard_hiss_style + lizard_hiss_style, + silicon_flavor_text, + general_record, + security_record, + medical_record FROM [format_table_name("characters")] WHERE ckey=:ckey "}, list("ckey" = parent.ckey)) diff --git a/code/modules/client/verbs/looc.dm b/code/modules/client/verbs/looc.dm index affa69737e7..872414c25d4 100644 --- a/code/modules/client/verbs/looc.dm +++ b/code/modules/client/verbs/looc.dm @@ -115,34 +115,7 @@ ////////////////////FLAVOUR TEXT NSV13//////////////////// /mob var/flavour_text = "" - -/mob/proc/update_flavor_text() - set src in usr - - if(usr != src) - usr << "No." - var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavour Text",html_decode(flavour_text)) as message|null) - - if(msg) - msg = copytext(msg, 1, MAX_MESSAGE_LEN) - msg = html_encode(msg) - - flavour_text = msg - -/mob/proc/warn_flavor_changed() - if(flavour_text && flavour_text != "") // don't spam people that don't use it! - src << "

OOC Warning:

" - src << "Your flavor text is likely out of date! Change" - -/mob/proc/print_flavor_text() - if(flavour_text && flavour_text != "") - var/msg = replacetext(flavour_text, "\n", " ") - if(length(msg) <= 100) - return "[msg]" - else - return "[copytext(msg, 1, 97)]... More..." - -//Needed for LOOC and flavour text +//NSV13 - flavour text - Don't think this thing actually does anything - END /mob/proc/get_top_level_mob() if(istype(src.loc,/mob)&&src.loc!=src) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 1b3fdfafd14..aab1971dff6 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -991,11 +991,6 @@ if(mood.sanity < SANITY_UNSTABLE) return TRUE -//NSV13 -/mob/living/carbon/proc/update_flavor_text_feature(new_text) - if(!dna) - return - dna.features["flavour_text"] = new_text /mob/living/carbon/set_gender(ngender = NEUTER, silent = FALSE, update_icon = TRUE, forced = FALSE) var/bender = gender != ngender diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index 904b27adb9a..1b6c3a48fd1 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -47,3 +47,26 @@ GLOBAL_LIST_EMPTY(dummy_mob_list) if(istype(D)) D.wipe_state() D.in_use = FALSE + +//NSV13 - Roleplay Stuff +/proc/generate_dummy_lookalike(slotkey, mob/target) + if(!istype(target)) + return generate_or_wait_for_human_dummy(slotkey) + + var/mob/living/carbon/human/dummy/copycat = generate_or_wait_for_human_dummy(slotkey) + + if(iscarbon(target)) + var/mob/living/carbon/carbon_target = target + carbon_target.dna.transfer_identity(copycat, transfer_SE = TRUE) + + if(ishuman(target)) + var/mob/living/carbon/human/human_target = target + human_target.copy_clothing_prefs(copycat) + + copycat.updateappearance(icon_update=TRUE, mutcolor_update=TRUE, mutations_overlay_update=TRUE) + else + //even if target isn't a carbon, if they have a client we can make the + //dummy look like what their human would look like based on their prefs + target?.client?.prefs?.active_character.copy_to(copycat, icon_updates=TRUE, roundstart_checks=FALSE) + + return copycat diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 77c8e0c2238..6d8e78bf809 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -17,7 +17,7 @@ if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA)) obscure_name = TRUE - var/apparent_species + var/apparent_species //NSV13 - add rank to name var/display_name = "" if(CONFIG_GET(flag/show_ranks)) @@ -359,6 +359,10 @@ . += "\[Medical evaluation\]
" if(traitstring) . += "Detected physiological traits:\n[traitstring]" + //NSV13 - Roleplaying Records - Start + . += "\[View medical records\]" + . += "\[View general records\]" + //NSV13 - Roleplaying Records - End if(HAS_TRAIT(user, TRAIT_SECURITY_HUD)) if(!user.stat && user != src) @@ -370,25 +374,24 @@ criminal = R.fields["criminal"] . += "Criminal status: \[[criminal]\]" - . += jointext(list("Security record: \[View\]", + . += jointext(list("Security record: \[View security records\]", //NSV13 - Roleplaying Records "\[Add citation\]", "\[Add crime\]", "\[View comment log\]", "\[Add comment\]"), "") + + . += jointext(list("General record: \[View general records\]"), "") //NSV13 - Roleplaying Records else if(isobserver(user) && traitstring) . += "Traits: [traitstring]" - //NSV13 START - //No flavor text unless the face can be seen. Prevents certain metagaming with impersonation. - var/invisible_man = skipface || get_visible_name() == "Unknown" - if(invisible_man) - . += "...?" - else - var/flavor = print_flavor_text() - if(flavor) - . += flavor - //NSV13 STOP + //NSV13 - Roleplaying Records - Start + if(!skipface) + var/line = "Examine closely..." + + if(line) + . += line + //NSV13 - Roleplaying Records - End . += "*---------*" /mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects! diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b868cb5f3a9..1108434dc22 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -162,6 +162,13 @@ to_chat(usr, "You can't reach that! Something is covering it.") return + //NSV13 - Roleplaying Stuff + if(href_list["lookup_info"]) + switch(href_list["lookup_info"]) + if("open_examine_panel") + tgui.holder = src + tgui.ui_interact(usr) //datum has a tgui component, here we open the window + ///////HUDs/////// if(href_list["hud"]) if(!ishuman(usr)) @@ -170,17 +177,20 @@ var/perpname = get_face_name(get_id_name("")) if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD) && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return - var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general) + //NSV13 - Roleplaying Records - Changed ALL the references to the variable R to these three records below here - Start + var/datum/data/record/general_record = find_record("name", perpname, GLOB.data_core.general) + var/datum/data/record/med_record = find_record("name", perpname, GLOB.data_core.medical) + var/datum/data/record/sec_record = find_record("name", perpname, GLOB.data_core.security) if(href_list["photo_front"] || href_list["photo_side"]) - if(!R) + if(!general_record) return if(!H.canUseHUD()) return var/obj/item/photo/P = null if(href_list["photo_front"]) - P = R.fields["photo_front"] + P = general_record.fields["photo_front"] else if(href_list["photo_side"]) - P = R.fields["photo_side"] + P = general_record.fields["photo_side"] if(P) P.show(H) return @@ -236,27 +246,31 @@ to_chat(H, "ERROR: Invalid access") return if(href_list["p_stat"]) - var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") - if(!R) + var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", general_record.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") + if(!general_record) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields["p_stat"] = health_status + general_record.fields["p_stat"] = health_status return if(href_list["m_stat"]) - var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields["m_stat"]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") - if(!R) + var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", general_record.fields["m_stat"]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") + if(!general_record) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields["m_stat"] = health_status + general_record.fields["m_stat"] = health_status return + if(href_list["medrecords"]) + to_chat(usr, "
Medical Record:
[med_record.fields["past_records"]]") + if(href_list["genrecords"]) + to_chat(usr, "General Record: [general_record.fields["past_records"]]") return //Medical HUD ends here. if(href_list["hud"] == "s") @@ -282,31 +296,30 @@ if(!perpname) to_chat(H, "ERROR: Can not identify target.") return - R = find_record("name", perpname, GLOB.data_core.security) - if(!R) + if(!sec_record) to_chat(usr, "ERROR: Unable to locate data core entry for target.") return if(href_list["status"]) - var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "Arrest", "Search", "Monitor", "Incarcerated", "Paroled", "Discharged", "Cancel") + var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", sec_record.fields["criminal"]) in list("None", "Arrest", "Search", "Monitor", "Incarcerated", "Paroled", "Discharged", "Cancel") if(setcriminal != "Cancel") - if(!R) + if(!sec_record) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return - investigate_log("[key_name(src)] has been set from [R.fields["criminal"]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) - R.fields["criminal"] = setcriminal + investigate_log("[key_name(src)] has been set from [sec_record.fields["criminal"]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) + sec_record.fields["criminal"] = setcriminal sec_hud_set_security_status() return - if(href_list["view"]) + if(href_list["viewsec"]) if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return - to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]") - for(var/datum/data/crime/c in R.fields["crim"]) + to_chat(usr, "Name: [sec_record.fields["name"]] Criminal Status: [sec_record.fields["criminal"]]") + for(var/datum/data/crime/c in sec_record.fields["crim"]) to_chat(usr, "Crime: [c.crimeName]") if (c.crimeDetails) to_chat(usr, "Details: [c.crimeDetails]") @@ -314,14 +327,22 @@ to_chat(usr, "Details: \[Add details]") to_chat(usr, "Added by [c.author] at [c.time]") to_chat(usr, "----------") - to_chat(usr, "Notes: [R.fields["notes"]]") + to_chat(usr, "Notes: [sec_record.fields["notes"]]") + to_chat(usr, "
Security Record: [sec_record.fields["past_records"]]") return + if(href_list["genrecords"]) + if(!H.canUseHUD()) + return + if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + return + to_chat(usr, "General Record: [general_record.fields["past_records"]]") + if(href_list["add_citation"]) var/maxFine = CONFIG_GET(number/maxfine) var/t1 = stripped_input("Please input citation crime:", "Security HUD", "", null) var/fine = FLOOR(input("Please input citation fine, up to [maxFine]:", "Security HUD", 50) as num|null, 1) - if(!R || !t1 || !fine || !allowed_access) + if(!sec_record || !t1 || !fine || !allowed_access) return if(!H.canUseHUD()) return @@ -334,7 +355,7 @@ var/datum/data/crime/crime = GLOB.data_core.createCrimeEntry(t1, "", allowed_access, station_time_timestamp(), fine) for (var/obj/item/modular_computer/tablet in GLOB.TabletMessengers) - if(tablet.saved_identification == R.fields["name"]) + if(tablet.saved_identification == sec_record.fields["name"]) var/message = "You have been fined [fine] credits for '[t1]'. Fines may be paid at security." var/datum/signal/subspace/messaging/tablet_msg/signal = new(src, list( "name" = "Security Citation", @@ -345,35 +366,35 @@ )) signal.send_to_receivers() usr.log_message("(PDA: Citation Server) sent \"[message]\" to [signal.format_target()]", LOG_PDA) - GLOB.data_core.addCitation(R.fields["id"], crime) - investigate_log("New Citation: [t1] Fine: [fine] | Added to [R.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) + GLOB.data_core.addCitation(sec_record.fields["id"], crime) + investigate_log("New Citation: [t1] Fine: [fine] | Added to [sec_record.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) return if(href_list["add_crime"]) var/t1 = stripped_input("Please input crime name:", "Security HUD", "", null) - if(!R || !t1 || !allowed_access) + if(!sec_record || !t1 || !allowed_access) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return var/crime = GLOB.data_core.createCrimeEntry(t1, null, allowed_access, station_time_timestamp()) - GLOB.data_core.addCrime(R.fields["id"], crime) - investigate_log("New Crime: [t1] | Added to [R.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) + GLOB.data_core.addCrime(sec_record.fields["id"], crime) + investigate_log("New Crime: [t1] | Added to [sec_record.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) to_chat(usr, "Successfully added a crime.") return if(href_list["add_details"]) var/t1 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) - if(!R || !t1 || !allowed_access) + if(!sec_record || !t1 || !allowed_access) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return if(href_list["cdataid"]) - GLOB.data_core.addCrimeDetails(R.fields["id"], href_list["cdataid"], t1) - investigate_log("New Crime details: [t1] | Added to [R.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) + GLOB.data_core.addCrimeDetails(sec_record.fields["id"], href_list["cdataid"], t1) + investigate_log("New Crime details: [t1] | Added to [sec_record.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) to_chat(usr, "Successfully added details.") return @@ -384,26 +405,27 @@ return to_chat(usr, "Comments/Log:") var/counter = 1 - while(R.fields[text("com_[]", counter)]) - to_chat(usr, R.fields[text("com_[]", counter)]) + while(sec_record.fields[text("com_[]", counter)]) + to_chat(usr, sec_record.fields[text("com_[]", counter)]) to_chat(usr, "----------") counter++ return if(href_list["add_comment"]) var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) - if (!R || !t1 || !allowed_access) + if (!sec_record || !t1 || !allowed_access) return if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return var/counter = 1 - while(R.fields[text("com_[]", counter)]) + while(sec_record.fields[text("com_[]", counter)]) counter++ - R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
[]", allowed_access, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+YEAR_OFFSET, t1) //NSV13 edit: year offset change + sec_record.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
[]", allowed_access, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+YEAR_OFFSET, t1) //NSV13 edit: year offset change to_chat(usr, "Successfully added comment.") return + //NSV13 - Roleplaying Records - End ..() //end of this massive fucking chain. TODO: make the hud chain not spooky. @@ -496,10 +518,11 @@ //Check for arrest warrant if(judgment_criteria & JUDGE_RECORDCHECK) + //NSV13 - Roleplaying Records - Start var/perpname = get_face_name(get_id_name()) - var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) - if(R && R.fields["criminal"]) - switch(R.fields["criminal"]) + var/datum/data/record/sec_record = find_record("name", perpname, GLOB.data_core.security) + if(sec_record && sec_record.fields["criminal"]) + switch(sec_record.fields["criminal"]) if("Arrest") threatcount += 5 if("Incarcerated") @@ -510,6 +533,7 @@ threatcount += 1 if("Search") threatcount += 2 + //NSV13 - Roleplaying Records - End //Check for dresscode violations if(istype(head, /obj/item/clothing/head/wizard) || istype(head, /obj/item/clothing/head/helmet/space/hardsuit/wizard)) @@ -664,9 +688,11 @@ /mob/living/carbon/human/replace_records_name(oldname,newname) // Only humans have records right now, move this up if changed. for(var/list/L in list(GLOB.data_core.general,GLOB.data_core.medical,GLOB.data_core.security,GLOB.data_core.locked)) - var/datum/data/record/R = find_record("name", oldname, L) - if(R) - R.fields["name"] = newname + //NSV13 - Roleplaying Records - Start + var/datum/data/record/general_record = find_record("name", oldname, L) + if(general_record) + general_record.fields["name"] = newname + //NSV13 - Roleplaying Records - End /mob/living/carbon/human/get_total_tint() . = ..() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 0d54786f75b..c80afa98bce 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -57,3 +57,6 @@ var/lastpuke = 0 var/last_fire_update var/account_id + + ///The Examine Panel TGUI. //NSV13 + var/datum/examine_panel/tgui = new() //create the datum diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index bef46105f65..db0e3a97909 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -202,3 +202,11 @@ return TRUE if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_BOOZEPOWER)) return TRUE + +///copies over clothing preferences like underwear to another human //NSV13 +/mob/living/carbon/human/proc/copy_clothing_prefs(mob/living/carbon/human/destination) + destination.underwear = underwear + destination.underwear_color = underwear_color + destination.undershirt = undershirt + destination.socks = socks + destination.jumpsuit_style = jumpsuit_style diff --git a/code/modules/mob/living/silicon/examine.dm b/code/modules/mob/living/silicon/examine.dm index 7de281de5f2..5a3d7207e4d 100644 --- a/code/modules/mob/living/silicon/examine.dm +++ b/code/modules/mob/living/silicon/examine.dm @@ -4,3 +4,10 @@ . += "[src] has the following laws:" for(var/law in laws.get_law_list(include_zeroth = TRUE)) . += law + + //NSV13 - Silicon Flavor Text - Start + if(client) + var/line = "Examine closely..." + if(line) + . += line + //NS13 - Silicon Flavor Text - End diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 3781e60c925..a18e08498cf 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -56,6 +56,9 @@ mobchatspan = "centcom" + //NSV13 - Roleplay Stuff + var/datum/examine_panel/tgui = new() //create the datum + /mob/living/silicon/Initialize(mapload) . = ..() GLOB.silicon_mobs += src @@ -256,6 +259,11 @@ if (href_list["printlawtext"]) // this is kinda backwards to_chat(usr, href_list["printlawtext"]) + //NSV13 - Silicon Flavor Text - Start + if(href_list["lookup_info"]) + tgui.holder = src + tgui.ui_interact(usr) //datum has a tgui component, here we open the window + //NSV13 - Silicon Flavor Text - End return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6e06354683b..d57c5e848ca 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -770,12 +770,6 @@ unset_machine() src << browse(null, t1) - //NSV13 START - if(href_list["flavor_more"]) - usr << browse(text("[][]", name, replacetext(flavour_text, "\n", "
")), text("window=[];size=500x200", name)) - onclose(usr, "[name]") - //NSV13 STOP - if(href_list["item"] && usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY)) var/slot = text2num(href_list["item"]) var/hand_index = text2num(href_list["hand_index"]) diff --git a/nsv13.dme b/nsv13.dme index 48d6e201164..aa46e3d361f 100644 --- a/nsv13.dme +++ b/nsv13.dme @@ -3899,6 +3899,7 @@ #include "nsv13\code\modules\mob\mob_helpers.dm" #include "nsv13\code\modules\mob\dead\observer\oberserver.dm" #include "nsv13\code\modules\mob\living\carbon\carbon.dm" +#include "nsv13\code\modules\mob\living\carbon\examine_tgui.dm" #include "nsv13\code\modules\mob\living\carbon\human\nsv_emotes.dm" #include "nsv13\code\modules\mob\living\carbon\human\species_types\catgirl.dm" #include "nsv13\code\modules\mob\living\carbon\human\species_types\nanotrasen_knpc.dm" diff --git a/nsv13/code/modules/mob/living/carbon/examine_tgui.dm b/nsv13/code/modules/mob/living/carbon/examine_tgui.dm new file mode 100644 index 00000000000..9dbb9c97951 --- /dev/null +++ b/nsv13/code/modules/mob/living/carbon/examine_tgui.dm @@ -0,0 +1,63 @@ +/datum/examine_panel + /// Mob that the examine panel belongs to. + var/mob/living/holder + /// The screen containing the appearance of the mob + var/atom/movable/screen/examine_panel_screen/examine_panel_screen + +/datum/examine_panel/ui_state(mob/user) + return GLOB.always_state + + +/datum/examine_panel/ui_close(mob/user) + user.client.clear_map(examine_panel_screen.assigned_map) + + +/atom/movable/screen/examine_panel_screen + name = "examine panel screen" + +/datum/examine_panel/ui_interact(mob/user, datum/tgui/ui) + if(!examine_panel_screen) + examine_panel_screen = new + examine_panel_screen.name = "screen" + examine_panel_screen.assigned_map = "examine_panel_[REF(holder)]_map" + examine_panel_screen.del_on_map_removal = FALSE + examine_panel_screen.screen_loc = "[examine_panel_screen.assigned_map]:1,1" + + var/mutable_appearance/current_mob_appearance = new(holder) + current_mob_appearance.setDir(SOUTH) + current_mob_appearance.transform = matrix() // We reset their rotation, in case they're lying down. + + // In case they're pixel-shifted, we bring 'em back! + current_mob_appearance.pixel_x = 0 + current_mob_appearance.pixel_y = 0 + + examine_panel_screen.cut_overlays() + examine_panel_screen.add_overlay(current_mob_appearance) + + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + user.client.register_map_obj(examine_panel_screen) + ui = new(user, src, "ExaminePanel") + ui.open() + +/datum/examine_panel/ui_data(mob/user) + var/list/data = list() + + var/flavor_text + var/obscured + + if(issilicon(holder)) + flavor_text = user.client.prefs.active_character.silicon_flavor_text + + if(ishuman(holder)) + var/mob/living/carbon/human/holder_human = holder + obscured = (holder_human.wear_mask && (holder_human.wear_mask.flags_inv & HIDEFACE)) || (holder_human.head && (holder_human.head.flags_inv & HIDEFACE)) + flavor_text = obscured ? "Obscured" : holder_human.flavour_text + + var/name = obscured ? "Unknown" : holder.name + + data["obscured"] = obscured ? TRUE : FALSE + data["character_name"] = name + data["assigned_map"] = examine_panel_screen.assigned_map + data["flavor_text"] = flavor_text + return data diff --git a/tgui/packages/tgui/components/Box.tsx b/tgui/packages/tgui/components/Box.tsx index 613ea47d708..8714306afc2 100644 --- a/tgui/packages/tgui/components/Box.tsx +++ b/tgui/packages/tgui/components/Box.tsx @@ -38,6 +38,7 @@ export interface BoxProps { bold?: BooleanLike; italic?: BooleanLike; nowrap?: BooleanLike; + preserveWhitespace?: BooleanLike; // NSV13 - Roleplaying Flavor Text m?: string | BooleanLike; mx?: string | BooleanLike; my?: string | BooleanLike; @@ -163,6 +164,7 @@ const styleMapperByPropName = { bold: mapBooleanPropTo('font-weight', 'bold'), italic: mapBooleanPropTo('font-style', 'italic'), nowrap: mapBooleanPropTo('white-space', 'nowrap'), + preserveWhitespace: mapBooleanPropTo('white-space', 'pre-wrap'), // NSV13 - Roleplaying Flavor Text // Margins m: mapDirectionalUnitPropTo('margin', halfUnit, [ 'top', 'bottom', 'left', 'right', diff --git a/tgui/packages/tgui/interfaces/ExaminePanel.js b/tgui/packages/tgui/interfaces/ExaminePanel.js new file mode 100644 index 00000000000..98202988ea4 --- /dev/null +++ b/tgui/packages/tgui/interfaces/ExaminePanel.js @@ -0,0 +1,53 @@ +import { useBackend } from '../backend'; +import { Stack, Section, ByondUi } from '../components'; +import { Window } from '../layouts'; + +export const ExaminePanel = (props, context) => { + const { act, data } = useBackend(context); + const { + character_name, + obscured, + assigned_map, + flavor_text, + } = data; + return ( + + + + +
+ {!obscured + && ( + + )} +
+
+ + + +
+ {flavor_text} +
+
+
+
+
+
+
+ ); +};