WARNING! I don’t really know what I’m doing and what problems this code might cause.
It seems to me that if you want “Do X with Y and Z” you might be able to fudge it up by declaring that the second takes multiple objects and then using the multiple-object list, thus:
[code]Jewelry Store is a room. “A jewelry store with a locked door to the north.” The glass case is a transparent locked container in Jewelry Store. It is fixed in place. It contains a ring. The safe is a locked container in Jewelry store. It is fixed in place. It contains a pendant. The glass box is a transparent openable container in Jewelry Store.
The street is a room.
The store door is a door. It is scenery. The store door is north of Jewelry store and south of the street. The store door is locked.
The player carries a thingummy, a hoojab, and a whatsit. The description of the thingummy is “A thingummy. You can use it and the hoojab together to pick a lock.” The description of the hoojab is “A hoojab. You can use it and the thingummy together to pick a lock.” The description of the whatsit is “A whatsit. It… doesn’t really do anything.”
Picking it with is an action applying to one thing and one visible thing. Understand “Pick [something] with [things]” as picking it with. [The second noun is “visible,” meaning that we don’t have to touch it to perform the action, because our “check picking” rule requires us to be able to pick it up anyway. So if one of our lockpicks is visible but not reachable the action will be stopped when we try to pick it up. Making the second noun visible prevents Inform from doing extra accessibility checks; otherwise, if we tried “pick safe with thingummy and hoojab” when the hoojab couldn’t be accessed, we’d get one “failed the basic accessbility rule” message when we tried to take the hoojab while checking picking the safe with the thingummy, and another “failed the basic accessibility rule” while picking the safe with the hoojab.]
Check picking:
if picking-completed is true:
stop the action;
otherwise if the noun is not locked:
say “[The noun] is not locked.”; [this is short a line break, for reasons I don’t understand]
now picking-completed is true;
stop the action;
otherwise: [we try to pick up everything we’re using to pick before doing anything else]
repeat with item running through the multiple object list:
if the player does not hold the item:
say “(first taking [the item])[command clarification break]”;
try taking the item;
if the player does not hold the item:
now picking-completed is true;
stop the action.
Picking-completed is a truth state that varies. Picking-completed is usually false.
After reading a command: now picking-completed is false.
Carry out picking:
if picking-completed is true:
stop the action;
let L be the multiple object list;
unless L is {thingummy, hoojab} or L is {hoojab, thingummy}:
say “You need both the thingummy and hoojab to pick a lock, and nothing else.”;
now picking-completed is true;
stop the action;
otherwise:
say “Using the thingummy and the hoojab, you unlock [the noun].”;
now picking-completed is true;
now the noun is unlocked.
The silently announce items from multiple object lists rule is listed instead of the announce items from multiple object lists rule in the action-processing rules.
This is the silently announce items from multiple object lists rule:
unless picking:
if the current item from the multiple object list is not nothing, say “[current item from the multiple object list]: [run paragraph on]”.
After going north from Jewelry Store:
if the player carries the ring and the player carries the pendant:
say “Success!”;
end the story saying “You’re a great burglar”;
otherwise:
say “You get away without everything you came for.”;
end the story saying “Oh well”.
[/code]
This is obviously very non-robust – it lets you pick anything with the thingummy and the hoojab, and it would take some messing around with lists to allow for other lockpick sets. Also the rule-succeeds/rule-fails business is kind of messed up; if the object is already unlocked, then the rule is deemed to have succeeded. And there’s a missing line break (which, if it’s consistent, could just be added in manually). And you really want to let people pick the lock, instead of the case/door/safe. And probably redirect unlocking to picking where appropriate. But it might be a start.
The example “The Left Hand of Autumn” might be useful here; it’s where I got the “silently announce items etc.” rule, which prevents extraneous “thingummy:” and "hoojab:"s from appearing.
All that said, I think tove is right that it’s enough to let people pick locks with one thing. Note also that I know even less of the art of lockpicking than she does (not that I believe your protestations of ignorance, Ms. Byzantine Perspective).
Also, this method won’t work at all for commands like “Put butter on bread with knife”; it only works because the multiple-object list and [things] token allow us to cram more than one noun into the second-noun slot.
[UPDATED because I forgot to make the door scenery.]
[UPDATED Oct. 2013: The code for implicitly taking the lockpicks was all messed up; changed it.]