Merge pull request #566 from Erthilo/master

Added Notebook for the Detective
This commit is contained in:
SkyMarshal
2012-02-29 16:59:35 -08:00
5 changed files with 173 additions and 0 deletions

View File

@@ -415,6 +415,7 @@
new /obj/item/weapon/storage/box(BPK)
new /obj/item/weapon/fcardholder(src)
new /obj/item/weapon/clipboard(src)
new /obj/item/weapon/notebook(src)
new /obj/item/device/detective_scanner(src)
new /obj/item/policetaperoll(src)
new /obj/item/weapon/storage/box/evidence(src)

View File

@@ -490,6 +490,19 @@
throw_range = 10
flags = ONBELT
/obj/item/weapon/notebook
name = "notebook"
desc = "Holds paper and pens. Feels very noire."
icon = 'items.dmi'
icon_state = "notebook00"
var/obj/item/weapon/pen/pen = null
item_state = "notebook"
throwforce = 0
w_class = 2.0
throw_speed = 3
throw_range = 10
flags = ONBELT
#define MAXCOIL 30
/obj/item/weapon/cable_coil
name = "cable coil"

View File

@@ -137,6 +137,7 @@
var/obj/item/weapon/storage/box/B = new(BPK)
var/obj/item/weapon/clipboard/C = new(B)
new /obj/item/weapon/pen(C)
new /obj/item/weapon/notebook(src)
new /obj/item/device/detective_scanner(src)
new /obj/item/policetaperoll(src)
new /obj/item/weapon/storage/box/evidence(src)

View File

@@ -7,6 +7,7 @@ GIFTS
BEDSHEET BIN
PHOTOGRAPHS
CLIPBOARDS
NOTEBOOK
*/
@@ -760,3 +761,160 @@ CLIPBOARDS
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
src.add_fingerprint(user)
return
// notebook
/obj/item/weapon/notebook/attack_self(mob/user as mob)
var/dat = "<B>Notebook</B><BR>"
if (src.pen)
dat += text("<A href='?src=\ref[];pen=1'>Remove Pen</A><BR><HR>", src)
for(var/obj/item/weapon/paper/P in src)
dat += text("<A href='?src=\ref[];read=\ref[]'>[]</A> <A href='?src=\ref[];write=\ref[]'>Write</A> <A href='?src=\ref[];remove=\ref[]'>Remove</A><BR>", src, P, P.name, src, P, src, P)
user << browse(dat, "window=notebook")
onclose(user, "notebook")
return
/obj/item/weapon/notebook/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if (usr.contents.Find(src))
usr.machine = src
if (href_list["pen"])
if (src.pen)
if ((usr.hand && !( usr.l_hand )))
usr.l_hand = src.pen
src.pen.loc = usr
src.pen.layer = 20
src.pen = null
usr.update_clothing()
else
if (!( usr.r_hand ))
usr.r_hand = src.pen
src.pen.loc = usr
src.pen.layer = 20
src.pen = null
usr.update_clothing()
if (src.pen)
src.pen.add_fingerprint(usr)
src.add_fingerprint(usr)
if (href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if ((P && P.loc == src))
if ((usr.hand && !( usr.l_hand )))
usr.l_hand = P
P.loc = usr
P.layer = 20
usr.update_clothing()
else
if (!( usr.r_hand ))
usr.r_hand = P
P.loc = usr
P.layer = 20
usr.update_clothing()
P.add_fingerprint(usr)
src.add_fingerprint(usr)
if (href_list["write"])
var/obj/item/P = locate(href_list["write"])
if ((P && P.loc == src))
if (istype(usr.r_hand, /obj/item/weapon/pen))
P.attackby(usr.r_hand, usr)
else
if (istype(usr.l_hand, /obj/item/weapon/pen))
P.attackby(usr.l_hand, usr)
else
if (istype(src.pen, /obj/item/weapon/pen))
P.attackby(src.pen, usr)
src.add_fingerprint(usr)
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("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", P.name, stars(P.info)), text("window=[]", P.name))
onclose(usr, "[P.name]")
else
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", P.name, P.info), text("window=[]", P.name))
onclose(usr, "[P.name]")
if (ismob(src.loc))
var/mob/M = src.loc
if (M.machine == src)
spawn( 0 )
src.attack_self(M)
return
return
/obj/item/weapon/notebook/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/notebook/attack_hand(mob/user as mob)
if ((locate(/obj/item/weapon/paper, src) && (!( user.equipped() ) && (user.l_hand == src || user.r_hand == src))))
var/obj/item/weapon/paper/P
for(P in src)
break
if (P)
if (user.hand)
user.l_hand = P
else
user.r_hand = P
P.loc = user
P.layer = 20
P.add_fingerprint(user)
user.update_clothing()
src.add_fingerprint(user)
else
return ..()
return
/obj/item/weapon/notebook/attackby(obj/item/weapon/P as obj, mob/user as mob)
..()
if (istype(P, /obj/item/weapon/paper))
if (src.contents.len < 15)
user.drop_item()
P.loc = src
else
user << "\blue Not enough space!!!"
else
if (istype(P, /obj/item/weapon/pen))
if (!src.pen)
user.drop_item()
P.loc = src
src.pen = P
else
return
src.update()
return
/obj/item/weapon/notebook/proc/update()
src.icon_state = text("notebook[][]", (locate(/obj/item/weapon/paper, src) ? "1" : "0"), (locate(/obj/item/weapon/pen, src) ? "1" : "0"))
return
/obj/item/weapon/notebook/MouseDrop(obj/over_object as obj) //Quick notebook fix. -Agouri
if (ishuman(usr) || ismonkey(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
var/mob/M = usr
if (!( istype(over_object, /obj/screen) ))
return ..()
if ((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/))
if (over_object.name == "r_hand")
if (!( M.r_hand ))
M.u_equip(src)
M.r_hand = src
else
if (over_object.name == "l_hand")
if (!( M.l_hand ))
M.u_equip(src)
M.l_hand = src
M.update_clothing()
src.add_fingerprint(usr)
return //
/obj/item/weapon/notebook/New()
..()
for(var/i = 1, i <= 3, i++)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.loc = src
src.pen = new /obj/item/weapon/pen(src)
src.update()
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB