Ejemplo 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")
Ejemplo n.º 2
0
 def notice_players(self, src_room, dst_room, direction_name):
     """docstring for notice_players"""
     msg_go = "%s go to %s.\n" % (self.name, direction_name)
     msg_come = "%s come to here.\n" % (self.name)
     if self.is_mob:
         message_to_room(src_room, msg_go)
         message_to_room(dst_room, msg_come)
     else:
         player = status.PLAYERS[self.name]
         message_to_room(src_room, msg_go)
         player_message_to_room(player, msg_come)