return super(InfoAreaWidget, self).handle_event(ev)
if ev.type == pgl.KEYDOWN:
if ev.key in (pgl.K_RETURN, pgl.K_KP_ENTER):
- self.card.actions[self.chosen].perform_action(
- self.state.gameboard, self.card)
+ action = self.card.actions[self.chosen]
+ if not action.check_available(self.state.gameboard.player):
+ print "BEEP!"
+ return True
+ action.perform_action(self.state.gameboard, self.card)
self.state.gameboard.change_mode()
InvalidateTheWorld.post()
return True