示例#1
0
    def __call__(self, actor):
        """
        Performs the drop action

        :param actor: character dropping the item
        :type actor: Character
        """
        add_history_value(actor, 'location')
        add_history_value(actor, 'level')
        add_history_value(actor, 'inventory')
        add_history_value(actor, 'tick')

        set_action_factory(
            ActionFactoryBuilder().with_drink_factory().with_inventory_factory(
            ).build())  # TODO: mutating global state is bad

        drop_item(actor, self.item)
示例#2
0
    def __call__(self, actor):
        """
        Performs the drop action

        :param actor: character dropping the item
        :type actor: Character
        """
        add_history_value(actor, 'location')
        add_history_value(actor, 'level')
        add_history_value(actor, 'inventory')
        add_history_value(actor, 'tick')

        set_action_factory(ActionFactoryBuilder()
                           .with_drink_factory()
                           .with_inventory_factory()
                           .build()) # TODO: mutating global state is bad

        drop_item(actor,
                  self.item)
示例#3
0
 def drop_item(self, item):
     """
     Drop item
     """
     drop_item(self.character,
               item)