applying to one thing means one touchable thing. The [something] token means an object in scope. The full details of scope are complicated, but this short description covers most of the territory:
- directions are always in scope
- if the player can see a thing (i.e., there’s light and it and the player aren’t on opposite sides of any closed opaque containers), it’s in scope
- even if it’s dark, these are always in scope: the player, things enclosed by the player that aren’t also enclosed by a closed opaque container, and, if the player is on or in a thing, the thing they’re on or in.
If you want to allow the player to refer to things out of sight, there are basically two approaches:
- use an
after deciding the scope of the player ruleto place it in scope manually under the appropriate circumstances - define the action is applying to a visible thing and use
anyin the grammar token (yes, to allow interaction with something that isn’t visible, you specifyvisible thing)
If you use applying to one visible thing in the action specification and [any thing] as the grammar token, there’s really nothing stopping its use with any thing in the game, on-stage or off. This is great for debugging actions but for everything else you probably want to qualify the token with an adjective.
Assuming the player will never actually visit the Vault, it doesn’t really need to exist, so I just made a deposited either-or property on things for that adjective instead of creating a deposited adjective by making a definition that checked whether a thing was enclosed by the Vault.
We want to be able to respond to attempts to withdraw things that aren’t in the vault, but [any deposited thing] wouldn’t match them, so I just made a separate invalid-withdrawing action for that case.
The Loan Office is a room.
Ganon is a person in the Loan Office.
Ganon wears a cravat.
A thing can be deposited.
The player holds the crackerjack box.
The toy surprise is in the crackerjack box.
The bees are a plural-named thing in the Loan Office.
Depositing is an action applying to one carried thing.
understand "deposit [thing]" as depositing.
carry out depositing:
now the noun is deposited;
repeat with t running through things enclosed by the noun begin;
now t is deposited;
end repeat;
now the noun is nowhere;
report depositing:
say "Ganon says, 'We will take very good care of your [noun].[line break]";
say "Ganon leaves but returns shortly. He says, '[The noun] [are] now stocked and locked. [They] will be available whenever you want [them].'";
Withdrawing is an action applying to one visible thing.
Understand "withdraw [any deposited thing]" as withdrawing.
Invalid-withdrawing is an action applying to one thing.
Understand "withdraw [something]" as invalid-withdrawing.
Check invalid-withdrawing: instead say "[We] [haven't] deposited [the noun].".
Carry out withdrawing:
now the noun is not deposited;
repeat with t running through things enclosed by the noun begin;
now t is not deposited;
end repeat;
now the player carries the noun;
Report withdrawing: say "Ganon returns with [the noun] and [we] [take] [regarding the noun][them] from him."
test me with "deposit cravat / deposit bees / deposit crackerjack box / withdraw toy / withdraw bees / withdraw Ganon"
As written, this assumes that Ganon knows and can access the contents of any deposited containers. If you wanted him to not “know about” the contents of closed opaque containers and/or to be unable to access the contents of locked containers, some other stuff would be needed.