Powerlines in Developer Help
|
|
I am trying to make it so that when you create the world all the powerlines in the world will orient themselves depending on whether there are powerlines next to it.
It does not collaborate itself correctly. Instead it stays the default icon.
atom proc Offset(D, xo, yo) var/J = yo switch(D) if(2) xo = -xo yo = -yo if(4) yo = -xo xo = J if(8) yo = xo xo = -J return locate(x + xo, y + yo, 1) IPL(T) if(T && istype(T, /turf/wall)) return 1 if(T && istype(T, /turf/floor)) return 1 for(var/obj/electronics/powerlines/O in world) if(istype(O, /obj/electronics/powerlines)) return 1 turf var powerlines obj electronics powerlines layer = MOB_LAYER +1 icon = 'powerlines.dmi' New() ..() var I K for(K in nsew) if(!IPL(Offset(K, 0, 1))) I += K if(I in list(3,12)) icon_state = num2text(I)
|
|