Refactors renaming things with a pen. (#14960)

* Refactors renaming things with a pen.

* Farie review (thanks!!)

* Derp.

* Farie take 2
This commit is contained in:
moxian
2020-12-16 14:43:15 -05:00
committed by GitHub
parent b797f85a49
commit 1683c4271a
27 changed files with 186 additions and 268 deletions
+5 -10
View File
@@ -39,8 +39,8 @@
var/spread = 0
var/randomspread = 1
var/unique_rename = 0 //allows renaming with a pen
var/unique_reskin = 0 //allows one-time reskinning
var/unique_rename = TRUE //allows renaming with a pen
var/unique_reskin = TRUE //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
@@ -318,7 +318,9 @@
if(unique_rename)
if(istype(I, /obj/item/pen))
rename_gun(user)
var/t = rename_interactive(user, I, use_prefix = FALSE)
if(!isnull(t))
to_chat(user, "<span class='notice'>You name the gun [name]. Say hello to your new friend.</span>")
if(istype(I, /obj/item/kitchen/knife))
var/obj/item/kitchen/knife/K = I
if(!can_bayonet || !K.bayonet || bayonet) //ensure the gun has an attachment point available, and that the knife is compatible with it.
@@ -427,13 +429,6 @@
to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.")
update_icon()
/obj/item/gun/proc/rename_gun(mob/M)
var/input = stripped_input(M,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
to_chat(M, "You name the gun [input]. Say hello to your new friend.")
return
/obj/item/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
if(!ishuman(user) || !ishuman(target))
return
@@ -89,7 +89,7 @@
/obj/item/gun/projectile/revolver/detective
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
name = "\improper .38 Mars Special"
name = ".38 Mars Special"
icon_state = "detective"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
unique_rename = 1