From e8482e5d95ec37f98d42708a689763c62539a64a Mon Sep 17 00:00:00 2001 From: 9600bauds Date: Tue, 5 Jan 2016 22:35:28 -0300 Subject: [PATCH] Ghosts can read books --- code/modules/library/lib_items.dm | 42 ++++++++++++++----- .../9600bauds_R-E-A-D-A-B-O-O-KAY.yml | 35 ++++++++++++++++ 2 files changed, 66 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/9600bauds_R-E-A-D-A-B-O-O-KAY.yml diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 49763e9fff0..c854859e706 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -45,12 +45,14 @@ qdel(src) /obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob) - if(busy) //So that you can't mess with it while deconstructing return if(is_type_in_list(O, valid_types)) user.drop_item(O, src) update_icon() + else if(isscrewdriver(O) && user.a_intent == I_HELP) //They're probably trying to open the "maintenance panel" to deconstruct it. Let them know what's wrong. + to_chat(user, "There are no screws on \the [src], it appears to be nailed together. You could probably disassemble it with just a crowbar.") + return else if(iscrowbar(O) && user.a_intent == I_HELP) //Only way to deconstruct, needs help intent playsound(get_turf(src), 'sound/items/Crowbar.ogg', 75, 1) user.visible_message("[user] starts disassembling \the [src].", \ @@ -100,6 +102,15 @@ choice.forceMove(get_turf(src)) update_icon() +/obj/structure/bookcase/attack_ghost(mob/dead/observer/user as mob) + if(contents.len && in_range(user, src)) + var/obj/item/weapon/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.read_a_motherfucking_book(user) + /obj/structure/bookcase/ex_act(severity) switch(severity) if(1.0) @@ -204,23 +215,32 @@ new /obj/item/weapon/tome(loc) ..() -/obj/item/weapon/book/attack_self(var/mob/user as mob) +/obj/item/weapon/book/proc/read_a_motherfucking_book(mob/user) if(carved) - if(store) - to_chat(user, "[store] falls out of [title]!") - store.loc = get_turf(src.loc) - store = null - return - else - to_chat(user, "The pages of [title] have been cut out!") - return + to_chat(user, "The pages of [title] have been cut out!") + return if(src.dat) user << browse("Penned by [author].
" + "[dat]", "window=book") - user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") + if(!isobserver(user)) + user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") onclose(user, "book") else to_chat(user, "This book is completely blank!") +/obj/item/weapon/book/attack_self(var/mob/user as mob) + if(store) + to_chat(user, "[store] falls out of [title]!") + store.forceMove(get_turf(src)) + store = null + return + read_a_motherfucking_book(user) + +/obj/item/weapon/book/examine(mob/user) + if(isobserver(user) && in_range(src,user)) + read_a_motherfucking_book(user) + else + ..() + /obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob) if(carved) if(!store) diff --git a/html/changelogs/9600bauds_R-E-A-D-A-B-O-O-KAY.yml b/html/changelogs/9600bauds_R-E-A-D-A-B-O-O-KAY.yml new file mode 100644 index 00000000000..233275c6359 --- /dev/null +++ b/html/changelogs/9600bauds_R-E-A-D-A-B-O-O-KAY.yml @@ -0,0 +1,35 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscdel (general deleting of nice things) +# rscadd (general adding of nice things) +# imageadd +# imagedel +# spellcheck (typo fixes) +# experiment +# tgs (TG-ported fixes?) +################################# + +# Your name. +author: 9600bauds + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +changes: +- rscadd: Ghosts can now read books by examining them when close enough. Ghosts can now also click a bookcase to read the books that are inside (without removing them from the bookcase). \ No newline at end of file