Skip to content

Commit

Permalink
[PORT] Flavor Roleplaying Overhaul (#2274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbanz1 committed Jul 28, 2023
1 parent 296af14 commit 126ea59
Show file tree
Hide file tree
Showing 22 changed files with 506 additions and 126 deletions.
4 changes: 4 additions & 0 deletions SQL/beestation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
18 changes: 18 additions & 0 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion code/game/machinery/computer/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@
dat += "<tr><td>Fingerprint:</td><td><A href='?src=[REF(src)];field=fingerprint'>&nbsp;[active1.fields["fingerprint"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Physical Status:</td><td><A href='?src=[REF(src)];field=p_stat'>&nbsp;[active1.fields["p_stat"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Mental Status:</td><td><A href='?src=[REF(src)];field=m_stat'>&nbsp;[active1.fields["m_stat"]]&nbsp;</A></td></tr>"
dat += "<tr><td>General Records:</td><td><A href='?src=[REF(src)];choice=View Past General'>View&nbsp;</A></td></tr>" //NSV13 - Roleplaying Records
else
dat += "<tr><td>General Record Lost!</td></tr>"

dat += "<tr><td><br><b><font size='4'>Medical Data</font></b></td></tr>"
if(active2 in GLOB.data_core.medical)
dat += "<tr><td>Medical Records:</td><td><A href='?src=[REF(src)];choice=View Past Medical'>View&nbsp;</A></td></tr>" //NSV13 - Roleplaying Records
dat += "<tr><td>Blood Type:</td><td><A href='?src=[REF(src)];field=blood_type'>&nbsp;[active2.fields["blood_type"]]&nbsp;</A></td></tr>"
dat += "<tr><td>DNA:</td><td><A href='?src=[REF(src)];field=b_dna'>&nbsp;[active2.fields["b_dna"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Minor Disabilities:</td><td><br><A href='?src=[REF(src)];field=mi_dis'>&nbsp;[active2.fields["mi_dis"]]&nbsp;</A></td></tr>"
Expand Down Expand Up @@ -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 = "<h5>Medical Records:</h5>"
temp += "<ul>"
temp += "<li>[active2.fields["past_records"]]</li>"
temp += "</ul>"

if(href_list["choice"] == "View Past General")
if(istype(active1, /datum/data/record))
temp = "<h5>General Records:</h5>"
temp += "<ul>"
temp += "<li>[active1.fields["past_records"]]</li>"
temp += "</ul>"
//NSV13 - Roleplaying Records - End
// SORTING!
if(href_list["choice"] == "Sorting")
// Reverse the order if clicked twice
Expand Down Expand Up @@ -516,10 +533,34 @@
final_paper_text += text("Name: [] ID: []<BR>\nGender: []<BR>\nSex: []<BR>\nAge: []<BR>", 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"]]<BR>"
final_paper_text += text("\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", 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 += "<B>General Record Lost!</B><BR>"
if(active2 in GLOB.data_core.medical)
final_paper_text += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", 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 += "<BR>\n<CENTER><B>Medical Data</B></CENTER>"
if(!(active2.fields["past_records"] == ""))
final_paper_text += "\nMedical Records:\n[active2.fields["past_records"]]<BR>\n"
final_paper_text += "<BR>\nBlood Type: [active2.fields["blood_type"]]"
final_paper_text += "<BR>\nDNA: [active2.fields["b_dna"]]"
final_paper_text += "<BR>\n"
final_paper_text += "<BR>\nMinor Disabilities: [active2.fields["mi_dis"]]"
final_paper_text += "<BR>\nDetails: [active2.fields["mi_dis_d"]]"
final_paper_text += "<BR>\n"
final_paper_text += "<BR>\nMajor Disabilities: [active2.fields["ma_dis"]]"
final_paper_text += "<BR>\nDetails: [active2.fields["ma_dis_d"]]"
final_paper_text += "<BR>\n"
final_paper_text += "<BR>\nAllergies: [active2.fields["alg"]]"
final_paper_text += "<BR>\nDetails: [active2.fields["alg_d"]]"
final_paper_text += "<BR>\n"
final_paper_text += "<BR>\nCurrent Diseases: [active2.fields["cdi"]] (per disease info placed in log/comment section)"
final_paper_text += "<BR>\nDetails: [active2.fields["cdi_d"]]"
final_paper_text += "<BR>\n"
final_paper_text += "<BR>\nImportant Notes:"
final_paper_text += "<BR>\n\t[active2.fields["notes"]]"
final_paper_text += "<BR>\n"
//NSV13 - Roleplaying Records - End
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
final_paper_text += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
Expand Down
31 changes: 28 additions & 3 deletions code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -356,18 +356,20 @@
<tr><td>Fingerprint:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=fingerprint'>&nbsp;[active1.fields["fingerprint"]]&nbsp;</A></td></tr>
<tr><td>Physical Status:</td><td>&nbsp;[active1.fields["p_stat"]]&nbsp;</td></tr>
<tr><td>Mental Status:</td><td>&nbsp;[active1.fields["m_stat"]]&nbsp;</td></tr>
<tr><td>General Records:</td><td><A href='?src=[REF(src)];choice=View Past General'>View&nbsp;</A></td></tr>
</table></td>
<td><table><td align = center><a href='?src=[REF(src)];choice=Edit Field;field=show_photo_front'><img src=photo_front height=80 width=80 border=4></a><br>
<a href='?src=[REF(src)];choice=Edit Field;field=print_photo_front'>Print photo</a><br>
<a href='?src=[REF(src)];choice=Edit Field;field=upd_photo_front'>Update front photo</a></td>
<td align = center><a href='?src=[REF(src)];choice=Edit Field;field=show_photo_side'><img src=photo_side height=80 width=80 border=4></a><br>
<a href='?src=[REF(src)];choice=Edit Field;field=print_photo_side'>Print photo</a><br>
<a href='?src=[REF(src)];choice=Edit Field;field=upd_photo_side'>Update side photo</a></td></table>
</td></tr></table></td></tr></table>"}
</td></tr></table></td></tr></table>"} //NSV13 - TEXT AMENDED, "GENERAL RECORDS" - Roleplaying Records
else
dat += "<br>General Record Lost!<br>"
if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2)))
dat += "<font size='4'><b>Security Data</b></font>"
dat += "<br>Security Records: <A href='?src=[REF(src)];choice=View Past Security'>View</A>" //NSV13 - Roleplaying Records
dat += "<br>Criminal Status: <A href='?src=[REF(src)];choice=Edit Field;field=criminal'>[active2.fields["criminal"]]</A>"
dat += "<br><br>Citations: <A href='?src=[REF(src)];choice=Edit Field;field=citation_add'>Add New</A>"

