Section - Kludge for Accessibility
[The accessibility rules for doors are messed up, so that the ghost would be able to do things to a door even when two rooms away. This attempts to fixt that.]
To decide whether (portal - a door) is out of reach of (subject - a person):
if the holder of the subject is the front side of the portal, decide no;
if the holder of the subject is the back side of the portal, decide no;
decide yes. [This should also take care of the case where the ghost attempts to open a door from the coffin, though in fact that would only arise if you've already locked the ghost in the coffin and so won.]
Before the ghost doing something when the noun is a door (called the portal):
if the ghost is on the bench and action requires a touchable noun, try the ghost exiting; [otherwise we get the unsuccessful action for the ghost doing something to the door without the ghost getting off the bench]
if the portal is out of reach of the ghost:
stop the action.