コード例 #1
0
 def get_action(self, consumer: Actor) -> SingleRangedAttackHandler:
     self.engine.message_log.add_message("Select a target.",
                                         color.needs_target)
     return SingleRangedAttackHandler(
         self.engine,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )
コード例 #2
0
ファイル: consumable.py プロジェクト: voynix/7drl
 def get_action(self, consumer: Actor) -> Optional[ActionOrHandler]:
     self.engine.message_log.add_message("Select a target location",
                                         color.NEEDS_TARGET)
     return SingleRangedAttackHandler(
         self.engine,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )
コード例 #3
0
 def get_action(self, consumer: Actor) -> Optional[actions.Action]:
     self.engine.message_log.add_message("Select a target location.",
                                         color.needs_target)
     self.engine.event_handler = SingleRangedAttackHandler(
         self.engine,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )
     return None
コード例 #4
0
 def get_action(self, consumer: Actor) -> SingleRangedAttackHandler:
     """Chooses the location that the action should be perforemd at"""
     self.engine.message_log.add_message("Select a target location",
                                         color.needs_target)
     return SingleRangedAttackHandler(
         self.engine,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )