コード例 #1
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),
     )
コード例 #2
0
 def get_action(self, consumer: Actor) -> AreaRangedAttackHandler:
     self.engine.message_log.add_message("Select a target location.",
                                         color.needs_target)
     return AreaRangedAttackHandler(
         self.engine,
         radius=self.radius,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )
コード例 #3
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 AreaRangedAttackHandler(
         self.engine,
         radius=self.radius,
         callback=lambda xy: actions.ItemAction(consumer, self.parent, xy),
     )
コード例 #4
0
ファイル: consumable.py プロジェクト: ewingd/tcod_tutorial
 def get_action(self, consumer: Actor) -> Optional[SingleRangedAttackHandler]:
     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),
     )
コード例 #5
0
 def get_action(self, consumer: Actor) -> Optional[ActionOrHandler]:
     """Try to return the action for this item."""
     return actions.ItemAction(consumer, self.parent)
コード例 #6
0
 def get_action(self, consumer: Actor) -> Optional[actions.Action]:
     # Try to return the action for this item.
     return actions.ItemAction(consumer, self.parent)
コード例 #7
0
 def get_action(self, consumer: Actor) -> Optional[ActionOrHandler]:
     return actions.ItemAction(consumer, self.parent)
コード例 #8
0
 def get_action(self, consumer: Actor) -> Optional[ActionOrHandler]:
     """Пытается вернуть действие для этого элемента."""
     return actions.ItemAction(consumer, self.parent)