/* Library Items * * Contains: * Bookcase * Book * Barcode Scanner */ /* * Bookcase */ /obj/structure/bookcase name = "bookcase" icon = 'icons/obj/library.dmi' icon_state = "book-0" anchored = 1 density = 1 opacity = 1 autoignition_temperature = AUTOIGNITION_WOOD fire_fuel = 10 var/health = 50 var/tmp/busy = 0 var/list/valid_types = list(/obj/item/weapon/book, \ /obj/item/weapon/tome_legacy, \ /obj/item/weapon/spellbook, \ /obj/item/weapon/storage/bible) /obj/structure/bookcase/cultify() return /obj/structure/bookcase/initialize() for(var/obj/item/I in loc) if(is_type_in_list(I, valid_types)) I.forceMove(src) update_icon() /obj/structure/bookcase/proc/healthcheck() if(health <= 0) visible_message("\The [src] breaks apart!") getFromPool(/obj/item/stack/sheet/wood, get_turf(src), 3) 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(src, 'sound/items/Crowbar.ogg', 75, 1) user.visible_message("[user] starts disassembling \the [src].", \ "You start disassembling \the [src].") busy = 1 if(do_after(user, src, 50)) playsound(src, 'sound/items/Deconstruct.ogg', 75, 1) user.visible_message("[user] disassembles \the [src].", \ "You disassemble \the [src].") busy = 0 getFromPool(/obj/item/stack/sheet/wood, get_turf(src), 5) qdel(src) return else busy = 0 return else if(iswrench(O)) anchored = !anchored playsound(src, 'sound/items/Ratchet.ogg', 50, 1) user.visible_message("[user] [anchored ? "":"un"]anchors \the [src] [anchored ? "to":"from"] the floor.", \ "You [anchored ? "":"un"]anchor the [src] [anchored ? "to":"from"] the floor.") else if(istype(O, /obj/item/weapon/pen)) set_tiny_label(user) else if(O.damtype == BRUTE || O.damtype == BURN) user.delayNextAttack(10) //We are attacking the bookshelf health -= O.force user.visible_message("\The [user] hits \the [src] with \the [O].", \ "You hit \the [src] with \the [O].") healthcheck() else return ..() //Weapon checks for weapons without brute or burn damage type and grab check //AAHHHHHHHHH HARDMAPPING /obj/structure/bookcase/set_labeled() name = initial(name) ..() /obj/structure/bookcase/attack_hand(var/mob/user as mob) if(contents.len) var/obj/item/weapon/book/choice = input("Which book would you like to remove from \the [src]?") as null|obj in contents if(choice) if(user.incapacitated() || user.lying || get_dist(user, src) > 1) return if(!user.get_active_hand()) user.put_in_hands(choice) else 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) for(var/obj/item/I in contents) qdel(I) qdel(src) return if(2.0) for(var/obj/item/I in contents) if(prob(50)) qdel(I) qdel(src) return if(3.0) if(prob(50)) qdel(src) return return /obj/structure/bookcase/Destroy() for(var/obj/item/I in contents) if(is_type_in_list(I, valid_types)) I.forceMove(get_turf(src)) ..() /obj/structure/bookcase/update_icon() if(contents.len < 5) icon_state = "book-[contents.len]" else icon_state = "book-5" /obj/structure/bookcase/manuals/medical name = "Medical Manuals bookcase" New() ..() new /obj/item/weapon/book/manual/medical_cloning(src) update_icon() /obj/structure/bookcase/manuals/engineering name = "Engineering Manuals bookcase" New() ..() new /obj/item/weapon/book/manual/engineering_construction(src) new /obj/item/weapon/book/manual/engineering_particle_accelerator(src) new /obj/item/weapon/book/manual/engineering_hacking(src) new /obj/item/weapon/book/manual/engineering_guide(src) new /obj/item/weapon/book/manual/engineering_singularity_safety(src) new /obj/item/weapon/book/manual/robotics_cyborgs(src) update_icon() /obj/structure/bookcase/manuals/research_and_development name = "R&D Manuals bookcase" New() ..() new /obj/item/weapon/book/manual/research_and_development(src) update_icon() /* * Book */ /obj/item/weapon/book name = "book" icon = 'icons/obj/library.dmi' icon_state ="book" inhand_states = list("left_hand" = 'icons/mob/in-hand/left/books.dmi', "right_hand" = 'icons/mob/in-hand/right/books.dmi') item_state = "book" throw_speed = 1 throw_range = 5 w_class = W_CLASS_MEDIUM //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever) flags = FPRINT attack_verb = list("bashes", "whacks", "educates") autoignition_temperature = AUTOIGNITION_PAPER fire_fuel = 3 var/dat // Actual page content var/due_date = 0 // Game time in 1/10th seconds var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned var/unique = 0 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified var/title // The real name of the book. var/carved = 0 // Has the book been hollowed out for use as a secret storage item? var/wiki_page // Title of the book's wiki page. var/forbidden = 0 // Prevent ordering of this book. (0=no, 1=yes, 2=emag only) var/obj/item/store // What's in the book? var/runestun = 0 //Does it have a stun talisman in it? /obj/item/weapon/book/New() ..() if(wiki_page) dat = {"
"} /obj/item/weapon/book/cultify() new /obj/item/weapon/tome_legacy(loc) ..() /obj/item/weapon/book/proc/read_a_motherfucking_book(mob/user) if(carved) to_chat(user, "The pages of [title] have been cut out!") return if(src.dat) user << browse("Penned by [author].