diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 09b3ae53cb7..01022658b0b 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -197,6 +197,30 @@ GLOBAL_LIST_INIT(security_depts_prefs, sort_list(list( SEC_DEPT_SUPPLY, ))) +/// Types of Crimes Prisoners will have on their record roundstart. +/// (They also can choose Random, which picks from these options... randomly!) +GLOBAL_LIST_INIT(prisoner_crimes, list( + "Abhorrent Criminal Negligence" = "Incompetently risked numerous lives.", + "Attempted Development of Cloning" = "Attempted illegal research in the cloning sphere. Cloning, cloning construction, and cloning-related R&D was outlawed in 2560.", + "Attempted Murder" = "Attempted to maliciously kill someone.", + "Biological Terrorism" = "Created and or released a lethal biological agent/lifeform.", + "Classified" = "Consult Legal.", + "Corporate Espionage" = "Conducted espionage against Nanotrasen for commercial purposes.", + "Counterfeiting" = "Engaged in widespread fraud.", + "Enemy of the Corporation" = "Acted as, or knowingly aided, an enemy of Nanotrasen.", + "Grand Sabotage" = "Engaged in malicious destructive actions, seriously threatening Nanotrasen employees and or infrastructure.", + "Grand Theft" = "Stole items of high value or sensitive nature.", + "Identity Theft of High-Ranking Figure" = "Impersonated a high-ranking figure.", + "Kidnapping" = "Planned and executed a kidnapping.", + "Medical Malpractice" = "Engaged in organ harvesting, limb theft, or other malicious medical procedures.", + "Murder" = "Maliciously killed someone.", + "Mutiny" = "Attempted to overthrow/subvert Chain of Command.", + "Other" = "Consult Legal.", + "Tampering of Artificial Intelligence" = "Uploaded malicious, negligent, or otherwise blacklisted directives to an Artificial Intelligence.", + "Tax Evasion" = "Outstanding amount of tax evasion.", + "Worship of Blacklisted Deities" = "Practiced worship of blacklisted deities.", +)) + //Backpacks #define DBACKPACK "Department Backpack" #define DDUFFELBAG "Department Duffel Bag" diff --git a/code/modules/client/preferences/prisoner_crime.dm b/code/modules/client/preferences/prisoner_crime.dm new file mode 100644 index 00000000000..420bab28419 --- /dev/null +++ b/code/modules/client/preferences/prisoner_crime.dm @@ -0,0 +1,20 @@ +/// Which crime is the prisoner permabrigged for. For fluff! +/datum/preference/choiced/prisoner_crime + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "prisoner_crime" + +/datum/preference/choiced/prisoner_crime/init_possible_values() + return assoc_to_keys(GLOB.prisoner_crimes) + "Random" + +/datum/preference/choiced/prisoner_crime/apply_to_human(mob/living/carbon/human/target, value) + return + +/datum/preference/choiced/prisoner_crime/create_default_value() + return "Random" + +/datum/preference/choiced/prisoner_crime/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + return istype(preferences.get_highest_priority_job(), /datum/job/prisoner) diff --git a/code/modules/jobs/job_types/prisoner.dm b/code/modules/jobs/job_types/prisoner.dm index b95842df9c8..6131c16b38e 100644 --- a/code/modules/jobs/job_types/prisoner.dm +++ b/code/modules/jobs/job_types/prisoner.dm @@ -25,6 +25,26 @@ rpg_title = "Defeated Miniboss" job_flags = JOB_ANNOUNCE_ARRIVAL | JOB_CREW_MANIFEST | JOB_EQUIP_RANK | JOB_CREW_MEMBER | JOB_NEW_PLAYER_JOINABLE | JOB_ASSIGN_QUIRKS | JOB_CAN_BE_INTERN +/datum/job/prisoner/New() + . = ..() + RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, .proc/add_pref_crime) + +/datum/job/prisoner/proc/add_pref_crime(datum/source, mob/living/crewmember, rank) + SIGNAL_HANDLER + if(rank != title) + return //not a prisoner + + var/crime_name = crewmember.client?.prefs?.read_preference(/datum/preference/choiced/prisoner_crime) + if(!crime_name) + return + if(crime_name == "Random") + crime_name = pick(assoc_to_keys(GLOB.prisoner_crimes)) + var/datum/data/record/target_record = find_record("name", crewmember.real_name, GLOB.data_core.security) + var/crime_desc = GLOB.prisoner_crimes[crime_name] + target_record.fields["criminal"] = "Incarcerated" + var/datum/data/crime/past_crime = GLOB.data_core.createCrimeEntry(crime_name, crime_desc, "Central Command", "Indefinite.") + GLOB.data_core.addCrime(target_record.fields["id"], past_crime) + to_chat(crewmember, span_warning("You are imprisoned for \"[crime_name]\".")) /datum/outfit/job/prisoner name = "Prisoner" diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index eb510f07b7b..7d6bdf173e6 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -415,10 +415,10 @@ var/area/joined_area = get_area(new_character.loc) if(joined_area) joined_area.on_joining_game(new_character) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CREWMEMBER_JOINED, new_character, new_character.mind.assigned_role.title) new_character = null qdel(src) - /mob/dead/new_player/proc/ViewManifest() if(!client) return diff --git a/tgstation.dme b/tgstation.dme index 2623df93532..e3c96cae606 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2715,6 +2715,7 @@ #include "code\modules\client\preferences\pixel_size.dm" #include "code\modules\client\preferences\playtime_reward_cloak.dm" #include "code\modules\client\preferences\preferred_map.dm" +#include "code\modules\client\preferences\prisoner_crime.dm" #include "code\modules\client\preferences\random.dm" #include "code\modules\client\preferences\runechat.dm" #include "code\modules\client\preferences\scaling_method.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prisoner_crime.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prisoner_crime.tsx new file mode 100644 index 00000000000..0da53d21948 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prisoner_crime.tsx @@ -0,0 +1,6 @@ +import { FeatureChoiced, FeatureDropdownInput } from '../base'; + +export const prisoner_crime: FeatureChoiced = { + name: 'Prisoner crime', + component: FeatureDropdownInput, +};