Gain-MSB default action.
[naja.git] / naja / actions.py
index 464b3ae285482c2b6d3967d8687c39759bd78308..c7717ea9062197a618172b59b9a4da6c88a3eda4 100644 (file)
@@ -196,3 +196,11 @@ class AllowChessMoveIfMSB(LocationAction):
             if self.check_and_clear_MSB(board.player):
                 chesspiece = CHESS_PIECES[self.data['chesspiece']]
                 board.allow_chess_move(chesspiece)
+
+
+class GainMSB(LocationAction):
+    TEXT = "Set {MSB}."
+    GLYPHS = (ACTION_GLYPHS.MSB,)
+
+    def perform_action(self, board, location):
+        board.player.bits.set_bit(BITS.MSB)