- &BAD-DEFAULT
action_class: 'LoseHealthOrMSB'
required_bits: []
+ - &SET-MSB-DEFAULT
+ action_class: 'GainMSB'
+ required_bits: []
- &KNIGHT-MSB-DEFAULT
action_class: 'AllowChessMoveIfMSB'
- &KNIGHT-AND-SET
card_name: 'knight_set'
actions:
- - *BAD-DEFAULT
+ - *SET-MSB-DEFAULT
- *SET-BITS-B
- *KNIGHT-MOVE
- &CASTLE-AND-SET
card_name: 'castle_set'
actions:
- - *BAD-DEFAULT
+ - *SET-MSB-DEFAULT
- *SET-BITS-G
- *CASTLE-MOVE
- &BISHOP-AND-SET
card_name: 'bishop_set'
actions:
- - *BAD-DEFAULT
+ - *SET-MSB-DEFAULT
- *SET-BITS-R
- *BISHOP-MOVE
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)