ID:1640467
 
(See the best response by WSHGC.)
Hi, so I was wondering if it was possible to add an overlay for the jutsu, sharingan. If anybody is unsure of what the sharingan is then what I'm basically trying to say is I would like to add an overlay to make the players eyes turn red once the jutsu/spell is executed, how would I code this?

Best response
http://www.byond.com/docs/ref/info.html#/icon/proc/New

Its SwapColor(old_rgb,new_rgb)
Therefore you just need the exact RGB of the color your switching with the color replacing.

This is just an example
var/icon
switch(src.icon_name)
if(src.sharingan && EN[1])
var/icon/M = new(icon)
M.SwapColor(rgb(000,000,000),rgb(180,0,0))
M.SwapColor(rgb(11,11,11),rgb(220,50,50))
icon = M

src.icon=icon
obj
layer=FLOAT_LAYER-1
sharingan
icon='icons/yoursharinganeyefilename.dmi'


Should also take a look at http://www.byond.com/forum/?post=1613721



As far as the topic title saying overlay, you could do, as an example

mob/var/sharingan = 0

mob
verb
Sharingan()
user.overlays += 'yoursharinganeyefilename.dmi'
user << "Sharingan!"
usr.sharingan=1
spawn()
while(user && user.sharingan)
sleep(600)
if(user && user.sharingan==1)
user.sharingan=0
user.overlays-= 'yoursharinganeyefilename.dmi'


(Should know not to copy paste)