Booths are weird, aren’t they? Especially closeable ones. I have almost always gotten in the habit of implementing them as adjacent Rooms if they have doors, as getting doors to work on a booth is more work than worth, probably.
That said, let’s say, for the sake of argument, you are pot committed to using a closeable booth, and don’t want nonsensical responses to players trying to look at the door. Here is the pattern I backed into to implement that. Note, I don’t try to use real doors, but ‘fake’ them, and rely on booth status itself to keep things coherent. Also need to do some work to ensure only one ‘side’ of door visible at a time. Is there a cleaner solution I am missing? Looked briefly at expanding on ContainerDoor but that presumes a Complex Container, and adding the Inner Door implementation felt even kludgier.
containingRoom : Room 'Room with Booth' 'booth room'
"A room with a booth in it. "
// etc...
;
+ Openable, Fixture '(booth) door*doors' 'booth door'
"A functional enough door. "
// when booth is open, both sides of door can be visible!
// ensure outside of door only visible when outside booth
addToSenseInfoTable(sense, tab) {
if (gPlayerChar.isDirectlyIn(containingRoom))
inherited(sense, tab);
}
masterObject = standaloneBooth
;
+ standaloneBooth : Openable, Booth, Fixture
'standalone booth' 'standalone booth'
"A standalone booth, close but not claustrophobic. "
isLookAroundCeiling(actor, pov) { return true; }
;
++ Openable, Component '(booth) door*doors' 'booth door'
"A functional enough door. "
// and the converse, only visible on inside
addToSenseInfoTable(sense, tab) {
if (gPlayerChar.isIn(standaloneBooth))
inherited(sense, tab);
}
masterObject = standaloneBooth
;
As an additional step, could add ThingStates for open/closed to respond to player >X OPEN DOOR Kind of wild those don’t preexist in adv3!
(note example above not compiled/tested, streamlined from tested version)
EDIT: outside of door should be Fixture, not Component