Merge pull request #5510 from Citadel-Station-13/upstream-merge-35552
[MIRROR] [s]Fixes writing bugs/exploits
This commit is contained in:
@@ -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, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
|
||||
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]'"
|
||||
|
||||
@@ -1,70 +1,73 @@
|
||||
/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("<span class='warning'>[user] is attempting to implant [M].</span>")
|
||||
|
||||
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, "<span class='notice'>You implant yourself.</span>")
|
||||
else
|
||||
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>")
|
||||
imp = null
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] fails to implant [M].</span>")
|
||||
|
||||
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
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)
|
||||
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
|
||||
/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("<span class='warning'>[user] is attempting to implant [M].</span>")
|
||||
|
||||
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, "<span class='notice'>You implant yourself.</span>")
|
||||
else
|
||||
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>")
|
||||
imp = null
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] fails to implant [M].</span>")
|
||||
|
||||
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You prod at [src] with [W]!</span>")
|
||||
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
|
||||
|
||||
@@ -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, "<span class='notice'>You scribble illegibly on [src]!</span>")
|
||||
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]"
|
||||
|
||||
@@ -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, "<span class='notice'>You scribble illegibly on [src]!</span>")
|
||||
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]"
|
||||
|
||||
@@ -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, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user