Power Sources

version 1 by Emily Short

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter: Power

    Section: Power from the wall

    Power Sources creates a kind called wall socket, which is the source of home electricity. Beyond this, it largely depends on Plugs and Sockets by Sean Turner. To create a lamp that can be plugged in, we would write

        A lamp is a device in foo. The lamp incorporates a PS-plug.

    and to indicate that a given room is capable of offering it power:

        The Salon contains a wall socket.

    By default a wall socket has one PS-socket, which is to say that it can have one thing plugged into it. If we wish to extend that, we need only iterate the socket-assigning assertion until our sockets are as buff as we desire:

        Every wall socket incorporates a PS-socket.

    (These function cumulatively.)

    One inherited behavior from Plugs and Sockets is that by default it is not possible for the player to walk away from a socket while carrying a plugged-in object. I quote from the documentation there:

        "One final point: a value called PS-leaving can be either PS-denied or PS-allowed. It is PS-denied by default. When it is PS-denied and the player attempts to leave a location whilst carrying something attached to something not carried, a message will be displayed and the action prevented. If this variable is set to PS-allowed, the action will be okay but all the relevant connections for those things carried will be broken."