ID:139311
 
Code:
mob
proc
Dash_Effect(location)
var/obj/d1 = new()
d1.name = "[src] Dash Mode"
d1.icon = src.icon
d1.overlays = src.overlays
d1.dir = src.dir
d1.loc = location
d1.icon -= rgb(120,120,120,160)
spawn(5) del(d1)
mob
verb
Dash()
set hidden = 1
usr.dashing = 1
step(usr,usr.dir)
usr.Dash_Effect(usr.loc)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
sleep(1)
usr.Dash_Effect(usr.loc)
step(usr,usr.dir)
usr.dashing = 0


Problem description:

When I or someone dash, game become laggy while dashing.

It's because you're actively modifying their icon every single time it's called. modifying an icon during run-time is process heavy and should only be done in special cases.

You'd be better off making an icon state that is the color you want, or using an overlays with alpha levels while they're dashing to give the effect.
In response to Bravo1
Bravo1 wrote:
It's because you're actively modifying their icon every single time it's called. modifying an icon during run-time is process heavy and should only be done in special cases.

You'd be better off making an icon state that is the color you want, or using an overlays with alpha levels while they're dashing to give the effect.

And for people who cant icon ;) ?
In response to LaNuiit
Well, you could always use the code to create it for you since it's a simple rgb modification, and then it can save the modified state into your icon with a different state name.