I just can’t get check/carry out/report sorted out.
I’ve got a coin slot that is only supposed to work with a token which will unlock a door.
-
If the token is dropped in the coin slot, the token should disappear (sending it to the limbo-ish “Blockland”), and the door should be unlocked.
-
A metal blank should not trigger the door to unlock and should end up in the coin return.
-
Anything other than these two items should not even be allowed to be put in the coin slot and give a message saying as much.
I’ve tried many, many variations on check, carry out, report code along with various instead and before code. Clearly I’m missing something because when I put anything (token, metal blank, or toaster) in the coin slot, I just get the message “You put the token/metal blank/toaster in the coin slot.”
I want to allow the verbs “drop” or “put” to work here rather than defining a new action for putting the token in the coin slot.
[code]The coin slot is in the Upper Hallway. The coin slot is a container. The coin slot is open. The coin slot is not portable. Understand “coin slots” as the coin slot.
The coin return is a container. The coin return is in the coin slot. The coin return is open. The coin return is not portable.
Check dropping in the coin slot:
if the player is not carrying the token or the player is not carrying the metal blank:
say “That won’t fit in the coin slot. Maybe try something more token-ish?” instead.
Carry out dropping the metal blank in the coin slot:
now the metal blank is in the coin return.
Carry out dropping the token in the coin slot:
now the token is in Blockland;
now the green door is unlocked.
Report dropping the metal blank in the coin slot:
say “The metal blank pops out in the coin return leaving the door locked. Obviously, this isn’t a token.”.
Report dropping the token in the coin slot:
say “You hear the token drop into a coin box, and the lock on the door disengages.”.[/code]
So yeah, I’m clearly missing something key here. Any help would be so, so appreciated.