var/list/PhasedIcons=list()
proc/PhaseWorld()
set background=1
for(var/obj/TurfType/T in world)
T.PhaseAtom()
atom/var/Phase=0
atom/var/DontPhase=0
obj/Phase
layer=5
density=0
invisibility=1
mouse_opacity=0
atom/proc/PhaseAtom(/**/)
if(src.Phase || (src.layer>=5 && !src.density))
if(src.layer>=6 || src.contents.len || src.overlays.len || src.DontPhase) return
src.layer=2.2
var/srcLoc=locate(src.x,src.y,src.z)
for(var/obj/Phase/P in srcLoc) return
var/icon/I
if("[src.icon]" in PhasedIcons) I=PhasedIcons["[src.icon]"]
else {I=src.icon-rgb(0,0,0,150);PhasedIcons["[src.icon]"]=I}
var/obj/Phase/O=new(srcLoc)
O.icon=I;O.icon_state=src.icon_state
O.pixel_x=src.pixel_x;O.pixel_y=src.pixel_y
obj/TurfType
layer=2
density=1
mouse_opacity=0
var/ApplyDensity=0
New()
if(src.layer<=2) src.layer=2.2
if(src.ApplyDensity) src.loc.density=src.density
return ..()
Tree
name = "Tree"
density=0
layer=10
tree/icon='tree.png'
tree2/icon='tree2.png'
tree3/icon='tree3.png'
tree6/icon='Dead Tree.png'
Problem description:
What am I trying to create here is when player will step behind the tree his icon will still be visible but only a little. But this code kinda dont work and i dont know why.