mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
Clean up Syringe and Notebook code.
This commit is contained in:
@@ -420,7 +420,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/weapon/clipboard/notebook(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/policetaperoll(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
|
||||
@@ -578,18 +578,10 @@
|
||||
throw_range = 10
|
||||
flags = ONBELT
|
||||
|
||||
/obj/item/weapon/notebook
|
||||
/obj/item/weapon/clipboard/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
|
||||
|
||||
@@ -166,7 +166,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/weapon/clipboard/notebook(src)
|
||||
new /obj/item/device/detective_scanner(src)
|
||||
new /obj/item/policetaperoll(src)
|
||||
new /obj/item/weapon/storage/box/evidence(src)
|
||||
|
||||
@@ -701,7 +701,7 @@ NOTEBOOK
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
else
|
||||
user << "\blue Not enough space!!!"
|
||||
user << "\blue Not enough space!"
|
||||
else
|
||||
if (istype(P, /obj/item/weapon/pen))
|
||||
if (!src.pen)
|
||||
@@ -714,7 +714,7 @@ NOTEBOOK
|
||||
return
|
||||
|
||||
/obj/item/weapon/clipboard/proc/update()
|
||||
src.icon_state = text("clipboard[][]", (locate(/obj/item/weapon/paper, src) ? "1" : "0"), (locate(/obj/item/weapon/pen, src) ? "1" : "0"))
|
||||
src.icon_state = text("[src.name][][]", (locate(/obj/item/weapon/paper, src) ? "1" : "0"), (locate(/obj/item/weapon/pen, src) ? "1" : "0"))
|
||||
return
|
||||
|
||||
|
||||
@@ -764,160 +764,3 @@ NOTEBOOK
|
||||
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
|
||||
|
||||
@@ -981,95 +981,54 @@
|
||||
if(ishuman(T))
|
||||
if(T:vessel.get_reagent_amount("blood") < amount)
|
||||
return
|
||||
var/datum/reagent/B = new /datum/reagent/blood
|
||||
B.holder = src
|
||||
B.volume = amount
|
||||
//set reagent data
|
||||
B.data["donor"] = T
|
||||
/*
|
||||
if(T.virus && T.virus.spread_type != SPECIAL)
|
||||
B.data["virus"] = new T.virus.type(0)
|
||||
*/
|
||||
|
||||
var/datum/reagent/B = new /datum/reagent/blood
|
||||
B.holder = src
|
||||
B.volume = amount
|
||||
//set reagent data
|
||||
B.data["donor"] = T
|
||||
/*
|
||||
if(T.virus && T.virus.spread_type != SPECIAL)
|
||||
B.data["virus"] = new T.virus.type(0)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
for(var/datum/disease/D in T.viruses)
|
||||
if(!B.data["viruses"])
|
||||
B.data["viruses"] = list()
|
||||
for(var/datum/disease/D in T.viruses)
|
||||
if(!B.data["viruses"])
|
||||
B.data["viruses"] = list()
|
||||
|
||||
|
||||
B.data["viruses"] += new D.type
|
||||
B.data["viruses"] += new D.type
|
||||
|
||||
// not sure why it was checking if(B.data["virus2"]), but it seemed wrong
|
||||
if(T.virus2)
|
||||
B.data["virus2"] = T.virus2.getcopy()
|
||||
// not sure why it was checking if(B.data["virus2"]), but it seemed wrong
|
||||
if(T.virus2)
|
||||
B.data["virus2"] = T.virus2.getcopy()
|
||||
|
||||
B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0)
|
||||
if(T.resistances&&T.resistances.len)
|
||||
B.data["resistances"] = T.resistances.Copy()
|
||||
if(istype(target, /mob/living/carbon/human))//I wish there was some hasproperty operation...
|
||||
B.data["blood_type"] = copytext(T.dna.b_type,1,0)
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in target.reagents.reagent_list)
|
||||
temp_chem += R.name
|
||||
temp_chem[R.name] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
B.data["antibodies"] = T.antibodies
|
||||
//debug
|
||||
//for(var/D in B.data)
|
||||
// world << "Data [D] = [B.data[D]]"
|
||||
//debug
|
||||
B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0)
|
||||
if(T.resistances&&T.resistances.len)
|
||||
B.data["resistances"] = T.resistances.Copy()
|
||||
if(istype(target, /mob/living/carbon/human))//I wish there was some hasproperty operation...
|
||||
B.data["blood_type"] = copytext(T.dna.b_type,1,0)
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in target.reagents.reagent_list)
|
||||
temp_chem += R.name
|
||||
temp_chem[R.name] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
B.data["antibodies"] = T.antibodies
|
||||
//debug
|
||||
//for(var/D in B.data)
|
||||
// world << "Data [D] = [B.data[D]]"
|
||||
//debug
|
||||
if(ishuman(T))
|
||||
T:vessel.remove_reagent("blood",amount) // Removes blood if human
|
||||
|
||||
src.reagents.reagent_list += B
|
||||
src.reagents.update_total()
|
||||
src.on_reagent_change()
|
||||
src.reagents.handle_reactions()
|
||||
// T:vessel.trans_to(src, amount) // Virus2 and antibodies aren't in blood in the first place. Halp.
|
||||
T:vessel.remove_reagent("blood",amount)
|
||||
else
|
||||
var/datum/reagent/B = new /datum/reagent/blood
|
||||
B.holder = src
|
||||
B.volume = amount
|
||||
//set reagent data
|
||||
B.data["donor"] = T
|
||||
/*
|
||||
if(T.virus && T.virus.spread_type != SPECIAL)
|
||||
B.data["virus"] = new T.virus.type(0)
|
||||
*/
|
||||
src.reagents.reagent_list += B
|
||||
src.reagents.update_total()
|
||||
src.on_reagent_change()
|
||||
src.reagents.handle_reactions()
|
||||
// T:vessel.trans_to(src, amount) // Virus2 and antibodies aren't in blood in the first place.
|
||||
|
||||
|
||||
|
||||
for(var/datum/disease/D in T.viruses)
|
||||
if(!B.data["viruses"])
|
||||
B.data["viruses"] = list()
|
||||
|
||||
|
||||
B.data["viruses"] += new D.type
|
||||
|
||||
// not sure why it was checking if(B.data["virus2"]), but it seemed wrong
|
||||
if(T.virus2)
|
||||
B.data["virus2"] = T.virus2.getcopy()
|
||||
|
||||
B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0)
|
||||
if(T.resistances&&T.resistances.len)
|
||||
B.data["resistances"] = T.resistances.Copy()
|
||||
if(istype(target, /mob/living/carbon/human))//I wish there was some hasproperty operation...
|
||||
B.data["blood_type"] = copytext(T.dna.b_type,1,0)
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in target.reagents.reagent_list)
|
||||
temp_chem += R.name
|
||||
temp_chem[R.name] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
B.data["antibodies"] = T.antibodies
|
||||
//debug
|
||||
//for(var/D in B.data)
|
||||
// world << "Data [D] = [B.data[D]]"
|
||||
//debug
|
||||
|
||||
src.reagents.reagent_list += B
|
||||
src.reagents.update_total()
|
||||
src.on_reagent_change()
|
||||
src.reagents.handle_reactions()
|
||||
user << "\blue You take a blood sample from [target]"
|
||||
for(var/mob/O in viewers(4, user))
|
||||
O.show_message("\red [user] takes a blood sample from [target].", 1)
|
||||
|
||||
Reference in New Issue
Block a user