/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
density = 0
anchored = 1
var/notices = 0
/obj/structure/noticeboard/New(var/loc, var/dir, var/building = 0)
..()
if(building)
if(loc)
src.loc = loc
pixel_x = (dir & 3)? 0 : (dir == 4 ? -32 : 32)
pixel_y = (dir & 3)? (dir ==1 ? -27 : 27) : 0
update_icon()
return
/obj/structure/noticeboard/initialize()
for(var/obj/item/I in loc)
if(notices > 4) break
if(istype(I, /obj/item/weapon/paper))
I.loc = src
notices++
icon_state = "nboard0[notices]"
//attaching papers!!
/obj/structure/noticeboard/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
if(notices < 5)
O.add_fingerprint(user)
add_fingerprint(user)
user.drop_from_inventory(O)
O.loc = src
notices++
icon_state = "nboard0[notices]" //update sprite
user << "You pin the paper to the noticeboard."
else
user << "You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached."
if(istype(O, /obj/item/weapon/wrench))
user << "You start to unwrench the noticeboard."
playsound(src.loc, O.usesound, 50, 1)
if(do_after(user, 15 * O.toolspeed))
user << "You unwrench the noticeboard."
new /obj/item/frame/noticeboard( src.loc )
qdel(src)
return
/obj/structure/noticeboard/attack_hand(var/mob/user)
examine(user)
// Since Topic() never seems to interact with usr on more than a superficial
// level, it should be fine to let anyone mess with the board other than ghosts.
/obj/structure/noticeboard/examine(var/mob/user)
if(!user)
user = usr
if(user.Adjacent(src))
var/dat = "Noticeboard
"
for(var/obj/item/weapon/paper/P in src)
dat += "[P.name] Write Remove
"
user << browse("