Improving this? in Developer Help
|
|
A friend of mine made this for me about two years ago and recently I've been wondering if it could be... well, improved somehow (efficiency-wise, coding-wise, etc).
mob effects verb Tornado() set category = "Effects" if(tornado) tornado = FALSE return FALSE else var radius = input("Radius?", "Radius") as null | num if(radius && radius <= world.view) tornado = TRUE
while(tornado) for(var/atom/movable/O in view(radius)) if(O.anchor) continue var _x = O.x - x _y = O.y - y _dir = get_dir(loc, O.loc) switch(_dir) if(NORTH) O.x-- if(WEST) O.y-- if(SOUTH) O.x++ if(EAST) O.y++ if(NORTHEAST) if(_y > _x) O.x-- if(_x > _y) O.y++ if(abs(_x) == abs(_y)) O.x-- if(NORTHWEST) if(abs(_y) > abs(_x)) O.x-- if(abs(_x) > abs(_y)) O.y-- if(abs(_x) == abs(_y)) O.y-- if(SOUTHWEST) if(abs(_y) > abs(_x)) O.x++ if(abs(_x) > abs(_y)) O.y-- if(abs(_x) == abs(_y)) O.x++ if(SOUTHEAST) if(abs(_y) > abs(_x)) O.x++ if(abs(_x) > abs(_y)) O.y++ if(abs(_x) == abs(_y)) O.y++ sleep(1)
|
|