Merge pull request #10784 from Seris02/polycoats

polychromic winter coats
This commit is contained in:
kevinz000
2020-02-02 01:46:58 -07:00
committed by GitHub
9 changed files with 87 additions and 1 deletions

View File

@@ -922,3 +922,78 @@
/obj/item/clothing/head/hooded/winterhood/christmashoodrg
icon_state = "christmashoodrg"
/obj/item/clothing/suit/hooded/wintercoat/polychromic
name = "polychromic winter coat"
icon_state = "coatpoly"
item_state = "coatpoly"
item_color = "coatpoly"
hoodtype = /obj/item/clothing/head/hooded/winterhood/polychromic
hasprimary = TRUE
hassecondary = TRUE
hastertiary = TRUE
primary_color = "#6A6964"
secondary_color = "#C4B8A6"
tertiary_color = "#0000FF"
/obj/item/clothing/head/hooded/winterhood/polychromic
icon_state = "winterhood_poly"
item_color = "winterhood_poly"
item_state = "winterhood_poly"
/obj/item/clothing/head/hooded/winterhood/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens.
. = ..()
if(suit.hasprimary | suit.hassecondary)
if(!isinhands) //prevents the worn sprites from showing up if you're just holding them
if(suit.hasprimary) //checks if overlays are enabled
var/mutable_appearance/primary_worn = mutable_appearance(icon_file, "[item_color]-primary") //automagical sprite selection
primary_worn.color = suit.primary_color //colors the overlay
. += primary_worn //adds the overlay onto the buffer list to draw on the mob sprite.
if(suit.hassecondary)
var/mutable_appearance/secondary_worn = mutable_appearance(icon_file, "[item_color]-secondary")
secondary_worn.color = suit.secondary_color
. += secondary_worn
/obj/item/clothing/suit/hooded/wintercoat/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens.
. = ..()
if(hasprimary | hassecondary | hastertiary)
if(!isinhands) //prevents the worn sprites from showing up if you're just holding them
if(hasprimary) //checks if overlays are enabled
var/mutable_appearance/primary_worn = mutable_appearance(icon_file, "[item_color]-primary[suittoggled ? "_t" : ""]") //automagical sprite selection
primary_worn.color = primary_color //colors the overlay
. += primary_worn //adds the overlay onto the buffer list to draw on the mob sprite.
if(hassecondary)
var/mutable_appearance/secondary_worn = mutable_appearance(icon_file, "[item_color]-secondary[suittoggled ? "_t" : ""]")
secondary_worn.color = secondary_color
. += secondary_worn
if(hastertiary)
var/mutable_appearance/tertiary_worn = mutable_appearance(icon_file, "[item_color]-tertiary[suittoggled ? "_t" : ""]")
tertiary_worn.color = tertiary_color
. += tertiary_worn
/obj/item/clothing/suit/hooded/wintercoat/AltClick(mob/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(hasprimary | hassecondary | hastertiary)
var/choice = input(user,"polychromic thread options", "Clothing Recolor") as null|anything in list("[hasprimary ? "Primary Color" : ""]", "[hassecondary ? "Secondary Color" : ""]", "[hastertiary ? "Tertiary Color" : ""]") //generates a list depending on the enabled overlays
switch(choice) //Lets the list's options actually lead to something
if("Primary Color")
var/primary_color_input = input(usr,"","Choose Primary Color",primary_color) as color|null //color input menu, the "|null" adds a cancel button to it.
if(primary_color_input) //Checks if the color selected is NULL, rejects it if it is NULL.
primary_color = sanitize_hexcolor(primary_color_input, desired_format=6, include_crunch=1) //formats the selected color properly
update_icon() //updates the item icon
user.regenerate_icons() //updates the worn icon. Probably a bad idea, but it works.
if("Secondary Color")
var/secondary_color_input = input(usr,"","Choose Secondary Color",secondary_color) as color|null
if(secondary_color_input)
secondary_color = sanitize_hexcolor(secondary_color_input, desired_format=6, include_crunch=1)
update_icon()
user.regenerate_icons()
if("Tertiary Color")
var/tertiary_color_input = input(usr,"","Choose Tertiary Color",tertiary_color) as color|null
if(tertiary_color_input)
tertiary_color = sanitize_hexcolor(tertiary_color_input, desired_format=6, include_crunch=1)
update_icon()
user.regenerate_icons()
return TRUE

View File

@@ -170,7 +170,8 @@
/obj/item/clothing/suit/jacket/leather/overcoat = 4,
/obj/item/clothing/under/pants/mustangjeans = 3,
/obj/item/clothing/neck/necklace/dope = 5,
/obj/item/clothing/suit/jacket/letterman_nanotrasen = 5)
/obj/item/clothing/suit/jacket/letterman_nanotrasen = 5,
/obj/item/clothing/suit/hooded/wintercoat/polychromic = 5)
refill_canister = /obj/item/vending_refill/clothing
/obj/item/vending_refill/clothing