From 927b9d0622ee141eacddb4abdbcb0eb01eccf7db Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Wed, 5 Feb 2020 23:50:41 -0700 Subject: [PATCH] Revert "Merge pull request #10883 from ancientpower/ghost-newscasters" This reverts commit 3c5a3cb4d4c284381b1c8aab0587022658fe37b7, reversing changes made to 109b15ebdde758cab20b849fa6c23dbe433530ab. --- code/__DEFINES/interaction_flags.dm | 2 - code/game/atoms.dm | 1 - code/game/machinery/_machinery.dm | 2 +- code/game/machinery/newscaster.dm | 97 ++-------------------- code/game/turfs/turf.dm | 4 +- code/modules/library/lib_items.dm | 16 +--- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/mob_helpers.dm | 12 --- 8 files changed, 13 insertions(+), 123 deletions(-) diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm index 6df5bf77fb..dc3242c910 100644 --- a/code/__DEFINES/interaction_flags.dm +++ b/code/__DEFINES/interaction_flags.dm @@ -20,5 +20,3 @@ #define INTERACT_MACHINE_SET_MACHINE (1<<6) //MACHINES HAVE THIS BY DEFAULT, SOMEONE SHOULD RUN THROUGH MACHINES AND REMOVE IT FROM THINGS LIKE LIGHT SWITCHES WHEN POSSIBLE!!-------------------------- //This flag determines if a machine set_machine's the user when the user uses it, making updateUsrDialog make the user re-call interact() on it. //THIS FLAG IS ON ALL MACHINES BY DEFAULT, NEEDS TO BE RE-EVALUATED LATER!! - -#define INTERACT_GHOST_READ (1<<0) \ No newline at end of file diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 7e224080b9..83117bad64 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -6,7 +6,6 @@ var/flags_1 = NONE var/interaction_flags_atom = NONE - var/ghost_flags = NONE var/datum/reagents/reagents = null //This atom's HUD (med/sec, etc) images. Associative list. diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 44739fcbc0..a0666b3133 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -242,7 +242,7 @@ Class Procs: else if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON) return FALSE - if(!Adjacent(user) && !isobserver(user)) + if(!Adjacent(user)) var/mob/living/carbon/H = user if(!(istype(H) && H.has_dna() && H.dna.check_mutation(TK))) return FALSE diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 7097de1f3b..a9b4461085 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -189,7 +189,6 @@ GLOBAL_LIST_EMPTY(allCasters) armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30) max_integrity = 200 integrity_failure = 50 - ghost_flags = INTERACT_GHOST_READ var/screen = 0 var/paper_remaining = 15 var/securityCaster = 0 @@ -197,7 +196,6 @@ GLOBAL_LIST_EMPTY(allCasters) var/alert_delay = 500 var/alert = FALSE var/scanned_user = "Unknown" - var/mob/active_user = null var/msg = "" var/datum/picture/picture var/channel_name = "" @@ -266,10 +264,10 @@ GLOBAL_LIST_EMPTY(allCasters) /obj/machinery/newscaster/ui_interact(mob/user) . = ..() - if(ishuman(user) || issilicon(user) || isobserver(user)) - var/mob/M = user + if(ishuman(user) || issilicon(user)) + var/mob/living/human_or_robot_user = user var/dat - scan_user(M) + scan_user(human_or_robot_user) switch(screen) if(0) dat += "Welcome to Newscasting Unit #[unit_no].
Interface & News networks Operational." @@ -281,7 +279,7 @@ GLOBAL_LIST_EMPTY(allCasters) dat+= "
Submit new Feed story" dat+= "
Print newspaper" dat+= "
Re-scan User" - dat+= "

Exit" + dat+= "

Exit" if(securityCaster) var/wanted_already = 0 if(GLOB.news_network.wanted_issue.active) @@ -503,36 +501,24 @@ GLOBAL_LIST_EMPTY(allCasters) if(21) dat+="Unable to print newspaper. Insufficient paper. Please notify maintenance personnel to refill machine storage.

