proc/SetIntensity(var/amount)
if(!amount) return text
var/oldcolor
var/oldbgcolor
var/return_text
// var/ft=findtext(text,">")
// var/current_char=copytext(text,ft+1,ft+2) //This will obtain the current char, so we can find it later, and replace it to the normal char
if(color&&color.hex) oldcolor=color.hex
if(bgcolor&&bgcolor.hex) oldbgcolor=bgcolor.hex
if(amount<0)
amount=abs(amount)
if(oldcolor)
color.SetRGB(color.r-amount,color.g-amount,color.b-amount)
return_text=dd_replacetext(text,oldcolor,color.hex)
if(oldbgcolor)
bgcolor.SetRGB(bgcolor.r-amount,bgcolor.g-amount,bgcolor.b-amount)
return_text=dd_replacetext(text,oldbgcolor,bgcolor.hex)
else
if(oldcolor)
color.SetRGB(color.r+amount,color.g+amount,color.b+amount)
return_text=dd_replacetext(text,oldcolor,color.hex)
if(oldbgcolor)
bgcolor.SetRGB(bgcolor.r+amount,bgcolor.g+amount,bgcolor.b+amount)
return_text=dd_replacetext(text,oldbgcolor,bgcolor.hex)
// return_text=dd_replacetext(text,current_char,char)
return return_text
Problem description:
That proc is creating a problem. When I attempt to change any turfs color with it, it turns the turf black with a white 'a' in it. It works fine on mobs and objs with a color and/or a bgcolor, but not turfs. Any ideas?
BTW, this is to be used in a text-mode lighting system.
Prodigal Squirrel