mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
[SEMI-MODULAR] Re-implements complete records functionality, my old records on examine PR, implements a exploitables menu, and more! (#9081)
* initial fix (IT DONT WORK AND PROBABLY BREAKS EVERYTHING) * shit's fucking broken. see dev-discuss * bleh * reverts the last commit (i think im new to this) * haha whoops * initial * FIXED IT OH GOD * hopefully removes all references to alt titles * fuck * it would be funny if i stopped fucking it up * migration, initial * STREAMLINED EVERYTHING AAAAAAAAA * organizes da text boxes * adds a few things i changed in the last rendition * edit formating,,,, * i did a oopsie * Update code/datums/datacore.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> * fhuujawduj * hahaha... yes! YES! * FIXES. EVERYTHING * fomratting * Update modular_skyrat/modules/records_on_examine/code/modules/mob/verbs/view_exploitables.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> * refactors how it works and tidies up code * rogue comment * fixed a potential bug * modularize * readme * i did a FUCKY WUCKY. * merges the suggestion (but with another tiny change) * makes it just a little more obvious * return * erronous comment Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
co-authored by
GoldenAlpharex
parent
3e6ee8ec60
commit
174486a653
@@ -1,2 +1,3 @@
|
||||
GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest)
|
||||
GLOBAL_DATUM(changelog_tgui, /datum/changelog)
|
||||
GLOBAL_DATUM(record_manifest_tgui, /datum/record_manifest) //SKYRAT EDIT ADDITION -- EXPLOITABLE VERB
|
||||
|
||||
@@ -257,6 +257,16 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
||||
G.fields["gender"] = "Other"
|
||||
G.fields["photo_front"] = photo_front
|
||||
G.fields["photo_side"] = photo_side
|
||||
// SKYRAT ADDITION START - RP RECORDS
|
||||
if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/general))
|
||||
G.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/general)
|
||||
else
|
||||
G.fields["past_records"] = ""
|
||||
if (C && C.prefs && C.prefs.read_preference(/datum/preference/text/exploitable))
|
||||
G.fields["exploitable_records"] = C.prefs.read_preference(/datum/preference/text/exploitable)
|
||||
else
|
||||
G.fields["exploitable_records"] = ""
|
||||
// SKYRAT ADDITION END
|
||||
general += G
|
||||
|
||||
//Medical Record
|
||||
@@ -273,6 +283,12 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
||||
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
M.fields["notes"] = H.get_quirk_string(!medical, CAT_QUIRK_NOTES)
|
||||
M.fields["notes_d"] = H.get_quirk_string(medical, CAT_QUIRK_NOTES)
|
||||
// SKYRAT EDIT ADD - RP RECORDS
|
||||
if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/medical))
|
||||
M.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/medical)
|
||||
else
|
||||
M.fields["past_records"] = ""
|
||||
// SKYRAT EDIT END
|
||||
medical += M
|
||||
|
||||
//Security Record
|
||||
@@ -283,6 +299,12 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
||||
S.fields["citation"] = list()
|
||||
S.fields["crim"] = list()
|
||||
S.fields["notes"] = "No notes."
|
||||
// SKYRAT EDIT ADD - RP RECORDS
|
||||
if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/security))
|
||||
S.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/security)
|
||||
else
|
||||
S.fields["past_records"] = ""
|
||||
// SKYRAT EDIT END
|
||||
security += S
|
||||
|
||||
//Locked Record
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
var/list/active_addictions
|
||||
///List of objective-specific equipment that couldn't properly be given to the mind
|
||||
var/list/failed_special_equipment
|
||||
// SKYRAT EDIT ADDITION -- EXPLOITABLE MENU
|
||||
///Tracks if the target has the view_exploitables_verb verb. THIS MUST BE CHANGED IF THE VERB IS ADDED OR REMOVED OR ELSE STUFF BREAKS.
|
||||
var/has_exploitable_menu = FALSE
|
||||
|
||||
/datum/mind/New(_key)
|
||||
key = _key
|
||||
@@ -274,6 +277,7 @@
|
||||
last_death = world.time
|
||||
|
||||
// Datum antag mind procs
|
||||
|
||||
/datum/mind/proc/add_antag_datum(datum_type_or_instance, team)
|
||||
if(!datum_type_or_instance)
|
||||
return
|
||||
@@ -309,6 +313,8 @@
|
||||
if(my_ambitions.submitted)
|
||||
A.ambitions_add()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
//SKYRAT EDIT ADDITION - EXPLOITABLES MENU
|
||||
src.handle_exploitables_menu()
|
||||
return A
|
||||
|
||||
/datum/mind/proc/remove_antag_datum(datum_type)
|
||||
@@ -321,6 +327,9 @@
|
||||
if(A.uses_ambitions && my_ambitions.submitted)
|
||||
A.ambitions_removal()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
//SKYRAT EDIT ADDITION - EXPLOITABLE MENU
|
||||
src.handle_exploitables_menu()
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -328,6 +337,11 @@
|
||||
for(var/a in antag_datums)
|
||||
var/datum/antagonist/A = a
|
||||
A.on_removal()
|
||||
//SKYRAT EDIT ADDITION BEGIN - EXPLOITABLE MENU
|
||||
if (has_exploitable_menu)
|
||||
remove_verb(current, /mob/proc/view_exploitables_verb)
|
||||
has_exploitable_menu = FALSE
|
||||
//SKYRAT EDIT ADDITION END
|
||||
|
||||
/datum/mind/proc/has_antag_datum(datum_type, check_subtypes = TRUE)
|
||||
if(!datum_type)
|
||||
|
||||
@@ -301,7 +301,6 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
|
||||
|
||||
//ADMIN TOOLS
|
||||
|
||||
//Called when using admin tools to give antag status
|
||||
/datum/antagonist/proc/admin_add(datum/mind/new_owner,mob/admin)
|
||||
message_admins("[key_name_admin(admin)] made [key_name_admin(new_owner)] into [name].")
|
||||
@@ -318,8 +317,8 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
if(uses_ambitions && owner.my_ambitions.submitted)
|
||||
ambitions_removal()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
on_removal()
|
||||
|
||||
//SKYRAT EDIT CHANGE -- ORIGINALLY CALLED on_removal()
|
||||
owner.remove_antag_datum(src)
|
||||
//gamemode/proc/is_mode_antag(antagonist/A) => TRUE/FALSE
|
||||
|
||||
/**
|
||||
|
||||
@@ -424,13 +424,17 @@
|
||||
. += "<a href='?src=[REF(src)];hud=m;p_stat=1'>\[[health_r]\]</a>"
|
||||
health_r = R.fields["m_stat"]
|
||||
. += "<a href='?src=[REF(src)];hud=m;m_stat=1'>\[[health_r]\]</a>"
|
||||
R = find_record("name", perpname, GLOB.data_core.medical)
|
||||
if(R)
|
||||
var/datum/data/record/M = find_record("name", perpname, GLOB.data_core.medical) //SKYRAT EDIT CHANGE - EXAMINE RECORDS - VAR WAS ORIGINALLY R
|
||||
if(M)
|
||||
. += "<a href='?src=[REF(src)];hud=m;evaluation=1'>\[Medical evaluation\]</a><br>"
|
||||
. += "<a href='?src=[REF(src)];hud=m;quirk=1'>\[See quirks\]</a>"
|
||||
//SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
|
||||
. += "<a href='?src=[REF(src)];hud=m;medrecords=1'>\[View medical records\]</a>"
|
||||
. += "<a href='?src=[REF(src)];hud=m;genrecords=1'>\[View general records\]</a>"
|
||||
var/medical_records_empty = (length(M.fields["past_records"]) < 2)
|
||||
if (!(medical_records_empty))
|
||||
. += "<a href='?src=[REF(src)];hud=m;medrecords=1'>\[View medical records\]</a>"
|
||||
var/general_records_empty = (length(R.fields["past_records"]) < 2)
|
||||
if (!(general_records_empty))
|
||||
. += "<a href='?src=[REF(src)];hud=m;genrecords=1'>\[View general records\]</a>"
|
||||
//SKYRAT EDIT END
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_SECURITY_HUD))
|
||||
@@ -438,18 +442,24 @@
|
||||
//|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at.
|
||||
var/criminal = "None"
|
||||
|
||||
R = find_record("name", perpname, GLOB.data_core.security)
|
||||
if(R)
|
||||
criminal = R.fields["criminal"]
|
||||
var/datum/data/record/S = find_record("name", perpname, GLOB.data_core.security) //SKYRAT EDIT CHANGE - EXAMINE RECORDS - VAR WAS ORIGINALLY R
|
||||
if(S)
|
||||
criminal = S.fields["criminal"]
|
||||
|
||||
. += "<span class='deptradio'>Criminal status:</span> <a href='?src=[REF(src)];hud=s;status=1'>\[[criminal]\]</a>"
|
||||
. += jointext(list("<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;viewsec=1'>\[View security records\]</a>", //SKYRAT EDIT CHANGE - EXAMINE RECORDS (changed viewsec)
|
||||
. += jointext(list("<span class='deptradio'>Misc. security record:</span> <a href='?src=[REF(src)];hud=s;view=1'>\[View security records\]</a>", //SKYRAT EDIT CHANGE - EXAMINE RECORDS - Security record > Misc. security record
|
||||
"<a href='?src=[REF(src)];hud=s;add_citation=1'>\[Add citation\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_crime=1'>\[Add crime\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;view_comment=1'>\[View comment log\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_comment=1'>\[Add comment\]</a>"), "")
|
||||
|
||||
. += jointext(list("<span class='deptradio'>General record:</span> <a href='?src=[REF(src)];hud=s;genrecords=1'>\[View general records\]</a>"), "") //SKYRAT EDIT ADDITION - EXAMINE RECORDS
|
||||
// SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
|
||||
var/general_records_empty = (length(R.fields["past_records"]) < 2)
|
||||
if (!(general_records_empty))
|
||||
. += jointext(list("<span class='deptradio'>General record:</span> <a href='?src=[REF(src)];hud=s;genrecords=1'>\[View general records\]</a>"), "")
|
||||
var/security_records_empty = (length(S.fields["past_records"]) < 2)
|
||||
if (!(security_records_empty))
|
||||
. += jointext(list("<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;secrecords=1'>\[View security records\]</a>"), "")
|
||||
// SKYRAT EDIT ADDITION END
|
||||
else if(isobserver(user))
|
||||
. += "<span class='info'><b>Traits:</b> [get_quirk_string(FALSE, CAT_QUIRK_ALL)]</span>"
|
||||
//SKYRAT EDIT ADDITION BEGIN - GUNPOINT
|
||||
@@ -484,6 +494,15 @@
|
||||
//. += "*---------*</span>" SKYRAT EDIT REMOVAL
|
||||
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
|
||||
|
||||
//SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
|
||||
var/datum/data/record/is_in_world = find_record("name", perpname, GLOB.data_core.general) //apparantly golden is okay with offstation roles having no records, FYI
|
||||
var/exploitables_empty = (length(is_in_world.fields["exploitable_records"]) < 2)
|
||||
for(var/datum/antagonist/antag_datum in user?.mind?.antag_datums)
|
||||
if ((is_special_character(user)) && is_in_world && (antag_datum.view_exploitables) && !exploitables_empty)
|
||||
. += "<a href='?src=[REF(src)];exprecords=1'>\[View exploitable info\]</a>"
|
||||
break
|
||||
//SKYRAT EDIT 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!
|
||||
var/list/dat = list()
|
||||
if(!pronoun_replacement)
|
||||
|
||||
@@ -209,8 +209,8 @@
|
||||
to_chat(usr, "<span class='notice ml-1'>Detected physiological traits:</span>\n<span class='notice ml-2'>[quirkstring]</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice ml-1'>No physiological traits found.</span>")
|
||||
if(href_list["medrecords"])
|
||||
//SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
|
||||
if(href_list["medrecords"])
|
||||
to_chat(usr, "<b>Medical Record:</b> [med_record.fields["past_records"]]")
|
||||
if(href_list["genrecords"])
|
||||
to_chat(usr, "<b>General Record:</b> [general_record.fields["past_records"]]")
|
||||
@@ -260,7 +260,7 @@
|
||||
sec_hud_set_security_status()
|
||||
return
|
||||
|
||||
if(href_list["viewsec"]) //SKYRAT EDIT CHANGE - EXAMINE RECORDS
|
||||
if(href_list["view"])
|
||||
if(!H.canUseHUD())
|
||||
return
|
||||
if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD))
|
||||
@@ -275,7 +275,6 @@
|
||||
to_chat(usr, "Added by [c.author] at [c.time]")
|
||||
to_chat(usr, "----------")
|
||||
to_chat(usr, "<b>Notes:</b> [sec_record.fields["notes"]]") //SKYRAT EDIT CHANGE - EXAMINE RECORDS
|
||||
to_chat(usr, "<b>Security Record:</b> [sec_record.fields["past_records"]]") //SKYRAT EDIT ADDITION - EXAMINE RECORDS
|
||||
return
|
||||
|
||||
//SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
|
||||
@@ -285,6 +284,13 @@
|
||||
if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
to_chat(usr, "<b>General Record:</b> [general_record.fields["past_records"]]")
|
||||
|
||||
if(href_list["secrecords"])
|
||||
if(!H.canUseHUD())
|
||||
return
|
||||
if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
to_chat(usr, "<b>Security Record:</b> [sec_record.fields["past_records"]]")
|
||||
//SKYRAT EDIT END
|
||||
|
||||
if(href_list["add_citation"])
|
||||
@@ -379,9 +385,9 @@
|
||||
//SKYRAT EDIT ADDITION BEGIN - VIEW RECORDS
|
||||
if (is_special_character(usr))
|
||||
var/perpname = get_face_name(get_id_name(""))
|
||||
var/datum/data/record/EXP = find_record("name", perpname, GLOB.data_core.locked)
|
||||
var/datum/data/record/EXP = find_record("name", perpname, GLOB.data_core.general)
|
||||
if(href_list["exprecords"])
|
||||
to_chat(usr, "<b>Exploitable information:</b> [EXP.fields["exp_records"]]")
|
||||
to_chat(usr, "<b>Exploitable information:</b> [EXP.fields["exploitable_records"]]")
|
||||
//SKYRAT EDIT END
|
||||
|
||||
..() //end of this massive fucking chain. TODO: make the hud chain not spooky. - Yeah, great job doing that.
|
||||
|
||||
@@ -28,3 +28,18 @@
|
||||
|
||||
/datum/antagonist/traitor
|
||||
view_exploitables = TRUE
|
||||
|
||||
/datum/antagonist/pirate
|
||||
view_exploitables = TRUE //pirates are flexible antags, not strictly bound by their objective. i could see this working
|
||||
|
||||
/datum/antagonist/rev/head
|
||||
view_exploitables = TRUE //heads only. while all revs having exploitables would be fine, i feel this would complement the "leaders leading the masses" stuff rev naturally makes
|
||||
|
||||
/*/datum/antagonist/cortical_borer //come back to borer when its not as new
|
||||
view_exploitables = TRUE */
|
||||
|
||||
/datum/antagonist/cult //cult is adminbus only... im not sure about this but im doing it anyway
|
||||
view_exploitables = TRUE
|
||||
|
||||
/*/datum/antagonist/abductor //maybe?
|
||||
view_exploitables = TRUE */
|
||||
|
||||
@@ -38,3 +38,46 @@
|
||||
|
||||
/datum/preference/text/custom_species_lore/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
target.dna.features["custom_species_lore"] = value
|
||||
|
||||
// SKYRAT EDIT ADDITION BEGIN -- RP RECORDS REJUVINATION
|
||||
/datum/preference/text/general
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
savefile_identifier = PREFERENCE_CHARACTER
|
||||
savefile_key = "general_record"
|
||||
|
||||
/datum/preference/text/general/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
/datum/preference/text/medical
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
savefile_identifier = PREFERENCE_CHARACTER
|
||||
savefile_key = "medical_record"
|
||||
|
||||
/datum/preference/text/medical/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
/datum/preference/text/security
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
savefile_identifier = PREFERENCE_CHARACTER
|
||||
savefile_key = "security_record"
|
||||
|
||||
/datum/preference/text/security/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
/datum/preference/text/exploitable
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
savefile_identifier = PREFERENCE_CHARACTER
|
||||
savefile_key = "exploitable_info"
|
||||
|
||||
/datum/preference/text/exploitable/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
/datum/preference/text/background
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
savefile_identifier = PREFERENCE_CHARACTER
|
||||
savefile_key = "background_info"
|
||||
|
||||
/datum/preference/text/background/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
// SKYRAT EDIT END
|
||||
|
||||
@@ -24,11 +24,13 @@
|
||||
READ_FILE(S["mismatched_customization"], mismatched_customization)
|
||||
READ_FILE(S["allow_advanced_colors"], allow_advanced_colors)
|
||||
|
||||
READ_FILE(S["general_record"], general_record)
|
||||
//SKYRAT EDIT REMOVAL BEGIN -- RECORDS REJUVINATION
|
||||
/* READ_FILE(S["general_record"], general_record)
|
||||
READ_FILE(S["security_record"], security_record)
|
||||
READ_FILE(S["medical_record"], medical_record)
|
||||
READ_FILE(S["background_info"], background_info)
|
||||
READ_FILE(S["exploitable_info"], exploitable_info)
|
||||
READ_FILE(S["exploitable_info"], exploitable_info) */
|
||||
//SKYRAT EDIT REMOVAL END
|
||||
|
||||
READ_FILE(S["alt_job_titles"], alt_job_titles)
|
||||
|
||||
@@ -68,11 +70,13 @@
|
||||
WRITE_FILE(S["mismatched_customization"], mismatched_customization)
|
||||
WRITE_FILE(S["allow_advanced_colors"], allow_advanced_colors)
|
||||
|
||||
WRITE_FILE(S["general_record"] , general_record)
|
||||
//SKYRAT EDIT REMOVAL BEGIN -- RECORDS REJUVINATION
|
||||
/* WRITE_FILE(S["general_record"] , general_record)
|
||||
WRITE_FILE(S["security_record"] , security_record)
|
||||
WRITE_FILE(S["medical_record"] , medical_record)
|
||||
WRITE_FILE(S["background_info"] , background_info)
|
||||
WRITE_FILE(S["exploitable_info"] , exploitable_info)
|
||||
WRITE_FILE(S["exploitable_info"] , exploitable_info) */
|
||||
//SKYRAT EDIT REMOVAL END
|
||||
WRITE_FILE(S["alt_job_titles"], alt_job_titles)
|
||||
WRITE_FILE(S["languages"] , languages)
|
||||
WRITE_FILE(S["tgui_prefs_migration"] , tgui_prefs_migration)
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
dat += "<b>Antagonists are supposed to provide excitement and intrigue, drive a story with the crew, and provide fun and interesting experience for people involved. <BR> Remember, it's not about winning or losing, but about the story and interactions, this is a roleplay server.</b><BR><BR>"
|
||||
dat += "<i>Here you write your ambitions for your antagonist round! Ambitions are your motive and what you plan to accomplish throught the round.</i>"
|
||||
dat += "<BR><i>After filling all things out and submitting your ambition, your uplink/powers will unlock.</i>"
|
||||
//SKYRAT EDIT ADDITION -- RECORDS MENU
|
||||
dat += "<BR><i>For your narrative, you could try thinking about your character's current conflicts, use the View Crew Exploitables verb in the OOC tab, or many other things.</i>"
|
||||
dat += "<BR><i>If you can't come up with anything, use a <b>template</b>, and if you don't know if your ambition are proper, or too extreme, <b>request admin review</b>.</i>"
|
||||
dat += "<BR><i>You can still edit them post submission.</i>"
|
||||
dat += "<BR><b><font color='#FF0000'>If your ambitions are nonsensical, you may be subjected to an antagonist ban.</font></b>"
|
||||
@@ -84,7 +86,8 @@
|
||||
dat += "<BR><b><font color='#ffd500'>[last_requested_change]</font></b>"
|
||||
dat += "<BR><a href='?src=[REF(src)];pref=requested_done'>Notify admin that you've done them!</a></b>"
|
||||
dat += "<h3>Narrative:</h3>"
|
||||
dat += "<i>Here you set your narrative. It's the reason on why you're doing antagonistic things. Perhaps you need money for personal reasons, or you were contracted to do someone's dirty work, or want to take down the BigPharma.</i>"
|
||||
//SKYRAT EDIT -- RECORDS MENU
|
||||
dat += "<i>Here you set your narrative. It's the reason on why you're doing antagonistic things. Perhaps you need money for personal reasons, or you were contracted to do someone's dirty work, or want to take down the BigPharma? And if you're stumped, you can always view the exploitables of your fellow crew via the <b>View Crew Exploitables</b> verb in the OOC tab!</i>"
|
||||
dat += "<BR><table align='center'; width='100%'; style='background-color:#13171C'><tr><td><center>"
|
||||
if(narrative == "")
|
||||
dat += "<font color='#CCCCFF'><b>Please set your narrative!</b></font>"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/datum/mind/proc/handle_exploitables_menu()
|
||||
//Only returns true if no datums are present in the mind. Without this, the for loop would end prematurely, as it would be null.
|
||||
if (!antag_datums)
|
||||
if (has_exploitable_menu)
|
||||
remove_verb(current, /mob/proc/view_exploitables_verb)
|
||||
has_exploitable_menu = FALSE
|
||||
return
|
||||
var/should_see_exploitables = FALSE
|
||||
for(var/datum/antagonist/antag_datum in src?.antag_datums)
|
||||
// Players are allowed to view exploitables if they have at least one antag_datum datum with view_exploitables set to TRUE.
|
||||
if (antag_datum.view_exploitables)
|
||||
should_see_exploitables = TRUE
|
||||
break
|
||||
if(!has_exploitable_menu && should_see_exploitables)
|
||||
add_verb(current, /mob/proc/view_exploitables_verb)
|
||||
has_exploitable_menu = TRUE
|
||||
to_chat(current, span_danger("You now have access to the View-Crew-Exploitables verb, which shows all crew who currently have exploitable info and a link to view it!"))
|
||||
|
||||
else if(has_exploitable_menu && !should_see_exploitables)
|
||||
remove_verb(current, /mob/proc/view_exploitables_verb)
|
||||
has_exploitable_menu = FALSE
|
||||
@@ -0,0 +1,87 @@
|
||||
/datum/record_manifest
|
||||
|
||||
/datum/datacore/proc/get_exploitable_manifest()
|
||||
var/list/exp_manifest_out = list()
|
||||
for(var/datum/job_department/department as anything in SSjob.joinable_departments)
|
||||
exp_manifest_out[department.department_name] = list()
|
||||
exp_manifest_out[DEPARTMENT_UNASSIGNED] = list()
|
||||
|
||||
var/list/departments_by_type = SSjob.joinable_departments_by_type
|
||||
for(var/datum/data/record/general_record in GLOB.data_core.general)
|
||||
var/exploitables = general_record.fields["exploitable_records"]
|
||||
var/exploitables_empty = (length(general_record.fields["exploitable_records"]) < 2)
|
||||
if (exploitables_empty)
|
||||
continue
|
||||
var/name = general_record.fields["name"]
|
||||
var/rank = general_record.fields["rank"]
|
||||
// var/truerank = general_record.fields["truerank"]
|
||||
var/datum/job/job = SSjob.GetJob(rank)
|
||||
if(!job || !(job.job_flags & JOB_CREW_MANIFEST) || !LAZYLEN(job.departments_list) && (!exploitables_empty)) // In case an unlawful custom rank is added.
|
||||
var/list/exp_misc_list = exp_manifest_out[DEPARTMENT_UNASSIGNED]
|
||||
exp_misc_list[++exp_misc_list.len] = list(
|
||||
"name" = name,
|
||||
"rank" = rank,
|
||||
// "truerank" = truerank,
|
||||
"exploitable_records" = exploitables,
|
||||
)
|
||||
continue
|
||||
for(var/department_type as anything in job.departments_list)
|
||||
var/datum/job_department/department = departments_by_type[department_type]
|
||||
if(!department)
|
||||
stack_trace("get_exploitable_manifest() failed to get job department for [department_type] of [job.type]")
|
||||
continue
|
||||
var/list/exp_entry = list(
|
||||
"name" = name,
|
||||
"rank" = rank,
|
||||
// "truerank" = truerank,
|
||||
"exploitable_records" = exploitables,
|
||||
)
|
||||
var/list/exp_department_list = exp_manifest_out[department.department_name]
|
||||
if(istype(job, department.department_head))
|
||||
exp_department_list.Insert(1, null)
|
||||
exp_department_list[1] = exp_entry
|
||||
else
|
||||
exp_department_list[++exp_department_list.len] = exp_entry
|
||||
|
||||
// Trim the empty categories.
|
||||
for (var/department in exp_manifest_out)
|
||||
if(!length(exp_manifest_out[department]))
|
||||
exp_manifest_out -= department
|
||||
|
||||
return exp_manifest_out
|
||||
|
||||
/datum/record_manifest/ui_state(mob/user)
|
||||
return GLOB.always_state
|
||||
|
||||
/datum/record_manifest/ui_status(mob/user, datum/ui_state/state)
|
||||
return (is_special_character(user)) ? UI_INTERACTIVE : UI_CLOSE
|
||||
|
||||
/datum/record_manifest/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if (!ui)
|
||||
ui = new(user, src, "RecordManifest")
|
||||
ui.open()
|
||||
|
||||
/datum/record_manifest/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(action == "show_exploitables")
|
||||
var/exploitable_id = params["exploitable_id"]
|
||||
var/datum/data/record/exploitable_record = find_record("name", exploitable_id, GLOB.data_core.general)
|
||||
to_chat(usr, "<b>Exploitable information:</b> [exploitable_record.fields["exploitable_records"]]")
|
||||
|
||||
/datum/record_manifest/ui_data(mob/user)
|
||||
var/list/positions = list()
|
||||
for(var/datum/job_department/department as anything in SSjob.joinable_departments)
|
||||
var/list/exceptions = list()
|
||||
for(var/datum/job/job as anything in department.department_jobs)
|
||||
if(job.total_positions == -1)
|
||||
exceptions += job.title
|
||||
continue
|
||||
positions[department.department_name] = list("exceptions" = exceptions)
|
||||
|
||||
return list(
|
||||
"manifest" = GLOB.data_core.get_exploitable_manifest(),
|
||||
"positions" = positions
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
/mob/proc/view_exploitables_verb()
|
||||
set name = "View Crew Exploitables"
|
||||
set category = "OOC"
|
||||
|
||||
if(world.time < client.crew_manifest_delay)
|
||||
return
|
||||
client.crew_manifest_delay = world.time + (1 SECONDS)
|
||||
|
||||
if(is_special_character(src))
|
||||
for(var/datum/antagonist/antag_datum in src?.mind?.antag_datums)
|
||||
if(!(antag_datum.view_exploitables) || !(is_special_character(src)))
|
||||
continue
|
||||
if (antag_datum.view_exploitables)
|
||||
|
||||
if(!GLOB.record_manifest_tgui)
|
||||
GLOB.record_manifest_tgui = new /datum/record_manifest(src)
|
||||
|
||||
GLOB.record_manifest_tgui.ui_interact(src)
|
||||
break
|
||||
else
|
||||
to_chat(src, span_danger("You're not an antagonist that can view exploitables! This message should not appear!"))
|
||||
return
|
||||
@@ -1,23 +1,18 @@
|
||||
https://github.com/Skyrat-SS13/Skyrat-tg/pull/7859
|
||||
https://github.com/Skyrat-SS13/Skyrat-tg/pull/9081
|
||||
|
||||
## Title: Enables sec/med huds to view records on examine, as well as antagonists being able to view exploitables.
|
||||
## Title: Re-implements complete records functionality, my old records on examine PR, implements a exploitables menu.
|
||||
|
||||
MODULE ID: records_on_examine
|
||||
|
||||
### Description:
|
||||
|
||||
This PR allows med/sec huds to view medical/security records on examine, respectively, as well as allowing you to view general records. It
|
||||
also allows certain antags to view exploitables on examine as well.
|
||||
|
||||
Originally I planned to add a PDA program to allow all crew to view general
|
||||
records, and a OOC verb to allow antags to view exploitables of the entire crew, as well as a way for background info to be seen, however
|
||||
I am not that good at coding and chickened out.
|
||||
also allows certain antags to view exploitables on examine as well. It also fully restores what functionality records had prior to the pref rework. Basically,
|
||||
my last 2 prs in one. It also refactors how record saves are handled, and how admin antag removals work.
|
||||
|
||||
### TG Proc/File Changes:
|
||||
|
||||
EDIT: examine.dm, human.dm, datacore.dm. Modified the behavior of examining things while wearing HUDs, and the behavior of examining as
|
||||
certain antagonists in examine.dm. Added a few variables that store records to human.dm, added the functionality to the new links
|
||||
acquired by examining. Added a field for exploitables in the locked record section of datacore.dm.
|
||||
EDIT: examine.dm, human.dm, datacore.dm, flavor_text.dm, species_features.tx, tgui.dm, preferences_savefile.dm, antag_datum.dm, mind.dm. Allowed links to appear in chat when viewing people with huds/as certain antags, allows clikcing them to paste the records of the other party into chat. Re-implements the storing and handling of records into datacore, adds UI for that in flavor_text and species_features. Modified TGUI to recognize the exploitable manifest. Changed preferences_savefile.dm to comment out the way we used to save and load records, it's handled in flavor_text.dm now. Adds and removes the exploitables verb now, by changing mind.dm and antag_datum.dm.
|
||||
|
||||
### Defines:
|
||||
|
||||
@@ -29,8 +24,8 @@ acquired by examining. Added a field for exploitables in the locked record secti
|
||||
|
||||
### Included files that are not contained in this module:
|
||||
|
||||
- N/A
|
||||
- RecordManifest.js
|
||||
|
||||
### Credits:
|
||||
|
||||
Niko#7526, and #development_discuss for giving me the help I needed
|
||||
Niko#7526, MrMelbert for giving me much needed advice and code examples, and #development_discuss for helping me
|
||||
|
||||
@@ -4945,6 +4945,9 @@
|
||||
#include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\forge_weapons.dm"
|
||||
#include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\reagent_component.dm"
|
||||
#include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\water_basin.dm"
|
||||
#include "modular_skyrat\modules\records_on_examine\code\datums\mind.dm"
|
||||
#include "modular_skyrat\modules\records_on_examine\code\modules\mob\living\record_manifest.dm"
|
||||
#include "modular_skyrat\modules\records_on_examine\code\modules\mob\verbs\view_exploitables.dm"
|
||||
#include "modular_skyrat\modules\roboclothes\code\clothing\robotics_clothing.dm"
|
||||
#include "modular_skyrat\modules\roboclothes\code\vending\wardrobes.dm"
|
||||
#include "modular_skyrat\modules\rod-stopper\code\immovable_skyrat.dm"
|
||||
|
||||
+30
@@ -43,7 +43,37 @@ export const custom_species_lore: Feature<string> = {
|
||||
description: "Add some lore for your species! Won't show up if there's no custom species.",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
// SKYRAT EDIT ADDITION BEGIN -- RECORDS REJUVINATION
|
||||
export const general_record: Feature<string> = {
|
||||
name: "Records - General",
|
||||
description: "Your general records! These are records that are for general viewing-things like employment, qualifications, etc. By default, anyone with a HUD/records access can view these.",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
|
||||
export const security_record: Feature<string> = {
|
||||
name: "Records - Security",
|
||||
description: "Your security records! These are records for criminal records, arrest history, things like that. Sec officers can view these.",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
|
||||
export const medical_record: Feature<string> = {
|
||||
name: "Records - Medical",
|
||||
description: "Your medical records! These are records for things like medical history, prescriptions, DNR orders, etc. Medical staff can view these.",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
|
||||
export const exploitable_info: Feature<string> = {
|
||||
name: "Records - Exploitable",
|
||||
description: "This section is for information antagonists can use, IN CHARACTER AND OUT. If you are willing to be disrupted by antagonists MORE than the average player (this is usually a very fun experience, if you're into that kind of roleplay), put it here! Also for things antagonists can use against your character.",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
|
||||
export const background_info: Feature<string> = {
|
||||
name: "Records - Background",
|
||||
description: "nobody uses this lmao",
|
||||
component: FeatureTextInput,
|
||||
};
|
||||
// SKYRAT EDIT END
|
||||
export const allow_mismatched_parts_toggle: FeatureToggle = {
|
||||
name: "Allow Mismatched Parts",
|
||||
description: "Want to go completely crazy with your character design? Use this to select any parts from any species!",
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
import { classes } from 'common/react';
|
||||
import { useBackend } from "../backend";
|
||||
import { Icon, Section, Table, Tooltip, Button } from "../components";
|
||||
import { Window } from "../layouts";
|
||||
|
||||
const commandJobs = [
|
||||
"Head of Personnel",
|
||||
"Head of Security",
|
||||
"Chief Engineer",
|
||||
"Research Director",
|
||||
"Chief Medical Officer",
|
||||
];
|
||||
|
||||
export const RecordManifest = (props, context) => {
|
||||
const { data: { manifest, positions } } = useBackend(context);
|
||||
const { act } = useBackend(context);
|
||||
|
||||
return (
|
||||
<Window title="All crew with exploitables" width={450} height={500}>
|
||||
<Window.Content scrollable>
|
||||
{Object.entries(manifest).map(([dept, crew]) => (
|
||||
<Section
|
||||
className={"CrewManifest--" + dept}
|
||||
key={dept}
|
||||
title={dept}
|
||||
>
|
||||
<Table>
|
||||
{Object.entries(crew).map(([crewIndex, crewMember]) => (
|
||||
<Table.Row key={crewIndex}>
|
||||
<Table.Cell className={"CrewManifest__Cell"}>
|
||||
{crewMember.name}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
<Button
|
||||
content="Show exploitables"
|
||||
onClick={() => act("show_exploitables", {
|
||||
exploitable_id: crewMember.name,
|
||||
})} />
|
||||
</Table.Cell>
|
||||
<Table.Cell
|
||||
className={classes([
|
||||
"CrewManifest__Cell",
|
||||
"CrewManifest__Icons",
|
||||
])}
|
||||
collapsing
|
||||
>
|
||||
{positions[dept].exceptions.includes(crewMember.rank) && (
|
||||
|
||||
<Tooltip
|
||||
content="No position limit"
|
||||
position="bottom"
|
||||
>
|
||||
<Icon className="CrewManifest__Icon" name="infinity" />
|
||||
</Tooltip>
|
||||
)}
|
||||
{crewMember.rank === "Captain" && (
|
||||
<Tooltip
|
||||
content="Captain"
|
||||
position="bottom"
|
||||
>
|
||||
<Icon
|
||||
className={classes([
|
||||
"CrewManifest__Icon",
|
||||
"CrewManifest__Icon--Command",
|
||||
])}
|
||||
name="star"
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
{commandJobs.includes(crewMember.rank) && (
|
||||
<Tooltip
|
||||
content="Member of command"
|
||||
position="bottom"
|
||||
>
|
||||
<Icon
|
||||
className={classes([
|
||||
"CrewManifest__Icon",
|
||||
"CrewManifest__Icon--Command",
|
||||
"CrewManifest__Icon--Chevron",
|
||||
])}
|
||||
name="chevron-up"
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Table.Cell>
|
||||
<Table.Cell
|
||||
className={classes([
|
||||
"CrewManifest__Cell",
|
||||
"CrewManifest__Cell--Rank",
|
||||
])}
|
||||
collapsing
|
||||
>
|
||||
{crewMember.rank}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table>
|
||||
</Section>
|
||||
))}
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user