" dat+="Return" - var/datum/browser/popup = new(M, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600) + var/datum/browser/popup = new(human_or_robot_user, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600) popup.set_content(dat) - popup.set_title_image(M.browse_rsc_icon(icon, icon_state)) + popup.set_title_image(human_or_robot_user.browse_rsc_icon(icon, icon_state)) popup.open() /obj/machinery/newscaster/Topic(href, href_list) if(..()) return - if(active_user && !isobserver(active_user) && get_dist(active_user,src)<=1 && usr!=active_user) - to_chat(usr, "You must wait for [active_user] to finish and move away.") - return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || issilicon(usr) || isobserver(usr)) + if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || issilicon(usr)) usr.set_machine(src) scan_user(usr) if(href_list["set_channel_name"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"set a channel's name")) - to_chat(usr, "You can't do that.") - return channel_name = stripped_input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "", MAX_NAME_LEN) updateUsrDialog() else if(href_list["set_channel_lock"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"locked a channel")) - to_chat(usr, "You can't do that.") - return c_locked = !c_locked updateUsrDialog() else if(href_list["submit_new_channel"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"created a new channel")) - to_chat(usr, "You can't do that.") - return var/list/existing_authors = list() for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.authorCensor) @@ -555,9 +541,6 @@ GLOBAL_LIST_EMPTY(allCasters) screen=5 updateUsrDialog() else if(href_list["set_channel_receiving"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the receiving channel")) - to_chat(usr, "You can't do that.") - return var/list/available_channels = list() for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) @@ -565,23 +548,14 @@ GLOBAL_LIST_EMPTY(allCasters) channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels updateUsrDialog() else if(href_list["set_new_message"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"set the message of a new feed story")) - to_chat(usr, "You can't do that.") - return var/temp_message = trim(stripped_multiline_input(usr, "Write your Feed story", "Network Channel Handler", msg)) if(temp_message) msg = temp_message updateUsrDialog() else if(href_list["set_attachment"]) - if(isobserver(usr)) - to_chat(usr, "You can't do that.") - return AttachPhoto(usr) updateUsrDialog() else if(href_list["submit_new_message"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"added a new story")) - to_chat(usr, "You can't do that.") - return if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "" ) screen=6 else @@ -591,27 +565,15 @@ GLOBAL_LIST_EMPTY(allCasters) msg = "" updateUsrDialog() else if(href_list["create_channel"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"created a channel")) - to_chat(usr, "You can't do that.") - return screen=2 updateUsrDialog() else if(href_list["create_feed_story"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"created a feed story")) - to_chat(usr, "You can't do that.") - return screen=3 updateUsrDialog() else if(href_list["menu_paper"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"")) - to_chat(usr, "You can't do that.") - return screen=8 updateUsrDialog() else if(href_list["print_paper"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"printed a paper")) - to_chat(usr, "You can't do that.") - return if(!paper_remaining) screen=21 else @@ -619,21 +581,12 @@ GLOBAL_LIST_EMPTY(allCasters) screen = 20 updateUsrDialog() else if(href_list["menu_censor_story"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"censored a story")) - to_chat(usr, "You can't do that.") - return screen=10 updateUsrDialog() else if(href_list["menu_censor_channel"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"censored a channel")) - to_chat(usr, "You can't do that.") - return screen=11 updateUsrDialog() else if(href_list["menu_wanted"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"")) - to_chat(usr, "You can't do that.") - return var/already_wanted = 0 if(GLOB.news_network.wanted_issue.active) already_wanted = 1 @@ -643,21 +596,12 @@ GLOBAL_LIST_EMPTY(allCasters) screen = 14 updateUsrDialog() else if(href_list["set_wanted_name"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the name of a wanted person")) - to_chat(usr, "You can't do that.") - return channel_name = stripped_input(usr, "Provide the name of the Wanted person", "Network Security Handler") updateUsrDialog() else if(href_list["set_wanted_desc"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the description of a wanted person")) - to_chat(usr, "You can't do that.") - return msg = stripped_input(usr, "Provide a description of the Wanted person and any other details you deem important", "Network Security Handler") updateUsrDialog() else if(href_list["submit_wanted"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"submitted a wanted poster")) - to_chat(usr, "You can't do that.") - return var/input_param = text2num(href_list["submit_wanted"]) if(msg == "" || channel_name == "" || scanned_user == "Unknown") screen = 16 @@ -688,9 +632,6 @@ GLOBAL_LIST_EMPTY(allCasters) screen=18 updateUsrDialog() else if(href_list["censor_channel_author"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor an author")) - to_chat(usr, "You can't do that.") - return var/datum/newscaster/feed_channel/FC = locate(href_list["censor_channel_author"]) if(FC.is_admin_channel) alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok") @@ -698,9 +639,6 @@ GLOBAL_LIST_EMPTY(allCasters) FC.toggleCensorAuthor() updateUsrDialog() else if(href_list["censor_channel_story_author"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story's author")) - to_chat(usr, "You can't do that.") - return var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_author"]) if(MSG.is_admin_message) alert("This message was created by a Nanotrasen Officer. You cannot censor its author.","Ok") @@ -708,9 +646,6 @@ GLOBAL_LIST_EMPTY(allCasters) MSG.toggleCensorAuthor() updateUsrDialog() else if(href_list["censor_channel_story_body"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story")) - to_chat(usr, "You can't do that.") - return var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_body"]) if(MSG.is_admin_message) alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok") @@ -718,17 +653,11 @@ GLOBAL_LIST_EMPTY(allCasters) MSG.toggleCensorBody() updateUsrDialog() else if(href_list["pick_d_notice"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"")) - to_chat(usr, "You can't do that.") - return var/datum/newscaster/feed_channel/FC = locate(href_list["pick_d_notice"]) viewing_channel = FC screen=13 updateUsrDialog() else if(href_list["toggle_d_notice"]) - if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set a D-notice")) - to_chat(usr, "You can't do that.") - return var/datum/newscaster/feed_channel/FC = locate(href_list["toggle_d_notice"]) if(FC.is_admin_channel) alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok") @@ -876,12 +805,6 @@ GLOBAL_LIST_EMPTY(allCasters) picture = selection /obj/machinery/newscaster/proc/scan_user(mob/living/user) - if(active_user) - if(active_user != user) - if(get_dist(active_user,src)<=1) - if(!isobserver(active_user)) - to_chat(user, "Wait for [active_user] to finish and move away.") - return if(ishuman(user)) var/mob/living/carbon/human/human_user = user if(human_user.wear_id) @@ -901,14 +824,9 @@ GLOBAL_LIST_EMPTY(allCasters) else if(issilicon(user)) var/mob/living/silicon/ai_user = user scanned_user = "[ai_user.name] ([ai_user.job])" - else if (IsAdminGhost(user)) - scanned_user = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" - else if (isobserver(user)) - scanned_user = "Space-Time Anomaly #[rand(0,9)][rand(0,9)][rand(0,9)]" else throw EXCEPTION("Invalid user for this proc") return - active_user = user /obj/machinery/newscaster/proc/print_paper() SSblackbox.record_feedback("amount", "newspapers_printed", 1) @@ -941,6 +859,7 @@ GLOBAL_LIST_EMPTY(allCasters) say("Attention! Wanted issue distributed!") playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, 1) + /obj/item/newspaper name = "newspaper" desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations." diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 688e03def3..d8434f986c 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -362,10 +362,8 @@ . = ..() if(.) return - if(!user || !istype(user, /mob/living)) - return FALSE if(length(src_object.contents())) - to_chat(user, "You start dumping out the contents...") + to_chat(usr, "You start dumping out the contents...") if(!do_after(usr,20,target=src_object.parent)) return FALSE diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index f128a76da2..5ff1cbceb1 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -129,14 +129,6 @@ choice.forceMove(drop_location()) update_icon() -/obj/structure/bookcase/attack_ghost(mob/dead/observer/user as mob) - if(contents.len && in_range(user, src)) - var/obj/item/book/choice = input("Which book would you like to read?") as null|obj in contents - if(choice) - if(!istype(choice)) //spellbook, cult tome, or the one weird bible storage - to_chat(user,"A mysterious force is keeping you from reading that.") - return - choice.attack_self(user) /obj/structure/bookcase/deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood(loc, 4) @@ -212,9 +204,8 @@ return if(dat) user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]") - if(istype(user, /mob/living)) - user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.") - SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd) + user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.") + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd) onclose(user, "book") else to_chat(user, "This book is completely blank!") @@ -320,9 +311,6 @@ else ..() -/obj/item/book/attack_ghost(mob/user) - attack_self(user) - /* * Barcode Scanner diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3559edc0fb..439fe491cc 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -796,7 +796,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp update_icon() /mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE) - return IsAdminGhost(usr) || (M.ghost_flags & INTERACT_GHOST_READ) + return IsAdminGhost(usr) /mob/dead/observer/is_literate() return 1 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d78d23c234..393adb68d2 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -402,18 +402,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return return TRUE -/proc/canGhostWrite(var/mob/A, var/obj/target, var/desc="", var/allow_all=FALSE) - if(allow_all & TRUE) - if(!target.GetComponent(/datum/component/anti_magic)) - return 1 - if(IsAdminGhost(A)) - if (desc != "") - log_admin("GHOST: [key_name(A)] [desc] ([target.name] at [loc_name(target)])") - else - log_admin("GHOST: [key_name(A)] fucked with the [target.name] at [loc_name(target)]") - return 1 - return 0 - /proc/offer_control(mob/M) to_chat(M, "Control of your mob has been offered to dead players.") if(usr)