/obj/item/weapon/hand_labeler name = "hand labeler" icon = 'icons/obj/bureaucracy.dmi' icon_state = "labeler0" item_state = "flight" var/label = null var/labels_left = 30 var/mode = 0 //off or on. /obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return if(!mode) //if it's off, give up. return if(A == loc) // if placing the labeller into something (e.g. backpack) return // don't set a label if(!labels_left) to_chat(user, "No labels left.") return if(!label || !length(label)) to_chat(user, "No text set.") return if(length(A.name) + length(label) > 64) to_chat(user, "Label too big.") return if(ishuman(A)) to_chat(user, "You can't label humans.") return if(issilicon(A)) to_chat(user, "You can't label cyborgs.") return if(istype(A, /obj/item/weapon/reagent_containers/glass)) to_chat(user, "The label can't stick to the [A.name]. (Try using a pen)") return user.visible_message("[user] labels [A] as [label].", \ "You label [A] as [label].") A.name = "[A.name] ([label])" /obj/item/weapon/hand_labeler/attack_self(mob/user as mob) mode = !mode icon_state = "labeler[mode]" if(mode) to_chat(user, "You turn on \the [src].") //Now let them chose the text. var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN) if(!str || !length(str)) to_chat(user, "Invalid text.") return label = str to_chat(user, "You set the text to '[str]'.") else to_chat(user, "You turn off \the [src].")