From 39a6aac2dee68b72905f9ad219ab199f9ebdceef Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 22 Jul 2018 13:26:35 +0300 Subject: [PATCH] Journalism, vol 2. Freedom Unbecoming. (#4999) Implements this: https://forums.aurorastation.org/viewtopic.php?f=21&t=11375&start=10#p101753 Basically: journalists get immunity from D-notices, corporate reports get extended access. Also added a mechanism to add alt title based access more easily. --- code/controllers/subsystems/job.dm | 2 +- code/game/jobs/job/civilian.dm | 1 + code/game/jobs/job/job.dm | 10 +++++++--- code/game/machinery/newscaster.dm | 18 +++++++++--------- .../file_system/programs/command/card.dm | 2 +- html/changelogs/skull132-journalism.yml | 5 +++++ 6 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 html/changelogs/skull132-journalism.yml diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index c7c045efef1..53ca9b93fb1 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -584,7 +584,7 @@ return else C = new job.idtype(H) - C.access = job.get_access() + C.access = job.get_access(title) else C = new /obj/item/weapon/card/id(H) if(C) diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index d5a62e7a409..f6a5df35260 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -228,6 +228,7 @@ access = list(access_journalist, access_maint_tunnels) minimal_access = list(access_journalist, access_maint_tunnels) alt_titles = list("Freelance Journalist") + title_accesses = list("Corporate Reporter" = list(access_medical, access_security, access_research, access_engine)) /datum/job/journalist/equip(var/mob/living/carbon/human/H, var/alt_title) if(!H) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index fedd28f14da..81c6098239d 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -15,6 +15,7 @@ var/selection_color = "#ffffff" // Selection screen color var/idtype = /obj/item/weapon/card/id // The type of the ID the player will have var/list/alt_titles // List of alternate titles, if any + var/list/title_accesses // A map of title -> list of accesses to add if the person has this title. var/req_admin_notify // If this is set to 1, a text is printed to the player when jobs are assigned, telling him that he should let admins know that he has to disconnect. var/minimal_player_age = 0 // If you have use_age_restriction_for_jobs config option enabled and the database set up, this option will add a requirement for players to be at least minimal_player_age days old. (meaning they first signed in at least that many days before.) var/department = null // Does this position have a department tag? @@ -105,11 +106,14 @@ /datum/job/proc/equip_preview(mob/living/carbon/human/H, var/alt_title) . = equip(H, alt_title) -/datum/job/proc/get_access() +/datum/job/proc/get_access(selected_title) if(!config || config.jobs_have_minimal_access) - return src.minimal_access.Copy() + . = minimal_access.Copy() else - return src.access.Copy() + . = access.Copy() + + if (LAZYLEN(title_accesses) && title_accesses[selected_title]) + . += title_accesses[selected_title] /datum/job/proc/apply_fingerprints(var/mob/living/carbon/human/target) if(!istype(target)) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index cfd6fe2f883..7c3de6a7647 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -459,11 +459,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["set_attachment"]) AttachPhoto(usr) src.updateUsrDialog() - + else if(href_list["set_paper"]) AttachPaper(usr) src.updateUsrDialog() - + else if(href_list["submit_new_message"]) if(src.msg =="" || src.msg=="\[REDACTED\]" || src.scanned_user == "Unknown" || src.channel_name == "" ) src.screen=6 @@ -477,7 +477,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co src.screen=4 src.updateUsrDialog() - + else if(href_list["add_comment"]) var/com_msg = sanitize(input(usr, "Write your Comment", "Network Comment Handler", "") as message, encode = 0, trim = 0, extra = 0) if(com_msg =="" || com_msg=="\[REDACTED\]" || src.scanned_user == "Unknown" ) @@ -493,7 +493,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co to_chat(usr, "Comment successfully added!") src.screen = 22 src.updateUsrDialog() - + else if(href_list["view_comments"]) var/datum/feed_message/viewing_story = locate(href_list["story"]) if(!istype(viewing_story)) @@ -501,7 +501,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co src.screen = href_list["privileged"] ? 23 : 22 src.viewing_message = viewing_story src.updateUsrDialog() - + else if(href_list["censor_comment"]) var/datum/feed_comment/comment = locate(href_list["comment"]) if(!istype(comment)) @@ -509,7 +509,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co comment.message = "\[REDACTED\]" src.screen = 22 src.updateUsrDialog() - + else if(href_list["like"]) var/datum/feed_message/viewing_story = locate(href_list["story"]) if(src.scanned_user == "Unknown" || (src.scanned_user in viewing_story.interacted) || !istype(viewing_story)) @@ -517,7 +517,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co viewing_story.interacted += src.scanned_user viewing_story.likes += 1 src.updateUsrDialog() - + else if(href_list["dislike"]) var/datum/feed_message/viewing_story = locate(href_list["story"]) if(src.scanned_user == "Unknown" || (src.scanned_user in viewing_story.interacted) || !istype(viewing_story)) @@ -525,7 +525,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co viewing_story.interacted += src.scanned_user viewing_story.dislikes += 1 src.updateUsrDialog() - + else if(href_list["create_channel"]) src.screen=2 src.updateUsrDialog() @@ -774,7 +774,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(paper_data || paper_name) paper_name = "" paper_data = "" - + if(istype(user.get_active_hand(), /obj/item/weapon/paper)) var/obj/item/weapon/paper/attached = user.get_active_hand() paper_name = attached.name diff --git a/code/modules/modular_computers/file_system/programs/command/card.dm b/code/modules/modular_computers/file_system/programs/command/card.dm index e52b3844cea..cce45bc08af 100644 --- a/code/modules/modular_computers/file_system/programs/command/card.dm +++ b/code/modules/modular_computers/file_system/programs/command/card.dm @@ -202,7 +202,7 @@ usr << "No log exists for this job: [t1]" return - access = jobdatum.get_access() + access = jobdatum.get_access(t1) remove_nt_access(id_card) apply_access(id_card, access) diff --git a/html/changelogs/skull132-journalism.yml b/html/changelogs/skull132-journalism.yml new file mode 100644 index 00000000000..fc6e446dfdd --- /dev/null +++ b/html/changelogs/skull132-journalism.yml @@ -0,0 +1,5 @@ +author: Skull132 +delete-after: true + +changes: + - rscadd: "Corporate Reports now gain rudimentary department access, so they could better report on corporate affairs."