You might be able to do something like this by making a special “generic hotel door” object and allowing it to be understood by referring to the number. Here’s an attempt. It might be pretty fragile–you’d have to make some more intelligent Understand lines, because right now only “room [number]” will work as a reference to the door, and you’d also have to make sure the non-generic door will work. But maybe it’d be something to help you get started, which wouldn’t require creating every individual door.
[code]A hotel floor is a kind of room. A hotel floor has a number called minimum door number. A hotel floor has a number called maximum door number.
A generic hotel door is a kind of thing. A generic hotel door can be open. A generic hotel door can be openable. A generic hotel door can be locked. A generic hotel door is privately-named, openable, closed, locked, and scenery. Understand “door [number]” as a generic hotel door.
The most recent room referred to is a number that varies. The most recent room referred to is initially 101.
First before doing anything when the current action involves a generic hotel door: now the most recent room referred to is the number understood.
Before doing anything when the current action involves a generic hotel door and (the most recent room referred to is less than the minimum door number of the location or the most recent room referred to is greater than the maximum door number of the location): say “You can only see doors [minimum door number of the location] to [maximum door number of the location] here.” instead.
Instead of doing anything other than examining when the current action involves a generic hotel door: say “The door is locked.”
The printed name of a generic hotel door is usually “door [most recent room referred to]”.
The description of a generic hotel door is usually “It looks like all the other doors.”
Every hotel floor contains a generic hotel door.
The description of a hotel floor is usually “You can see doors [minimum door number of the item described] to [maximum door number of the item described] here.”
Hotel Floor One is a hotel floor. The minimum door number of Hotel Floor One is 101. The maximum door number of Hotel Floor One is 105.
Hotel Floor Two is a hotel floor. Hotel Floor Two is above Hotel Floor One. The minimum door number of Hotel Floor Two is 201. The maximum door number of Hotel Floor Two is 205.
To decide whether the current action involves a generic hotel door: [there’s a syntax “if the current action involves [object]” documented in §12.20, but it only applies to specific named objects. So we hack up a special routine for hotel doors. This is a way of saying “I tried using the syntax on generic hotel doors and got a compiler error.”]
if the noun is a generic hotel door, yes;
if the second noun is a generic hotel door, yes;
no.
The player carries a key.
Instead of going in a hotel floor when the noun is east or the noun is west: say “You’ll have to find a door that you can open first.”[/code]
…oh, and as a matter of design it might be a good idea to include some indication that the way to do things isn’t to knock on all sixty doors in turn. Like, after the fifth time the player does something to a generic door, say something like “You need to think about which door you want.” You could drop progressively stronger hints. This shouldn’t be at all hard to implement–you could have a counter that you increment in the rule for doing things involving generic hotel doors (I should name those rules!) that dispenses suggestions when the counter reaches certain values.