Пример #1
0
    def ability_untunnel(self, sentence):
        """untunnel {direction}

Untunnel removes both directions of the exit in the given direction. (e.g. If
you "untunnel west", it will block the exit leading west, as well as the exit
leading east from the room that the west exit used to connect to.) See also
"tunnel", compare "barricade", "undig"."""

        direction = sentence.directString()
        otherPlace = self.place.findExit(direction)
        self.place.disconnectExit(direction)
        otherPlace.disconnectExit(geometry.reverse(direction))
Пример #2
0
    def ability_dig(self, sentence):
        """dig {direction}

Dig creates a new room (and an exit to that room from the current room, and
back again) in the direction specified. See also "undig" to totally undo this
process, or "tunnel" and "barricade" to edit or create new exits for your
new room."""
        direction = sentence.directString()
        try:
            name = sentence.indirectString("to")
        except:
            name = "Untitled Room"
        p = self.place
        r = room.Room(name, self.reality)
        p.connectExit(direction, r)
        r.connectExit(geometry.reverse(direction), p)
        if self.code_space.has_key("log_dig") and self.code_space["log_dig"] is not None:
            self.code_space["log_dig"](self.name, r, time.time())
Пример #3
0
    def ability_tunnel(self, sentence):
        """untunnel {direction} to {room}

Tunnel creates a new, two-way passage in the room you are currently in, which
links to the room specified with "to" and back again. (For example, "tunnel
west to mansion cellar" would create a new exit to the west, leading to the
"mansion cellar" room, and also add an east exit to "mansion cellar" that led
back to the room you're currently in.) This can be easily undone with
"untunnel". Compare "dig" and ""."""

        direction = sentence.directString()
        try:
            rs = sentence.indirectString("to")
            r = self.reality.get(rs)
            p = self.place
            p.connectExit(direction, r)
            r.connectExit(geometry.reverse(direction), p)
        except:
            self.hears('Please specify a destination room! (For example, "dig west to mansion cellar")')