From 76982301be89ba9ad7411fe022bc03e92764be4e Mon Sep 17 00:00:00 2001 From: "petethegoat@gmail.com" Date: Sun, 9 Sep 2012 12:01:41 +0000 Subject: [PATCH] Noticeboard updates. Mostly just tidying up, but noticeboards now grab paper on the same tile as them on round start. This is mainly so away missions can have things pinned to noticeboards. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4665 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/structures/noticeboard.dm | 69 +++++++++++---------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index 8afcbf85235..b5d09529584 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -1,31 +1,39 @@ /obj/structure/noticeboard - name = "Notice Board" + name = "notice board" + desc = "A board for pinning important notices upon." icon = 'icons/obj/stationobjs.dmi' icon_state = "nboard00" flags = FPRINT - desc = "A board for pinning important notices upon." density = 0 anchored = 1 var/notices = 0 +/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 (src.notices < 5) + if(istype(O, /obj/item/weapon/paper)) + if(notices < 5) O.add_fingerprint(user) - src.add_fingerprint(user) + add_fingerprint(user) user.drop_item() O.loc = src - src.notices++ - src.icon_state = text("nboard0[]", src.notices) //update sprite - user << "\blue You pin the paper to the noticeboard." + notices++ + icon_state = "nboard0[notices]" //update sprite + user << "You pin the paper to the noticeboard." else - user << "\red 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." + 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." /obj/structure/noticeboard/attack_hand(user as mob) var/dat = "Noticeboard
" for(var/obj/item/weapon/paper/P in src) - dat += text("[] Write Remove
", src, P, P.name, src, P, src, P) + dat += "[P.name] Write Remove
" user << browse("Notices[dat]","window=noticeboard") onclose(user, "noticeboard") @@ -33,43 +41,40 @@ /obj/structure/noticeboard/Topic(href, href_list) ..() usr.machine = src - if (href_list["remove"]) - if ((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open - usr << "\red It's a bit hard to remove the notice when you're restrained like this." + if(href_list["remove"]) + if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open return var/obj/item/P = locate(href_list["remove"]) - if ((P && P.loc == src)) - P.loc = get_turf(src) //dump paper on the floor because you're a clumsy fuck - P.layer = 20 + if((P && P.loc == src)) + P.loc = get_turf(src) //dump paper on the floor because you're a clumsy fuck P.add_fingerprint(usr) - src.add_fingerprint(usr) - src.notices-- - src.icon_state = text("nboard0[]", src.notices) + add_fingerprint(usr) + notices-- + icon_state = "nboard0[notices]" if(href_list["write"]) - if ((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open - usr << "\red It's a bit hard to write when you're restrained like this." + if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open return var/obj/item/P = locate(href_list["write"]) - if((P && P.loc == src)) //if the paper's on the board - if (istype(usr.r_hand, /obj/item/weapon/pen)) //and you're holding a pen - src.add_fingerprint(usr) + if((P && P.loc == src)) //ifthe paper's on the board + if(istype(usr.r_hand, /obj/item/weapon/pen)) //and you're holding a pen + add_fingerprint(usr) P.attackby(usr.r_hand, usr) //then do ittttt else - if (istype(usr.l_hand, /obj/item/weapon/pen)) //check other hand for pen - src.add_fingerprint(usr) + if(istype(usr.l_hand, /obj/item/weapon/pen)) //check other hand for pen + add_fingerprint(usr) P.attackby(usr.l_hand, usr) else - usr << "\red You'll need something to write with!" + usr << "You'll need something to write with!" - if (href_list["read"]) + if(href_list["read"]) var/obj/item/weapon/paper/P = locate(href_list["read"]) - if ((P && P.loc == src)) - if (!( istype(usr, /mob/living/carbon/human) )) - usr << browse(text("[][]", P.name, stars(P.info)), text("window=[]", P.name)) + if((P && P.loc == src)) + if(!( istype(usr, /mob/living/carbon/human) )) + usr << browse("[P.name][stars(P.info)]", "window=[P.name]") onclose(usr, "[P.name]") else - usr << browse(text("[][]", P.name, P.info), text("window=[]", P.name)) + usr << browse("[P.name][P.info]", "window=[P.name]") onclose(usr, "[P.name]") return