I made it work with open and closed doors (you can’t open a blocked door, and you can’t traverse an open door with a filing cabinet blocking it). I also made a verb so if an object is declared an “impediment” the player can use it to block a door. If you want to prevent NPCs moving through blocked doors, it will require some additional “check an actor/carry out an actor” rules.
[code]“Blocking/Barring Test” by Hanon Ondricek
a thing can be an impediment. a thing can be blockable. A door is usually blockable.
blocking relates one door to various things. The verb to block implies the reversed blocking relation.
Last report examining a thing (called D):
if something blocks D:
say “[The noun] is blocked by [a list of things blocking D].”
Check opening a door (called D):
if something blocks D:
say “[The D] is blocked by [a list of things blocking D], so it won’t open easily.” instead.
Check going through a door (called D):
if something blocks D:
say “[The D] is blocked by [a list of things blocking D]. You’ll need to move [if the number of things blocking D is 1]it[otherwise]them[end if] first.” instead.
Carry out taking:
if the noun blocks something:
say “(First moving [the noun] out of the way of [the random thing blocked by the noun].)[command clarification break]”;
now the noun blocks nothing.
Check pushing something (called I):
if I blocks something:
try taking I instead.
barring is an action applying to two things. Understand “block [something] with [something preferably held]” and “bar [something] with [something preferably held]” and “obstruct [something] with [something preferably held]” as barring.
Check barring:
if the second noun is not an impediment:
say “[The second noun] isn’t a suitable thing to block [the noun].” instead.
Check barring:
if the noun is not blockable:
say “You see no good way to block [the noun].” instead.
Carry out barring:
now the second noun blocks the noun;
now the second noun is in the location.
Report barring:
say “You manage to obstruct [the noun] with [the second noun] as well as you can.”
Last report examining:
if the noun blocks something:
say “[The noun] is blocking [the random thing blocked by the noun].”
Example Location is a room.
Success Location is a room.
a battered door is a door. It is north of Example Location and south of Success Location. “A battered door is your only way out to the [direction of battered door from the location].”
a splintery plank is an impediment in Example Location. It blocks battered door.
a flimsy bent wood chair is an impediment in example location. It blocks battered door. It is an impediment.
a short filing cabinet is a container in example location. It blocks battered door. It is an impediment.
A plate of spaghetti is in Example Location.
Check taking short filing cabinet:
say “Ugh, it’s a little heavy to pick up, but you do manage to budge it a few feet from where it was.”;
now short filing cabinet blocks nothing;
rule succeeds.
Test me with “n/open door/take plank/n/move chair/push cabinet/open door/n/l/s/take spaghetti/block door with spaghetti/block door with chair/n/push chair/n”[/code]