예제 #1
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        lock_lock(lockable)
        EntityAction.execute(self)
예제 #2
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        unlock_lock(lockable)
        EntityAction.execute(self)
예제 #3
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        move_agent = getattr(self.target, MoveAgent.registered_as)
        agent = getattr(self.performer, Agent.registered_as)
        agent.new_map = move_agent.target_map
        agent.new_position = move_agent.target_position
        agent.new_layer = move_agent.target_layer
        EntityAction.execute(self)
예제 #4
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.

        Returns:
            The text of the readable
        """
        readable = getattr(self.target, Readable.registered_as)
        text = _(readable.text)  # pylint: disable=E0602
        EntityAction.execute(self)
        return text
예제 #5
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.

        Returns:
            The text of the readable
        """
        readable = getattr(self.target, Readable.registered_as)
        text = _(readable.text)  # pylint: disable=E0602
        EntityAction.execute(self)
        return text
예제 #6
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        move_agent = getattr(self.target, MoveAgent.registered_as)
        agent = getattr(self.performer, Agent.registered_as)
        agent.new_map = move_agent.target_map
        agent.new_position = (move_agent.target_position.x,
                              move_agent.target_position.y,
                              move_agent.target_position.z)
        agent.new_layer = move_agent.target_layer
        EntityAction.execute(self)
예제 #7
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.

        Returns: A text describing the target.
        """
        description = getattr(self.target, Description.registered_as)
        # pylint: disable=E0602
        text = _("You see %s. \n%s") % (_(
            description.view_name), _(description.desc))
        # pylint: enable=E0602
        EntityAction.execute(self)
        return text
예제 #8
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.

        Returns: A text describing the target.
        """
        description = getattr(self.target, Description.registered_as)
        # pylint: disable=E0602
        text = _("You see %s. \n%s") % (_(description.view_name),
                                        _(description.desc))
        # pylint: enable=E0602
        EntityAction.execute(self)
        return text
예제 #9
0
파일: close.py 프로젝트: fife-rpg/fife-rpg
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        close_lock(lockable)
        if FifeAgent.registered_as:
            fifeagent_data = getattr(self.target, FifeAgent.registered_as)
            if fifeagent_data:
                behaviour = fifeagent_data.behaviour
                behaviour.act(lockable.close_action)
                behaviour.queue_action(lockable.closed_action, repeating=True)

        EntityAction.execute(self)
예제 #10
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        open_lock(lockable)
        if FifeAgent.registered_as:
            fifeagent_data = getattr(self.target, FifeAgent.registered_as)
            if fifeagent_data:
                behaviour = fifeagent_data.behaviour
                behaviour.act(lockable.open_action)
                behaviour.queue_action(lockable.opened_action, repeating=True)

        EntityAction.execute(self)