diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index c15e26a5cf..91eedfd904 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -1040,13 +1040,16 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/item/newspaper/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
if(scribble_page == curr_page)
to_chat(user, "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?")
else
var/s = stripped_input(user, "Write something", "Newspaper")
if (!s)
return
- if (!in_range(src, usr) && loc != usr)
+ if(!user.canUseTopic(src, BE_CLOSE))
return
scribble_page = curr_page
scribble = s
diff --git a/code/game/objects/items/implants/implantcase.dm b/code/game/objects/items/implants/implantcase.dm
index 00bda4dadb..e26f38d792 100644
--- a/code/game/objects/items/implants/implantcase.dm
+++ b/code/game/objects/items/implants/implantcase.dm
@@ -25,10 +25,13 @@
/obj/item/implantcase/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the side of [src]!")
+ return
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
return
- if(!in_range(src, user) && loc != user)
+ if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "implant case - '[t]'"
diff --git a/code/game/objects/items/implants/implanter.dm b/code/game/objects/items/implants/implanter.dm
index cb36924494..ddfc8d2484 100644
--- a/code/game/objects/items/implants/implanter.dm
+++ b/code/game/objects/items/implants/implanter.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/obj/item/implanter
name = "implanter"
desc = "A sterile automatic implant injector."
@@ -68,3 +69,78 @@
/obj/item/implanter/emp
name = "implanter (EMP)"
imp_type = /obj/item/implant/emp
+=======
+/obj/item/implanter
+ name = "implanter"
+ desc = "A sterile automatic implant injector."
+ icon = 'icons/obj/items_and_weapons.dmi'
+ icon_state = "implanter0"
+ item_state = "syringe_0"
+ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
+ righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
+ throw_speed = 3
+ throw_range = 5
+ w_class = WEIGHT_CLASS_SMALL
+ materials = list(MAT_METAL=600, MAT_GLASS=200)
+ var/obj/item/implant/imp = null
+ var/imp_type = null
+
+
+/obj/item/implanter/update_icon()
+ if(imp)
+ icon_state = "implanter1"
+ else
+ icon_state = "implanter0"
+
+
+/obj/item/implanter/attack(mob/living/M, mob/user)
+ if(!istype(M))
+ return
+ if(user && imp)
+ if(M != user)
+ M.visible_message("[user] is attempting to implant [M].")
+
+ var/turf/T = get_turf(M)
+ if(T && (M == user || do_mob(user, M, 50)))
+ if(src && imp)
+ if(imp.implant(M, user))
+ if (M == user)
+ to_chat(user, "You implant yourself.")
+ else
+ M.visible_message("[user] has implanted [M].", "[user] implants you.")
+ imp = null
+ update_icon()
+ else
+ to_chat(user, "[src] fails to implant [M].")
+
+/obj/item/implanter/attackby(obj/item/W, mob/user, params)
+ if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You prod at [src] with [W]!")
+ return
+ var/t = stripped_input(user, "What would you like the label to be?", name, null)
+ if(user.get_active_held_item() != W)
+ return
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
+ if(t)
+ name = "implanter ([t])"
+ else
+ name = "implanter"
+ else
+ return ..()
+
+/obj/item/implanter/Initialize(mapload)
+ . = ..()
+ if(imp_type)
+ imp = new imp_type(src)
+ update_icon()
+
+/obj/item/implanter/adrenalin
+ name = "implanter (adrenalin)"
+ imp_type = /obj/item/implant/adrenalin
+
+/obj/item/implanter/emp
+ name = "implanter (EMP)"
+ imp_type = /obj/item/implant/emp
+>>>>>>> 0195f03... [s]Fixes writing bugs/exploits (#35552)
diff --git a/code/game/objects/items/signs.dm b/code/game/objects/items/signs.dm
index 65716f2f30..2b00114ef8 100644
--- a/code/game/objects/items/signs.dm
+++ b/code/game/objects/items/signs.dm
@@ -18,8 +18,11 @@
actions_types = list(/datum/action/item_action/nano_picket_sign)
/obj/item/picket_sign/proc/retext(mob/user)
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
var/txt = stripped_input(user, "What would you like to write on the sign?", "Sign Label", null , 30)
- if(txt && Adjacent(user))
+ if(txt && user.canUseTopic(src, BE_CLOSE))
label = txt
name = "[label] sign"
desc = "It reads: [label]"
diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
index 9ca3fa96c8..b82aaf8a2d 100644
--- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm
+++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm
@@ -17,10 +17,13 @@
/obj/structure/closet/body_bag/attackby(obj/item/I, mob/user, params)
if (istype(I, /obj/item/pen) || istype(I, /obj/item/toy/crayon))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
var/t = stripped_input(user, "What would you like the label to be?", name, null, 53)
if(user.get_active_held_item() != I)
return
- if(!in_range(src, user) && loc != user)
+ if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "body bag - [t]"
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index e6cc6a15f6..06ca915254 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -81,10 +81,13 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/attackby(obj/P, mob/user, params)
add_fingerprint(user)
if(istype(P, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the side of [src]!")
+ return
var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
if (user.get_active_held_item() != P)
return
- if ((!in_range(src, usr) && src.loc != user))
+ if(!user.canUseTopic(src, BE_CLOSE))
return
if (t)
name = text("[]- '[]'", initial(name), t)
diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm
index 25464ba297..4de5069859 100644
--- a/code/modules/events/holiday/vday.dm
+++ b/code/modules/events/holiday/vday.dm
@@ -137,8 +137,13 @@
/obj/item/valentine/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/pen) || istype(W, /obj/item/toy/crayon))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
var/recipient = stripped_input(user, "Who is receiving this valentine?", "To:", null , 20)
var/sender = stripped_input(user, "Who is sending this valentine?", "From:", null , 20)
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
if(recipient && sender)
name = "valentine - To: [recipient] From: [sender]"
diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm
index cc14864d11..928cc52fa8 100644
--- a/code/modules/food_and_drinks/pizzabox.dm
+++ b/code/modules/food_and_drinks/pizzabox.dm
@@ -197,8 +197,13 @@
to_chat(user, "[src] already has a bomb in it!")
else if(istype(I, /obj/item/pen))
if(!open)
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
var/obj/item/pizzabox/box = boxes.len ? boxes[boxes.len] : src
box.boxtag += stripped_input(user, "Write on [box]'s tag:", box, "", 30)
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
to_chat(user, "You write with [I] on [src].")
update_icon()
return
diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm
index 5a4f949fcb..7dadcda1a2 100644
--- a/code/modules/games/cas.dm
+++ b/code/modules/games/cas.dm
@@ -139,11 +139,14 @@
/obj/item/toy/cards/singlecard/cas/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
if(!blank)
to_chat(user, "You cannot write on that card.")
return
var/cardtext = stripped_input(user, "What do you wish to write on the card?", "Card Writing", "", 50)
- if(!cardtext)
+ if(!cardtext || !user.canUseTopic(src, BE_CLOSE))
return
name = cardtext
buffertext = cardtext
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 2b9ed28842..7ecb0529ba 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -93,7 +93,12 @@
to_chat(user, "You empty \the [I] into \the [src].")
update_icon()
else if(istype(I, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the side of [src]!")
+ return
var/newname = stripped_input(user, "What would you like to title this bookshelf?")
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
if(!newname)
return
else
@@ -214,30 +219,42 @@
if(unique)
to_chat(user, "These pages don't seem to take the ink well! Looks like you can't modify it.")
return
+ var/literate = user.is_literate()
+ if(!literate)
+ to_chat(user, "You scribble illegibly on the cover of [src]!")
+ return
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
+ if(!user.canUseTopic(src, BE_CLOSE, literate))
+ return
switch(choice)
if("Title")
- var/newtitle = reject_bad_text(stripped_input(usr, "Write a new title:"))
+ var/newtitle = reject_bad_text(stripped_input(user, "Write a new title:"))
+ if(!user.canUseTopic(src, BE_CLOSE, literate))
+ return
if (length(newtitle) > 20)
- to_chat(usr, "That title won't fit on the cover!")
+ to_chat(user, "That title won't fit on the cover!")
return
if(!newtitle)
- to_chat(usr, "That title is invalid.")
+ to_chat(user, "That title is invalid.")
return
else
name = newtitle
title = newtitle
if("Contents")
- var/content = stripped_input(usr, "Write your book's contents (HTML NOT allowed):","","",8192)
+ var/content = stripped_input(user, "Write your book's contents (HTML NOT allowed):","","",8192)
+ if(!user.canUseTopic(src, BE_CLOSE, literate))
+ return
if(!content)
- to_chat(usr, "The content is invalid.")
+ to_chat(user, "The content is invalid.")
return
else
dat += content
if("Author")
- var/newauthor = stripped_input(usr, "Write the author's name:")
+ var/newauthor = stripped_input(user, "Write the author's name:")
+ if(!user.canUseTopic(src, BE_CLOSE, literate))
+ return
if(!newauthor)
- to_chat(usr, "The name is invalid.")
+ to_chat(user, "The name is invalid.")
return
else
author = newauthor
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 5b15a30951..899c132f04 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -41,8 +41,11 @@
to_chat(user, "You put [W] into [src].")
update_icon()
else if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the cover of [src]!")
+ return
var/n_name = copytext(sanitize(input(user, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
- if((in_range(src,user) && user.stat == CONSCIOUS))
+ if(user.canUseTopic(src, BE_CLOSE))
name = "folder[(n_name ? " - '[n_name]'" : null)]"
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 312c789f07..b9c21e1090 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -244,7 +244,8 @@
/obj/item/paper/Topic(href, href_list)
..()
- if(usr.stat || usr.restrained())
+ var/literate = usr.is_literate()
+ if(!usr.canUseTopic(src, BE_CLOSE, literate))
return
if(href_list["help"])
@@ -253,7 +254,7 @@
if(href_list["write"])
var/id = href_list["write"]
var/t = stripped_multiline_input("Enter what you want to write:", "Write", no_trim=TRUE)
- if(!t)
+ if(!t || !usr.canUseTopic(src, BE_CLOSE, literate))
return
var/obj/item/i = usr.get_active_held_item() //Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index b28b076812..19a83f9770 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -54,9 +54,12 @@
/obj/item/photo/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
txt = copytext(txt, 1, 128)
- if(loc == user && user.stat == CONSCIOUS)
+ if(user.canUseTopic(src, BE_CLOSE))
scribble = txt
..()
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index 85f99fb99a..31e893aa3a 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -74,14 +74,14 @@
/obj/item/reagent_containers/blood/attackby(obj/item/I, mob/user, params)
if (istype(I, /obj/item/pen) || istype(I, /obj/item/toy/crayon))
-
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the label of [src]!")
+ return
var/t = stripped_input(user, "What would you like to label the blood pack?", name, null, 53)
- if(!user.canUseTopic(src))
+ if(!user.canUseTopic(src, BE_CLOSE))
return
if(user.get_active_held_item() != I)
return
- if(loc != user)
- return
if(t)
labelled = 1
name = "blood pack - [t]"
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index c8d626b2d5..a32f5bf576 100644
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -33,7 +33,12 @@
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the side of [src]!")
+ return
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
if(!str || !length(str))
to_chat(user, "Invalid text!")
return
@@ -114,7 +119,12 @@
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on the side of [src]!")
+ return
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
if(!str || !length(str))
to_chat(user, "Invalid text!")
return