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)
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

View File

@@ -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

View File

@@ -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)

View File

@@ -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()

View File

@@ -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