Expand Down Expand Up @@ -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 = "<h5>Security Records:</h5>"
temp += "<ul>"
temp += "<li>[active2.fields["past_records"]]</li>"
temp += "</ul>"

if("View Past General")
if(istype(active1, /datum/data/record))
temp = "<h5>General Records:</h5>"
temp += "<ul>"
temp += "<li>[active1.fields["past_records"]]</li>"
temp += "</ul>"
//NSV13 - Roleplaying Records - End
// SORTING!
if("Sorting")
// Reverse the order if clicked twice
Expand Down Expand Up @@ -557,11 +574,19 @@ What a mess.*/
final_paper_text += text("Name: [] ID: []<BR>\nGender: []<BR>\nAge: []<BR>", active1.fields["name"], active1.fields["id"], active1.fields["gender"], active1.fields["age"])
final_paper_text += "\nSpecies: [active1.fields["species"]]<BR>"
final_paper_text += text("\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", 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 += "<B>General Record Lost!</B><BR>"
if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2)))
final_paper_text += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []", active2.fields["criminal"])

//NSV13 - Roleplaying Records - Start
final_paper_text += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\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 += "<BR>\n<BR>\nCrimes:<BR>\n"
final_paper_text +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
Expand Down
132 changes: 116 additions & 16 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/shop_name = "[CONFIG_GET(string/metacurrency_name)] Shop"
dat += "<a href='?_src_=prefs;preference=tab;tab=2' [current_tab == 2 ? "class='linkOn'" : ""]>[shop_name]</a>"
dat += "<a href='?_src_=prefs;preference=tab;tab=3' [current_tab == 3 ? "class='linkOn'" : ""]>OOC Preferences</a>"
dat += "<a href='?_src_=prefs;preference=tab;tab=4' [current_tab == 4 ? "class='linkOn'" : ""]>Roleplay Settings</a>" //NSV13 - Roleplay Tab

