mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Color updates
This commit is contained in:
@@ -57,7 +57,7 @@ var/datum/canister_icons/canister_icon_container = new()
|
||||
var/valve_open = 0
|
||||
var/release_pressure = ONE_ATMOSPHERE
|
||||
|
||||
var/list/item_color //variable that stores colours
|
||||
var/list/canister_color //variable that stores colours
|
||||
var/list/decals //list that stores the decals
|
||||
|
||||
//lists for check_change()
|
||||
@@ -81,7 +81,7 @@ var/datum/canister_icons/canister_icon_container = new()
|
||||
|
||||
New()
|
||||
..()
|
||||
item_color = list(
|
||||
canister_color = list(
|
||||
"prim" = "yellow",
|
||||
"sec" = "none",
|
||||
"ter" = "none",
|
||||
@@ -117,7 +117,7 @@ var/datum/canister_icons/canister_icon_container = new()
|
||||
for(var/C in colorcontainer)
|
||||
if(C == "prim") continue
|
||||
var/list/L = colorcontainer[C]
|
||||
if(!(item_color[C]) || (item_color[C] == "none"))
|
||||
if(!(canister_color[C]) || (canister_color[C] == "none"))
|
||||
L.Add(list("anycolor" = 0))
|
||||
else
|
||||
L.Add(list("anycolor" = 1))
|
||||
@@ -151,9 +151,9 @@ var/datum/canister_icons/canister_icon_container = new()
|
||||
else
|
||||
update_flag |= 32
|
||||
|
||||
if(list2params(oldcolor) != list2params(item_color))
|
||||
if(list2params(oldcolor) != list2params(canister_color))
|
||||
update_flag |= 64
|
||||
oldcolor = item_color.Copy()
|
||||
oldcolor = canister_color.Copy()
|
||||
|
||||
if(list2params(olddecals) != list2params(decals))
|
||||
update_flag |= 128
|
||||
@@ -180,20 +180,20 @@ update_flag
|
||||
|
||||
if (src.destroyed)
|
||||
src.overlays = 0
|
||||
src.icon_state = text("[]-1", src.item_color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
|
||||
src.icon_state = text("[]-1", src.canister_color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
|
||||
|
||||
if(icon_state != src.item_color["prim"])
|
||||
icon_state = src.item_color["prim"]
|
||||
if(icon_state != src.canister_color["prim"])
|
||||
icon_state = src.canister_color["prim"]
|
||||
|
||||
if(check_change()) //Returns 1 if no change needed to icons.
|
||||
return
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
for(var/C in item_color)
|
||||
for(var/C in canister_color)
|
||||
if(C == "prim") continue
|
||||
if(item_color[C] == "none") continue
|
||||
overlays.Add(item_color[C])
|
||||
if(canister_color[C] == "none") continue
|
||||
overlays.Add(canister_color[C])
|
||||
|
||||
for(var/D in decals)
|
||||
if(decals[D])
|
||||
@@ -393,7 +393,7 @@ update_flag
|
||||
data["name"] = name
|
||||
data["menu"] = menu ? 1 : 0
|
||||
data["canLabel"] = can_label ? 1 : 0
|
||||
data["item_color"] = item_color
|
||||
data["canister_color"] = canister_color
|
||||
data["colorContainer"] = colorcontainer
|
||||
data["possibleDecals"] = possibledecals
|
||||
data["portConnected"] = connected_port ? 1 : 0
|
||||
@@ -482,22 +482,22 @@ update_flag
|
||||
|
||||
if (href_list["choice"] == "Primary color")
|
||||
if (is_a_color(href_list["icon"],"prim"))
|
||||
item_color["prim"] = href_list["icon"]
|
||||
canister_color["prim"] = href_list["icon"]
|
||||
if (href_list["choice"] == "Secondary color")
|
||||
if (href_list["icon"] == "none")
|
||||
item_color["sec"] = "none"
|
||||
canister_color["sec"] = "none"
|
||||
else if (is_a_color(href_list["icon"],"sec"))
|
||||
item_color["sec"] = href_list["icon"]
|
||||
canister_color["sec"] = href_list["icon"]
|
||||
if (href_list["choice"] == "Tertiary color")
|
||||
if (href_list["icon"] == "none")
|
||||
item_color["ter"] = "none"
|
||||
canister_color["ter"] = "none"
|
||||
else if (is_a_color(href_list["icon"],"ter"))
|
||||
item_color["ter"] = href_list["icon"]
|
||||
canister_color["ter"] = href_list["icon"]
|
||||
if (href_list["choice"] == "Quaternary color")
|
||||
if (href_list["icon"] == "none")
|
||||
item_color["quart"] = "none"
|
||||
canister_color["quart"] = "none"
|
||||
else if (is_a_color(href_list["icon"],"quart"))
|
||||
item_color["quart"] = href_list["icon"]
|
||||
canister_color["quart"] = href_list["icon"]
|
||||
|
||||
if (href_list["choice"] == "decals")
|
||||
if (is_a_decal(href_list["icon"]))
|
||||
@@ -542,7 +542,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/toxins/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "orange"
|
||||
canister_color["prim"] = "orange"
|
||||
decals["plasma"] = 1
|
||||
src.air_contents.toxins = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
@@ -552,7 +552,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "blue"
|
||||
canister_color["prim"] = "blue"
|
||||
src.air_contents.oxygen = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
src.update_icon()
|
||||
@@ -561,7 +561,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "redws"
|
||||
canister_color["prim"] = "redws"
|
||||
var/datum/gas/sleeping_agent/trace_gas = new
|
||||
air_contents.trace_gases += trace_gas
|
||||
trace_gas.moles = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
@@ -588,7 +588,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/nitrogen/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "red"
|
||||
canister_color["prim"] = "red"
|
||||
src.air_contents.nitrogen = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
src.update_icon()
|
||||
@@ -597,7 +597,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/carbon_dioxide/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "black"
|
||||
canister_color["prim"] = "black"
|
||||
src.air_contents.carbon_dioxide = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
src.update_icon()
|
||||
@@ -607,7 +607,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/air/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "grey"
|
||||
canister_color["prim"] = "grey"
|
||||
src.air_contents.oxygen = (O2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
src.air_contents.nitrogen = (N2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
@@ -617,7 +617,7 @@ update_flag
|
||||
/obj/machinery/portable_atmospherics/canister/custom_mix/New()
|
||||
..()
|
||||
|
||||
item_color["prim"] = "whiters"
|
||||
canister_color["prim"] = "whiters"
|
||||
src.update_icon() // Otherwise new canisters do not have their icon updated with the pressure light, likely want to add this to the canister class constructor, avoiding at current time to refrain from screwing up code for other canisters. --DZD
|
||||
return 1
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@
|
||||
|
||||
|
||||
if(crayon)
|
||||
var/item_color
|
||||
var/wash_color
|
||||
if(istype(crayon,/obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/CR = crayon
|
||||
item_color = CR.colourName
|
||||
wash_color = CR.colourName
|
||||
else if(istype(crayon,/obj/item/weapon/stamp))
|
||||
var/obj/item/weapon/stamp/ST = crayon
|
||||
item_color = ST.item_color
|
||||
wash_color = ST.item_color
|
||||
|
||||
if(item_color)
|
||||
if(wash_color)
|
||||
var/new_jumpsuit_icon_state = ""
|
||||
var/new_jumpsuit_item_state = ""
|
||||
var/new_jumpsuit_name = ""
|
||||
@@ -77,7 +77,7 @@
|
||||
for(var/T in typesof(/obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/J = new T
|
||||
//world << "DEBUG: [color] == [J.color]"
|
||||
if(item_color == J.item_color)
|
||||
if(wash_color == J.item_color)
|
||||
new_jumpsuit_icon_state = J.icon_state
|
||||
new_jumpsuit_item_state = J.item_state
|
||||
new_jumpsuit_name = J.name
|
||||
@@ -88,7 +88,7 @@
|
||||
for(var/T in typesof(/obj/item/clothing/gloves/color))
|
||||
var/obj/item/clothing/gloves/color/G = new T
|
||||
//world << "DEBUG: [color] == [J.color]"
|
||||
if(item_color == G.item_color)
|
||||
if(wash_color == G.item_color)
|
||||
new_glove_icon_state = G.icon_state
|
||||
new_glove_item_state = G.item_state
|
||||
new_glove_name = G.name
|
||||
@@ -99,7 +99,7 @@
|
||||
for(var/T in typesof(/obj/item/clothing/shoes))
|
||||
var/obj/item/clothing/shoes/S = new T
|
||||
//world << "DEBUG: [color] == [J.color]"
|
||||
if(item_color == S.item_color)
|
||||
if(wash_color == S.item_color)
|
||||
new_shoe_icon_state = S.icon_state
|
||||
new_shoe_name = S.name
|
||||
qdel(S)
|
||||
@@ -109,7 +109,7 @@
|
||||
for(var/T in typesof(/obj/item/weapon/bedsheet))
|
||||
var/obj/item/weapon/bedsheet/B = new T
|
||||
//world << "DEBUG: [color] == [J.color]"
|
||||
if(item_color == B.item_color)
|
||||
if(wash_color == B.item_color)
|
||||
new_sheet_icon_state = B.icon_state
|
||||
new_sheet_name = B.name
|
||||
qdel(B)
|
||||
@@ -119,7 +119,7 @@
|
||||
for(var/T in typesof(/obj/item/clothing/head/soft))
|
||||
var/obj/item/clothing/head/soft/H = new T
|
||||
//world << "DEBUG: [color] == [J.color]"
|
||||
if(item_color == H.item_color)
|
||||
if(wash_color == H.item_color)
|
||||
new_softcap_icon_state = H.icon_state
|
||||
new_softcap_name = H.name
|
||||
qdel(H)
|
||||
@@ -131,7 +131,7 @@
|
||||
//world << "DEBUG: YUP! FOUND IT!"
|
||||
J.item_state = new_jumpsuit_item_state
|
||||
J.icon_state = new_jumpsuit_icon_state
|
||||
J.item_color = item_color
|
||||
J.item_color = wash_color
|
||||
J.name = new_jumpsuit_name
|
||||
J.desc = new_desc
|
||||
if(new_glove_icon_state && new_glove_item_state && new_glove_name)
|
||||
@@ -139,7 +139,7 @@
|
||||
//world << "DEBUG: YUP! FOUND IT!"
|
||||
G.item_state = new_glove_item_state
|
||||
G.icon_state = new_glove_icon_state
|
||||
G.item_color = item_color
|
||||
G.item_color = wash_color
|
||||
G.name = new_glove_name
|
||||
if(!istype(G, /obj/item/clothing/gloves/color/black/thief))
|
||||
G.desc = new_desc
|
||||
@@ -151,21 +151,21 @@
|
||||
S.slowdown = SHOES_SLOWDOWN
|
||||
new /obj/item/weapon/restraints/handcuffs( src )
|
||||
S.icon_state = new_shoe_icon_state
|
||||
S.item_color = item_color
|
||||
S.item_color = wash_color
|
||||
S.name = new_shoe_name
|
||||
S.desc = new_desc
|
||||
if(new_sheet_icon_state && new_sheet_name)
|
||||
for(var/obj/item/weapon/bedsheet/B in contents)
|
||||
//world << "DEBUG: YUP! FOUND IT!"
|
||||
B.icon_state = new_sheet_icon_state
|
||||
B.item_color = item_color
|
||||
B.item_color = wash_color
|
||||
B.name = new_sheet_name
|
||||
B.desc = new_desc
|
||||
if(new_softcap_icon_state && new_softcap_name)
|
||||
for(var/obj/item/clothing/head/soft/H in contents)
|
||||
//world << "DEBUG: YUP! FOUND IT!"
|
||||
H.icon_state = new_softcap_icon_state
|
||||
H.item_color = item_color
|
||||
H.item_color = wash_color
|
||||
H.name = new_softcap_name
|
||||
H.desc = new_desc
|
||||
qdel(crayon)
|
||||
|
||||
@@ -218,18 +218,18 @@ var/global/chicken_count = 0
|
||||
attacktext = "kicks"
|
||||
health = 10
|
||||
var/eggsleft = 0
|
||||
var/item_color
|
||||
var/chicken_color
|
||||
pass_flags = PASSTABLE | PASSMOB
|
||||
small = 1
|
||||
can_hide = 1
|
||||
|
||||
/mob/living/simple_animal/chicken/New()
|
||||
..()
|
||||
if(!item_color)
|
||||
item_color = pick( list("brown","black","white") )
|
||||
icon_state = "chicken_[item_color]"
|
||||
icon_living = "chicken_[item_color]"
|
||||
icon_dead = "chicken_[item_color]_dead"
|
||||
if(!chicken_color)
|
||||
chicken_color = pick( list("brown","black","white") )
|
||||
icon_state = "chicken_[chicken_color]"
|
||||
icon_living = "chicken_[chicken_color]"
|
||||
icon_dead = "chicken_[chicken_color]_dead"
|
||||
pixel_x = rand(-6, 6)
|
||||
pixel_y = rand(0, 10)
|
||||
chicken_count += 1
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
density = 0
|
||||
ventcrawler = 2
|
||||
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
|
||||
var/item_color //brown, gray and white, leave blank for random
|
||||
var/mouse_color //brown, gray and white, leave blank for random
|
||||
layer = MOB_LAYER
|
||||
min_oxy = 16 //Require atleast 16kPA oxygen
|
||||
minbodytemp = 223 //Below -50 Degrees Celcius
|
||||
@@ -39,33 +39,33 @@
|
||||
|
||||
if(!ckey && stat == CONSCIOUS && prob(0.5))
|
||||
stat = UNCONSCIOUS
|
||||
icon_state = "mouse_[item_color]_sleep"
|
||||
icon_state = "mouse_[mouse_color]_sleep"
|
||||
wander = 0
|
||||
speak_chance = 0
|
||||
//snuffles
|
||||
else if(stat == UNCONSCIOUS)
|
||||
if(ckey || prob(1))
|
||||
stat = CONSCIOUS
|
||||
icon_state = "mouse_[item_color]"
|
||||
icon_state = "mouse_[mouse_color]"
|
||||
wander = 1
|
||||
else if(prob(5))
|
||||
emote("snuffles")
|
||||
|
||||
/mob/living/simple_animal/mouse/New()
|
||||
..()
|
||||
if(!item_color)
|
||||
item_color = pick( list("brown","gray","white") )
|
||||
icon_state = "mouse_[item_color]"
|
||||
icon_living = "mouse_[item_color]"
|
||||
icon_dead = "mouse_[item_color]_dead"
|
||||
desc = "It's a small [item_color] rodent, often seen hiding in maintenance areas and making a nuisance of itself."
|
||||
if(!mouse_color)
|
||||
mouse_color = pick( list("brown","gray","white") )
|
||||
icon_state = "mouse_[mouse_color]"
|
||||
icon_living = "mouse_[mouse_color]"
|
||||
icon_dead = "mouse_[mouse_color]_dead"
|
||||
desc = "It's a small [mouse_color] rodent, often seen hiding in maintenance areas and making a nuisance of itself."
|
||||
|
||||
|
||||
/mob/living/simple_animal/mouse/proc/splat()
|
||||
src.health = 0
|
||||
src.stat = DEAD
|
||||
src.icon_dead = "mouse_[item_color]_splat"
|
||||
src.icon_state = "mouse_[item_color]_splat"
|
||||
src.icon_dead = "mouse_[mouse_color]_splat"
|
||||
src.icon_state = "mouse_[mouse_color]_splat"
|
||||
layer = MOB_LAYER
|
||||
if(client)
|
||||
client.time_died_as_mouse = world.time
|
||||
@@ -116,15 +116,15 @@
|
||||
*/
|
||||
|
||||
/mob/living/simple_animal/mouse/white
|
||||
item_color = "white"
|
||||
mouse_color = "white"
|
||||
icon_state = "mouse_white"
|
||||
|
||||
/mob/living/simple_animal/mouse/gray
|
||||
item_color = "gray"
|
||||
mouse_color = "gray"
|
||||
icon_state = "mouse_gray"
|
||||
|
||||
/mob/living/simple_animal/mouse/brown
|
||||
item_color = "brown"
|
||||
mouse_color = "brown"
|
||||
icon_state = "mouse_brown"
|
||||
|
||||
//TOM IS ALIVE! SQUEEEEEEEE~K :)
|
||||
|
||||
Reference in New Issue
Block a user