A Handy Kit

An interactive fiction by Andrew Plotkin (2006) - the Inform 7 source text

Home page

Contents
Previous

Complete text
Section - Remotes for Triggers

The key transmitter is a remote in the toolcase. Understand "trans" or "antenna" or "disk" or "disc" as the key transmitter. The description is "It's a small [color] disc with a key to press on one side, and a short antenna on the other."
The key transmitter notifies the radio module.
Instead of pushing or switching on the key transmitter:
    change the visible effect to zero;
    if the radio module is not connected and the radio module is visible, instead say "You press the transmitter key. [The radio module][apostrophe]s link dot flashes green in confirmation, but as it isn't linked to anything, that's all.";
    if the radio module is connected,
        activate the partner of the radio module, momentarily;
    if the visible effect is zero,
        instead say "You press the key, and the status dot flashes green, but you perceive no other effect."
Instead of switching off the key transmitter, say "That's not something you can switch off."

The voice transmitter is a remote in the toolcase. Understand "trans" or "antenna" or "audio" or "pickup" or "square" as the voice transmitter. The description is "It's a small [color] square with an audio pickup on one side, and a short antenna on the other. The status dot is [if on]green[otherwise]blue[end if]. The audio keywords are printed along one edge."
The voice transmitter notifies the voice module.
The voice transmitter can be either off or on. The voice transmitter is off.

[These rules make the transmitter sensitive to bare "zap"/"pow" commands. I use "location encloses" test because no containers in this game are soundproof.]
Instead of commanding on when the location encloses the voice transmitter:
    carry out the engaging activity with the voice transmitter.
Instead of commanding off when the location encloses the voice transmitter:
    carry out the disengaging activity with the voice transmitter.

Instead of asking the voice transmitter to try commanding on:
    carry out the engaging activity with the voice transmitter.
Instead of asking the voice transmitter to try commanding off:
    carry out the disengaging activity with the voice transmitter.

Before answering the player that:
    if the topic understood includes "zap", instead try commanding on;
    if the topic understood includes "pow", instead try commanding off.

[There is no way in the current I7 system to make a non-person respond to commands: "voice transmitter, zap". Well, actually there is, but you have to declare the object to be an Inform library animate object -- not very obvious. So I'm leaving this out for now. Feature request filed.]

Rule for engaging the voice transmitter when the voice transmitter is on:
    say "You say the keyword";
    if the voice transmitter is visible, say ", but [the voice transmitter] is already on";
    say "."
Rule for disengaging the voice transmitter when the voice transmitter is off:
    say "You say the keyword";
    if the voice transmitter is visible, say ", but [the voice transmitter] is already off";
    say "."
Rule for engaging the voice transmitter:
    change the voice transmitter to on;
    change the visible effect to zero;
    if the voice module is not connected and the voice module is visible, instead say "You say the keyword. [The voice module][apostrophe]s link dot flashes green in confirmation, but as it isn't linked to anything, that's all.";
    if the voice module is connected,
        activate the partner of the voice module;
    if the visible effect is zero,
        instead say "You say the keyword, and the status dot flashes green, but you perceive no other effect."
Rule for disengaging the voice transmitter:
    change the voice transmitter to off;
    change the visible effect to zero;
    if the voice module is not connected and the voice module is visible, instead say "You say the keyword. [The voice module][apostrophe]s link dot flashes blue in confirmation, but as it isn't linked to anything, that's all.";
    if the voice module is connected,
        deactivate the partner of the voice module;
    if the visible effect is zero,
        instead say "You say the keyword, and the status dot flashes blue, but you perceive no other effect."
    
The voice keywords are part of the voice transmitter. Understand "audio" or "keyword" or "word" or "words" as the keywords. The description is "The keywords for the voice transmitter are 'zap' to switch on, and 'pow' to switch off."
The voice keywords is not perfumizable. ["are not" fails to compile here; bug filed.]
Instead of doing something other than reading or examining the keywords, say "The keywords are only there as a reminder."