- if ev.key in (pgl.K_RETURN, pgl.K_KP_ENTER):
- self.state.gameboard.change_mode()
- self.card.actions[self.chosen].perform_action(
- self.state.gameboard, self.card)
- InvalidateTheWorld.post()
- return True
- if ev.key in (pgl.K_UP, pgl.K_w):
+ if ev.key in KEYS.SELECT:
+ player = self.state.gameboard.player
+ action = self.card.actions[self.chosen]
+ if not action.check_available(player):
+ print "BEEP!"
+ else:
+ action.perform_action(self.state.gameboard, self.card)
+ self.state.gameboard.replace_card(player.position)
+ self.state.gameboard.change_mode()
+ return finish_event()
+ if ev.key in KEYS.UP: