Moves reskinning items to /obj (#28558)

This commit is contained in:
Really-Good-Soda-Flavor
2017-06-21 15:19:17 -03:00
committed by Leo
parent 7155f5feb9
commit 40de86de35
4 changed files with 51 additions and 70 deletions
+23 -1
View File
@@ -23,7 +23,8 @@
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
var/unique_rename = FALSE // can you customize the description/name of the thing?
var/current_skin //Has the item been reskinned?
var/list/unique_reskin //List of options to reskin.
var/dangerous_possession = FALSE //Admin possession yes/no
/obj/vv_edit_var(vname, vval)
@@ -196,6 +197,27 @@
..()
if(unique_rename)
to_chat(user, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
/obj/AltClick(mob/user)
. = ..()
if(unique_reskin && !current_skin && in_range(user,src))
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
reskin_obj(user)
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/choice = input(M,"Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
if(!QDELETED(src) && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(!unique_reskin[choice])
return
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice].'")
/obj/proc/gang_contraband_value()
return 0
+9 -17
View File
@@ -82,25 +82,17 @@
materials = list(MAT_GOLD = 750)
sharpness = IS_SHARP
resistance_flags = FIRE_PROOF
var/unique_reskin = TRUE
var/list/skins = list("Oak" = "pen-fountain-o", "Gold" = "pen-fountain-g", "Rosewood" = "pen-fountain-r", "Black and Silver" = "pen-fountain-b","Command Blue" = "pen-fountain-cb")
unique_reskin = list("Oak" = "pen-fountain-o",
"Gold" = "pen-fountain-g",
"Rosewood" = "pen-fountain-r",
"Black and Silver" = "pen-fountain-b",
"Command Blue" = "pen-fountain-cb"
)
/obj/item/weapon/pen/fountain/captain/AltClick()
var/mob/living/carbon/user = usr
if(!istype(user))
return
if(unique_reskin)
var/choice = input(user,"Choose the finish for your pen.","Reskin Pen") as null|anything in skins
if(!QDELETED(src) && choice && !user.incapacitated() && in_range(user,src))
icon_state = skins[choice]
unique_reskin = FALSE
to_chat(user, "Your pen now has a [choice] finish.")
desc = "It's an expensive [choice] fountain pen. The nib is quite sharp."
/obj/item/weapon/pen/fountain/captain/examine(mob/user)
/obj/item/weapon/pen/fountain/captain/reskin_obj(mob/M)
..()
if(unique_reskin)
to_chat(user, "<span class='notice'>This item can be reskinned. Alt-click to select a skin.</span>")
if(current_skin)
desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp."
/obj/item/weapon/pen/attack_self(mob/living/carbon/user)
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
-25
View File
@@ -37,9 +37,6 @@
var/weapon_weight = WEAPON_LIGHT
var/spread = 0 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/unique_reskin = 0 //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
@@ -93,8 +90,6 @@
to_chat(user, "It has [pin] installed.")
else
to_chat(user, "It doesn't have a firing pin installed, and won't fire.")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
//called after the gun has successfully fired its chambered ammo.
/obj/item/weapon/gun/proc/process_chamber()
@@ -400,26 +395,6 @@
if(alight)
alight.Remove(user)
/obj/item/weapon/gun/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(unique_reskin && !current_skin && loc == user)
reskin_gun(user)
/obj/item/weapon/gun/proc/reskin_gun(mob/M)
var/choice = input(M,"Warning, you can only reskin your weapon once!","Reskin Gun") in options
if(src && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(options[choice] == null)
return
current_skin = options[choice]
to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.")
update_icon()
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
if(!ishuman(user) || !ishuman(target))
return
@@ -92,17 +92,13 @@
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
icon_state = "detective"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/ballistic/revolver/detective/Initialize()
. = ..()
options["Default"] = "detective"
options["Leopard Spots"] = "detective_leopard"
options["Black Panther"] = "detective_panther"
options["Gold Trim"] = "detective_gold"
options["The Peacemaker"] = "detective_peacemaker"
options["Cancel"] = null
unique_rename = TRUE
unique_reskin = list("Default" = "detective",
"Leopard Spots" = "detective_leopard",
"Black Panther" = "detective_panther",
"Gold Trim" = "detective_gold",
"The Peacemaker" = "detective_peacemaker"
)
/obj/item/weapon/gun/ballistic/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
if(magazine.caliber != initial(magazine.caliber))
@@ -269,18 +265,14 @@
slot_flags = SLOT_BACK
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
sawn_desc = "Omar's coming!"
unique_rename = 1
unique_reskin = 1
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/Initialize()
. = ..()
options["Default"] = "dshotgun"
options["Dark Red Finish"] = "dshotgun-d"
options["Ash"] = "dshotgun-f"
options["Faded Grey"] = "dshotgun-g"
options["Maple"] = "dshotgun-l"
options["Rosewood"] = "dshotgun-p"
options["Cancel"] = null
unique_rename = TRUE
unique_reskin = list("Default" = "dshotgun",
"Dark Red Finish" = "dshotgun-d",
"Ash" = "dshotgun-f",
"Faded Grey" = "dshotgun-g",
"Maple" = "dshotgun-1",
"Rosewood" = "dshotgun-p"
)
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
..()
@@ -319,9 +311,9 @@
slot_flags = null
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
sawn_desc = "I'm just here for the gasoline."
unique_rename = 0
unique_reskin = 0
var/slung = 0
unique_rename = FALSE
unique_reskin = null
var/slung = FALSE
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
..()
@@ -330,7 +322,7 @@
if(C.use(10))
slot_flags = SLOT_BACK
to_chat(user, "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>")
slung = 1
slung = TRUE
update_icon()
else
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")