X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Factions.py;h=f62b4637174621c3a29e541d4c445e4ece66f715;hb=2a46865fc69e2e90e28bc13255a762279e7a1b29;hp=354d88097bd8c624e37f17b8762f7e9dd69cccf9;hpb=520e32c0dbfb3cdfdf63ea762429f259fe8b7435;p=naja.git diff --git a/naja/actions.py b/naja/actions.py index 354d880..f62b463 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -86,3 +86,13 @@ class AcquireWinToken(LocationAction): board.player.bits.clear_bits(set([ BITS.CYAN, BITS.MAGENTA, BITS.YELLOW, ])) + + +class GainHealthAndClearBitsOrMSB(LocationAction): + TEXT = "Gain health, then clear bits specified by this location or MSB." + USES_MSB = True + + def perform_action(self, board, location): + board.gain_health() + if not self.check_and_clear_MSB(board.player): + board.player.bits.clear_bits(location.bitwise_operand)