Esempio n. 1
0
def goto(player, args):
    """
    admin only. goto any room.
    useage: goto <x> <y> <map_name>
    """
    #. parse args
    if len(args) == 3:
        x, y, map_name = args
    elif len(args) == 2:
        x, y = args
        map_name = player.character.map_name
    else:
        return invalid_args(player)
    try:
        x, y = int(x), int(y)
    except Exception:
        return invalid_args(player)
    #. move player
    src_room, dst_room = status.WORLD.move_character_to(player.character, (x, y), map_name)
    if src_room and dst_room:
        message_to_room(src_room, "%s leave here.\n" % (player.character.name))
        player_message_to_room(player, "%s come to here.\n" % (player.character.name))
        return look(player, None)
    else:
        player.send("You can't!\n")
Esempio n. 2
0
def west(player, args):
    """
    go to west.
    useage: west
    alias: w
    """
    if not player.character.go_west():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 3
0
def down(player, args):
    """
    go to down.
    useage: down
    alias: d
    """
    if not player.character.go_down():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 4
0
def up(player, args):
    """
    go to up.
    useage: up
    alias: u
    """
    if not player.character.go_up():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 5
0
def south(player, args):
    """
    go to south.
    useage: sourth.
    alias: s
    """
    if not player.character.go_south():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 6
0
def north(player, args):
    """
    go to north.
    useage: north
    alias: n
    """
    if not player.character.go_north():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 7
0
def east(player, args):
    """
    go to east.
    useage: east
    alias: e
    """
    if not player.character.go_east():
        player.send("You can't !\n")
    else:
        return look(player, None)
Esempio n. 8
0
 def notice_follwers(self, direction):
     """notice all followers to move in the same room"""
     for follower in self.followers:
         #. follower must be in the same room
         if follower.xy == self.prev_xy and follower.map_name == self.prev_map_name:
             if not follower.is_mob:
                 player = status.PLAYERS[follower.get_name()]
                 player.send("You follow the %s's steps!\n" % (self.get_name()))
                 look(player, None)
             if direction == UP:
                 follower.go_up()
             if direction == DOWN:
                 follower.go_down()
             if direction == WEST:
                 follower.go_west()
             if direction == EAST:
                 follower.go_east()
             if direction == NORTH:
                 follower.go_north()
             if direction == SOUTH:
                 follower.go_south()