mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
boooooooooooks (#21379)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user