diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm
index dc3242c910..6df5bf77fb 100644
--- a/code/__DEFINES/interaction_flags.dm
+++ b/code/__DEFINES/interaction_flags.dm
@@ -20,3 +20,5 @@
#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 1f62be8a24..4fbf84f116 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -6,6 +6,7 @@
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 5f44fccdac..58cfa93003 100644
--- a/code/game/machinery/_machinery.dm
+++ b/code/game/machinery/_machinery.dm
@@ -237,7 +237,7 @@ Class Procs:
else
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON)
return FALSE
- if(!Adjacent(user))
+ if(!Adjacent(user) && !isobserver(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 6bf9930eec..5bb997405a 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -189,6 +189,7 @@ 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
@@ -196,6 +197,7 @@ 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 = ""
@@ -264,10 +266,10 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/machinery/newscaster/ui_interact(mob/user)
. = ..()
- if(ishuman(user) || issilicon(user))
- var/mob/living/human_or_robot_user = user
+ if(ishuman(user) || issilicon(user) || isobserver(user))
+ var/mob/M = user
var/dat
- scan_user(human_or_robot_user)
+ scan_user(M)
switch(screen)
if(0)
dat += "Welcome to Newscasting Unit #[unit_no].
Interface & News networks Operational."
@@ -279,7 +281,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)
@@ -501,26 +503,38 @@ 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(human_or_robot_user, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600)
+ var/datum/browser/popup = new(M, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600)
popup.set_content(dat)
- popup.set_title_image(human_or_robot_user.browse_rsc_icon(icon, icon_state))
+ popup.set_title_image(M.browse_rsc_icon(icon, icon_state))
popup.open()
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || issilicon(usr))
+ 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))
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)
while (findtext(channel_name," ") == 1)
channel_name = copytext(channel_name,2,length(channel_name)+1)
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)
@@ -543,6 +557,9 @@ 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)
@@ -550,14 +567,23 @@ 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
@@ -567,15 +593,27 @@ 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
@@ -583,12 +621,21 @@ 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
@@ -598,12 +645,21 @@ 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
@@ -634,6 +690,9 @@ 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")
@@ -641,6 +700,9 @@ 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")
@@ -648,6 +710,9 @@ 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")
@@ -655,11 +720,17 @@ 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")
@@ -807,6 +878,12 @@ 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)
@@ -826,9 +903,14 @@ 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)
@@ -861,7 +943,6 @@ 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 d8434f986c..688e03def3 100755
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -362,8 +362,10 @@
. = ..()
if(.)
return
+ if(!user || !istype(user, /mob/living))
+ return FALSE
if(length(src_object.contents()))
- to_chat(usr, "You start dumping out the contents...")
+ to_chat(user, "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 5ff1cbceb1..f128a76da2 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -129,6 +129,14 @@
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)
@@ -204,8 +212,9 @@
return
if(dat)
user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
- 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)
+ 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)
onclose(user, "book")
else
to_chat(user, "This book is completely blank!")
@@ -311,6 +320,9 @@
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 97007ebd11..401e154913 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -794,7 +794,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)
+ return IsAdminGhost(usr) || (M.ghost_flags & INTERACT_GHOST_READ)
/mob/dead/observer/is_literate()
return 1
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index d78ae0ba8c..583ac75649 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -409,6 +409,18 @@ 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)