dat += "</center>"

Expand Down Expand Up @@ -191,18 +192,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>Body Model:</b><a href='?_src_=prefs;preference=body_model'>[active_character.features["body_model"] == MALE ? "Masculine" : "Feminine"]</a><BR>"
dat += "<b>Age:</b> <a href='?_src_=prefs;preference=age;task=input'>[active_character.age]</a><BR>"

//NSV13 FLAVOR TEXT RELATED START
dat += "<a href='?_src_=prefs;preference=flavor_text;task=input'><b>Set Flavor Text</b></a>"
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)]...<br>"

dat += "<br><b>Special Names:</b><BR>"
//NSV13 FLAVOR TEXT RELATED END
dat += "<b>Special Names:</b><BR>"
var/old_group
for(var/custom_name_id in GLOB.preferences_custom_names)
var/namedata = GLOB.preferences_custom_names[custom_name_id]
Expand Down Expand Up @@ -900,6 +890,95 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "</td>"
dat += "</tr></table>"

if(4) //NSV13 - Roleplay Tab - Start
dat += "<center>"
var/name
var/unspaced_slots = 0
for(var/datum/character_save/CS as anything in character_saves)
unspaced_slots++
if(unspaced_slots > 4)
dat += "<br>"
unspaced_slots = 0
name = CS.real_name
if(!name)
name = "Character [CS.slot_number]"
if(CS.slot_locked)
dat += "<a style='white-space:nowrap;' class='linkOff'>[name] (Locked)</a> "
else
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[CS.slot_number];' [CS.slot_number == default_slot ? "class='linkOn'" : ""]>[name]</a> "
dat += "</center>"

dat += "<h2>Flavor Text</h2>"
dat += "<table width='100%'><tr><td width='75%' valign='top'>"

dat += "<a href='?_src_=prefs;preference=flavor_text;task=input'><b>Set Flavor Text</b></a><br>"
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)]...<br>"

dat += "<br>"

dat += "<a href='?_src_=prefs;preference=silicon_flavor_text;task=input'><b>Set Silicon Examine Text</b></a><br>"
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)]...<br>"

dat += "</tr></table>"

dat += "<table width='100%'><tr>"
dat += "<td width='33%'>"

dat += "<h2>General Record</h2>"
dat += "<a href='?_src_=prefs;preference=general_record;task=input'><b>Set General Record</b></a><br>"

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 += "<br>"


dat += "<h2>Medical Record</h2>"
dat += "<a href='?_src_=prefs;preference=medical_record;task=input'><b>Set Medical Record</b></a><br>"

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 += "<br>"


dat += "<h2>Security Record</h2>"
dat += "<a href='?_src_=prefs;preference=security_record;task=input'><b>Set Security Record</b></a><br>"

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 += "<br>"
dat += "</td>"
dat += "</tr></table>"
//NSV13 - Roleplay Tab - End
dat += "<hr><center>"

if(!IS_GUEST_KEY(user.key))
Expand Down Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 126ea59

Please sign in to comment.