Ejemplo n.º 1
0
    def execute(self, character: Character, param_string: str):
        game_manager = GameManager()

        game_manager.add_action_absolute(
            0,
            Action('chat',
                   character_id=character.id,
                   data={'msg': param_string}))
Ejemplo n.º 2
0
    def execute(self, character: Character, param_string: str):
        if not param_string:
            character.do_action(
                Action('seeroom',
                       character_id=character.id,
                       room_id=character.room_id))
        else:
            room_manager = RoomManager()
            room = room_manager.get_room(character.room_id)
            direction = string_utils.parse_word(param_string)
            portal = room.find_portal(direction)

            game_manager = GameManager()
            game_manager.add_action_absolute(
                0,
                Action('attemptseethroughportal',
                       character_id=character.id,
                       portal_id=portal.id,
                       data={'direction': direction}))
Ejemplo n.º 3
0
    def execute(self, character: Character, param_string: str):
        if not param_string:
            character.do_action(
                Action('error',
                       data={'msg': 'Please specify a direction!<$nl>'}))
            return

        room_manager = RoomManager()
        room = room_manager.get_room(character.room_id)

        portal = room.find_portal(param_string)
        game_manager = GameManager()

        game_manager.add_action_absolute(
            0,
            Action('attemptenterportal',
                   character_id=character.id,
                   portal_id=portal.id,
                   data={'direction': param_string}))