boooooooooooks (#21379)

This commit is contained in:
Contrabang
2023-06-21 18:19:18 -04:00
committed by GitHub
parent 33abd1c91d
commit 4268b178c4
+12
View File
@@ -19,6 +19,18 @@
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 0)
var/list/allowed_books = list(/obj/item/book, /obj/item/spellbook, /obj/item/storage/bible, /obj/item/tome) //Things allowed in the bookcase
/obj/structure/bookcase/Initialize(mapload)
. = ..()
if(mapload)
// same reasoning as closets
addtimer(CALLBACK(src, PROC_REF(take_contents)), 0)
/obj/structure/bookcase/proc/take_contents()
for(var/obj/item/I in get_turf(src))
if(is_type_in_list(I, allowed_books))
I.forceMove(src)
update_icon(UPDATE_ICON_STATE)
/obj/structure/bookcase/attackby(obj/item/O, mob/user)
if(is_type_in_list(O, allowed_books))
if(!user.drop_item())