- if self.check_and_clear_MSB(board.player):
- board.acquire_win_token()
- board.player.bits.clear_bits(set([
- BITS.CYAN, BITS.MAGENTA, BITS.YELLOW,
- ]))
+ board.gain_health()
+ if not self.check_and_clear_MSB(board.player):
+ board.player.bits.clear_bits(location.bitwise_operand)
+
+
+class ShiftLocations(LocationAction):
+ TEXT = "Shift current %(rowcol)s %(direction)s."
+
+ def perform_action(self, board, location):
+ board.shift_locations(self.data['direction'])
+
+
+class AllowChessMove(LocationAction):
+ TEXT = "Move like a %(chesspiece_name)s for one turn."
+
+ def perform_action(self, board, location):
+ if self.data['chesspiece'] in CHESS_PIECES:
+ chesspiece = CHESS_PIECES[self.data['chesspiece']]
+ board.allow_chess_move(chesspiece)