mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Standardised reagent colour mixing a little bit. Fixes issue 785.
Changed the path of large beakers, so they're actually a subtype of beaker (wtf) Moved new_year.dm to unused. Updated Carn's sequential master controller to not have tension stuff, for potential live testing. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4444 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -64,27 +64,6 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Hope it's okay to stick this shit here: it basically just turns a hexadecimal color into rgb
|
||||
*/
|
||||
|
||||
/proc/GetColors(hex)
|
||||
hex = uppertext(hex)
|
||||
var/hi1 = text2ascii(hex, 2)
|
||||
var/lo1 = text2ascii(hex, 3)
|
||||
var/hi2 = text2ascii(hex, 4)
|
||||
var/lo2 = text2ascii(hex, 5)
|
||||
var/hi3 = text2ascii(hex, 6)
|
||||
var/lo3 = text2ascii(hex, 7)
|
||||
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
|
||||
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
|
||||
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,32 +44,10 @@
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
var/list/rgbcolor = list(0,0,0)
|
||||
var/finalcolor
|
||||
for(var/datum/reagent/re in D.reagents.reagent_list) // natural color mixing bullshit/algorithm
|
||||
if(!finalcolor)
|
||||
rgbcolor = GetColors(re.color)
|
||||
finalcolor = re.color
|
||||
else
|
||||
var/newcolor[3]
|
||||
var/prergbcolor[3]
|
||||
prergbcolor = rgbcolor
|
||||
newcolor = GetColors(re.color)
|
||||
|
||||
rgbcolor[1] = (prergbcolor[1]+newcolor[1])/2
|
||||
rgbcolor[2] = (prergbcolor[2]+newcolor[2])/2
|
||||
rgbcolor[3] = (prergbcolor[3]+newcolor[3])/2
|
||||
|
||||
finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3])
|
||||
// This isn't a perfect color mixing system, the more reagents that are inside,
|
||||
// the darker it gets until it becomes absolutely pitch black! I dunno, maybe
|
||||
// that's pretty realistic? I don't do a whole lot of color-mixing anyway.
|
||||
// If you add brighter colors to it it'll eventually get lighter, though.
|
||||
|
||||
D.name = "chemicals"
|
||||
D.icon = 'icons/obj/chempuff.dmi'
|
||||
|
||||
D.icon += finalcolor
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
spawn(0)
|
||||
for(var/i=0, i<3, i++)
|
||||
@@ -97,8 +75,6 @@
|
||||
/obj/item/weapon/reagent_containers/spray/examine()
|
||||
set src in usr
|
||||
..()
|
||||
// usr << "\icon[src] This is \the [src]!"
|
||||
// usr << desc
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "[round(R.volume)] units of [R.name] left."
|
||||
return
|
||||
@@ -178,25 +154,7 @@
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
src.reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
var/rgbcolor[3]
|
||||
var/finalcolor
|
||||
for(var/datum/reagent/re in D.reagents.reagent_list)
|
||||
if(!finalcolor)
|
||||
rgbcolor = GetColors(re.color)
|
||||
finalcolor = re.color
|
||||
else
|
||||
var/newcolor[3]
|
||||
var/prergbcolor[3]
|
||||
prergbcolor = rgbcolor
|
||||
newcolor = GetColors(re.color)
|
||||
|
||||
rgbcolor[1] = (prergbcolor[1]+newcolor[1])/2
|
||||
rgbcolor[2] = (prergbcolor[2]+newcolor[2])/2
|
||||
rgbcolor[3] = (prergbcolor[3]+newcolor[3])/2
|
||||
|
||||
finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3])
|
||||
|
||||
D.icon += finalcolor
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
Sprays[i] = D
|
||||
|
||||
|
||||
Reference in New Issue
Block a user