Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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
Exemple #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
Exemple #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)
Exemple #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
Exemple #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
Exemple #9
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)
        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)
Exemple #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)