atom
movable
proc
//analogous to Enter()
StepOn(atom/movable/A)
//always allow an object to step on itself
if(A == src) return 1
//do not allow two dense objects in the same turf
else return !(density & A.density)
//analogous to Exit()
StepOff(atom/movable/A)
//always allow stepping off of something by default
return 1
//analogous to Entered()
SteppedOn(atom/movable/A)
//analogous to Exited()
SteppedOff(atom/movable/A)
turf
Enter(atom/movable/A)
//don't allow dense movables onto dense turfs
if((density | loc.density) & A.density) return 0
else
//check contents of this turf for something else that will block A
for(var/atom/movable/M in src)
if(M != A)
if(!M.StepOn(A))
return 0
return 1
Exit(atom/movable/A)
//check for something that will prevent A exiting src
for(var/atom/movable/M in src)
if(M != A)
if(!M.StepOff(A))
return 0
return 1
Entered(atom/movable/A)
//perform the default action
..()
//call SteppedOn() for everything in contents
for(var/atom/movable/M in src)
if(M != A)
M.SteppedOn(A)
Exited(atom/movable/A)
..()
for(var/atom/movable/M in src)
if(M != A)
M.SteppedOff(A)
ID:195030
Aug 21 2009, 7:22 am (Edited on Jul 17 2010, 6:52 am)
|
|
As shown by Garthor in ID:713188, this procedure is used to call StepOn()/StepOff()/SteppedOn()/SteppedOff() on an /atom/movable family members (including /obj and /mob) - which gives the effect of Enter()/Exit()/Entered()/Exited() of /turf and /area.
|
Oct 22 2009, 3:39 pm
|
|
Not entirely relevant, but your id: link doesn't go to the correct forum.
|