From ab8763378b5b3a1937e9daf57806f5aa1e69bcc0 Mon Sep 17 00:00:00 2001 From: RKF45 Date: Sat, 11 Jan 2014 22:19:02 +0100 Subject: [PATCH] Paint mixing --- code/game/objects/items/weapons/paint.dm | 20 +++++++++++-------- code/modules/reagents/Chemistry-Colours.dm | 4 ++-- code/modules/reagents/Chemistry-Readme.dm | 4 ++-- code/modules/reagents/Chemistry-Reagents.dm | 2 +- .../reagents/reagent_containers/glass.dm | 6 +++--- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index 5a20ac12d0..d1bc39a5e5 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -36,6 +36,10 @@ var/global/list/cached_icons = list() ..() reagents.add_reagent("paint_[paint_type]", volume) + on_reagent_change() //Until we have a generic "paint", this will give new colours to all paints in the can + for(var/datum/reagent/paint/P in reagents.reagent_list) + P.color = mix_color_from_reagents(reagent_list) + red icon_state = "paint_red" paint_type = "red" @@ -171,8 +175,8 @@ var/global/list/cached_icons = list() datum/reagent/paint name = "Paint" id = "paint_" - description = "Floor paint is used to color floor tiles." - reagent_state = 2 + description = name + " is used to color floor tiles." + reagent_state = LIQUID color = "#808080" reaction_turf(var/turf/T, var/volume) @@ -192,26 +196,26 @@ datum/reagent/paint red name = "Red Paint" id = "paint_red" - color = "#FF0000" + color = "#FE191A" green name = "Green Paint" - color = "#00FF00" + color = "#18A31A" id = "paint_green" blue name = "Blue Paint" - color = "#0000FF" + color = "#247CFF" id = "paint_blue" yellow name = "Yellow Paint" - color = "#FFFF00" + color = "#FDFE7D" id = "paint_yellow" violet name = "Violet Paint" - color = "#FF00FF" + color = "#CC0099" id = "paint_violet" black @@ -221,7 +225,7 @@ datum/reagent/paint white name = "White Paint" - color = "#FFFFFF" + color = "#F0F8FF" id = "paint_white" datum/reagent/paint_remover diff --git a/code/modules/reagents/Chemistry-Colours.dm b/code/modules/reagents/Chemistry-Colours.dm index e1b43763e8..e81561d733 100644 --- a/code/modules/reagents/Chemistry-Colours.dm +++ b/code/modules/reagents/Chemistry-Colours.dm @@ -1,4 +1,4 @@ -/proc/GetColors(hex) +/proc/GetColors(hex) //Actually converts hex to rgb hex = uppertext(hex) var/hi1 = text2ascii(hex, 2) var/lo1 = text2ascii(hex, 3) @@ -15,7 +15,7 @@ var/list/rgbcolor = list(0,0,0) var/finalcolor = 0 - for(var/datum/reagent/re in reagent_list) // natural color mixing bullshit/algorithm + for(var/datum/reagent/re in reagent_list) //TODO: weigh final colour by amount of reagents; make this algorithm use hex if(!finalcolor) rgbcolor = GetColors(re.color) finalcolor = re.color diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index 77921d0ab0..ac8792c1e7 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -134,7 +134,7 @@ About Reagents: object melting in here ... or something. i dunno. reaction_turf(var/turf/T) - This is called by the holder's reation proc. + This is called by the holder's reaction proc. This version is called when the reagents reacts with a turf. You'll want to put stuff like extra slippery floors for lube or something in here. @@ -144,7 +144,7 @@ About Reagents: This is the place where you put damage for toxins , drowsyness for sleep toxins etc etc. You'll want to call the parents proc by using ..() . - If you dont, the chemical will stay in the mob forever - + If you don't, the chemical will stay in the mob forever - unless you write your own piece of code to slowly remove it. (Should be pretty easy, 1 line of code) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index c9666d98f0..7d5de91613 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -23,7 +23,7 @@ datum var/list/data = null var/volume = 0 var/nutriment_factor = 0 - var/custom_metabolism = REAGENTS_METABOLISM //Default 0.2 + var/custom_metabolism = REAGENTS_METABOLISM var/overdose = 0 var/overdose_dam = 1 //var/list/viruses = list() diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 21384ffd59..fb99198d8c 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -47,11 +47,11 @@ set src in view() ..() if (!(usr in view(2)) && usr!=src.loc) return - usr << "\blue It contains:" + usr << "\blue It contains " if(reagents && reagents.reagent_list.len) usr << "\blue [src.reagents.total_volume] units of liquid." else - usr << "\blue Nothing." + usr << "\blue nothing." if (!is_open_container()) usr << "\blue Airtight lid seals it completely." @@ -216,7 +216,7 @@ /obj/item/weapon/reagent_containers/glass/beaker/bluespace name = "bluespace beaker" - desc = "A bluespace beaker, powered by experimental bluespace technology and Element Cuban combined with the Compound Pete. Can hold up to 300 units." + desc = "A bluespace beaker, powered by experimental bluespace technology. Can hold up to 300 units." icon_state = "beakerbluespace" g_amt = 5000 volume = 300