/* 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 var/health = 50 autoignition_temperature = AUTOIGNITION_WOOD fire_fuel = 10 /obj/structure/bookcase/cultify() return /obj/structure/bookcase/initialize() for(var/obj/item/I in loc) if(istype(I, /obj/item/weapon/book)) I.loc = src update_icon() /obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob) if(istype(O, /obj/item/weapon/book)) user.drop_item(O, src) update_icon() else if(istype(O, /obj/item/weapon/tome)) user.drop_item(O, src) update_icon() else if(istype(O, /obj/item/weapon/spellbook)) user.drop_item(O, src) update_icon() else if(istype(O, /obj/item/weapon/storage/bible)) user.drop_item(O, src) update_icon() else if(istype(O, /obj/item/weapon/screwdriver)) user << "Now disassembling [src]" playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, src,50)) getFromPool(/obj/item/stack/sheet/wood, get_turf(src), 5) density = 0 qdel(src) return else if(istype(O, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) user << (anchored ? "You unfasten the [src] from the floor." : "You secure the [src] to the floor.") anchored = !anchored else if(istype(O, /obj/item/weapon/pen)) var/newname = stripped_input(usr, "What would you like to title this bookshelf?") if(!newname) return else name = ("bookcase ([sanitize(newname)])") else switch(O.damtype) if("fire") src.health -= O.force * 1 if("brute") src.health -= O.force * 0.75 else if (src.health <= 0) visible_message("The bookcase is smashed apart!") getFromPool(/obj/item/stack/sheet/wood, get_turf(src), 3) qdel(src) ..() /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 shelf?") as null|obj in contents if(choice) if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) return if(ishuman(user)) if(!user.get_active_hand()) user.put_in_hands(choice) else choice.loc = get_turf(src) update_icon() /obj/structure/bookcase/ex_act(severity) switch(severity) if(1.0) for(var/obj/item/weapon/book/b in contents) qdel(b) qdel(src) return if(2.0) for(var/obj/item/weapon/book/b in contents) if (prob(50)) b.loc = (get_turf(src)) else qdel(b) qdel(src) return if(3.0) if (prob(50)) for(var/obj/item/weapon/book/b in contents) b.loc = (get_turf(src)) qdel(src) return else return /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" throw_speed = 1 throw_range = 5 w_class = 3 //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever) flags = FPRINT attack_verb = list("bashed", "whacked", "educated") 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? /obj/item/weapon/book/New() ..() if(wiki_page) dat = {"
"} /obj/item/weapon/book/cultify() new /obj/item/weapon/tome(loc) ..() /obj/item/weapon/book/attack_self(var/mob/user as mob) if(carved) if(store) user << "[store] falls out of [title]!" store.loc = get_turf(src.loc) store = null return else user << "The pages of [title] have been cut out!" return if(src.dat) user << browse("Penned by [author].