Paint mixing

This commit is contained in:
RKF45
2014-01-11 22:19:02 +01:00
parent bd28c0c70b
commit ab8763378b
5 changed files with 20 additions and 16 deletions

View File

@@ -36,6 +36,10 @@ var/global/list/cached_icons = list()
..() ..()
reagents.add_reagent("paint_[paint_type]", volume) 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 red
icon_state = "paint_red" icon_state = "paint_red"
paint_type = "red" paint_type = "red"
@@ -171,8 +175,8 @@ var/global/list/cached_icons = list()
datum/reagent/paint datum/reagent/paint
name = "Paint" name = "Paint"
id = "paint_" id = "paint_"
description = "Floor paint is used to color floor tiles." description = name + " is used to color floor tiles."
reagent_state = 2 reagent_state = LIQUID
color = "#808080" color = "#808080"
reaction_turf(var/turf/T, var/volume) reaction_turf(var/turf/T, var/volume)
@@ -192,26 +196,26 @@ datum/reagent/paint
red red
name = "Red Paint" name = "Red Paint"
id = "paint_red" id = "paint_red"
color = "#FF0000" color = "#FE191A"
green green
name = "Green Paint" name = "Green Paint"
color = "#00FF00" color = "#18A31A"
id = "paint_green" id = "paint_green"
blue blue
name = "Blue Paint" name = "Blue Paint"
color = "#0000FF" color = "#247CFF"
id = "paint_blue" id = "paint_blue"
yellow yellow
name = "Yellow Paint" name = "Yellow Paint"
color = "#FFFF00" color = "#FDFE7D"
id = "paint_yellow" id = "paint_yellow"
violet violet
name = "Violet Paint" name = "Violet Paint"
color = "#FF00FF" color = "#CC0099"
id = "paint_violet" id = "paint_violet"
black black
@@ -221,7 +225,7 @@ datum/reagent/paint
white white
name = "White Paint" name = "White Paint"
color = "#FFFFFF" color = "#F0F8FF"
id = "paint_white" id = "paint_white"
datum/reagent/paint_remover datum/reagent/paint_remover

View File

@@ -1,4 +1,4 @@
/proc/GetColors(hex) /proc/GetColors(hex) //Actually converts hex to rgb
hex = uppertext(hex) hex = uppertext(hex)
var/hi1 = text2ascii(hex, 2) var/hi1 = text2ascii(hex, 2)
var/lo1 = text2ascii(hex, 3) var/lo1 = text2ascii(hex, 3)
@@ -15,7 +15,7 @@
var/list/rgbcolor = list(0,0,0) var/list/rgbcolor = list(0,0,0)
var/finalcolor = 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) if(!finalcolor)
rgbcolor = GetColors(re.color) rgbcolor = GetColors(re.color)
finalcolor = re.color finalcolor = re.color

View File

@@ -134,7 +134,7 @@ About Reagents:
object melting in here ... or something. i dunno. object melting in here ... or something. i dunno.
reaction_turf(var/turf/T) 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 This version is called when the reagents reacts
with a turf. You'll want to put stuff like extra with a turf. You'll want to put stuff like extra
slippery floors for lube or something in here. slippery floors for lube or something in here.
@@ -144,7 +144,7 @@ About Reagents:
This is the place where you put damage for toxins , This is the place where you put damage for toxins ,
drowsyness for sleep toxins etc etc. drowsyness for sleep toxins etc etc.
You'll want to call the parents proc by using ..() . 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. unless you write your own piece of code to slowly remove it.
(Should be pretty easy, 1 line of code) (Should be pretty easy, 1 line of code)

View File

@@ -23,7 +23,7 @@ datum
var/list/data = null var/list/data = null
var/volume = 0 var/volume = 0
var/nutriment_factor = 0 var/nutriment_factor = 0
var/custom_metabolism = REAGENTS_METABOLISM //Default 0.2 var/custom_metabolism = REAGENTS_METABOLISM
var/overdose = 0 var/overdose = 0
var/overdose_dam = 1 var/overdose_dam = 1
//var/list/viruses = list() //var/list/viruses = list()

View File

@@ -47,11 +47,11 @@
set src in view() set src in view()
..() ..()
if (!(usr in view(2)) && usr!=src.loc) return if (!(usr in view(2)) && usr!=src.loc) return
usr << "\blue It contains:" usr << "\blue It contains "
if(reagents && reagents.reagent_list.len) if(reagents && reagents.reagent_list.len)
usr << "\blue [src.reagents.total_volume] units of liquid." usr << "\blue [src.reagents.total_volume] units of liquid."
else else
usr << "\blue Nothing." usr << "\blue nothing."
if (!is_open_container()) if (!is_open_container())
usr << "\blue Airtight lid seals it completely." usr << "\blue Airtight lid seals it completely."
@@ -216,7 +216,7 @@
/obj/item/weapon/reagent_containers/glass/beaker/bluespace /obj/item/weapon/reagent_containers/glass/beaker/bluespace
name = "bluespace beaker" 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" icon_state = "beakerbluespace"
g_amt = 5000 g_amt = 5000
volume = 300 volume = 300