Adds the ability to construct, destroy, and take apart bookcases.

Bookcases can be built using 5 wood planks.
Bookcases can be destroyed using weapons(50HP).
Bookcases can be taken apart using a wrench.
This commit is contained in:
VelardAmakar
2014-04-05 09:19:11 -04:00
committed by ZomgPonies
parent a947775f2e
commit dc6f794368
2 changed files with 27 additions and 1 deletions
+25
View File
@@ -18,6 +18,7 @@
anchored = 1
density = 1
opacity = 1
var/health = 50
/obj/structure/bookcase/initialize()
for(var/obj/item/I in loc)
@@ -30,6 +31,18 @@
user.drop_item()
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/wrench))
user << "\blue Now disassembling bookcase"
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user,50))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
density = 0
qdel(src)
return
else if(istype(O, /obj/item/weapon/pen))
var/newname = stripped_input(usr, "What would you like to title this bookshelf?")
if(!newname)
@@ -37,6 +50,18 @@
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("<span class=warning>The bookcase is smashed apart!</span>")
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
qdel(src)
..()
/obj/structure/bookcase/attack_hand(var/mob/user as mob)