- &TOGGLE-BITS-DEFAULT
action_class: 'ToggleBits'
required_bits: []
+ - &TOGGLE-BITS-HARM-DEFAULT
+ action_class: 'ToggleBitsAndHarm'
+ required_bits: []
- &BAD-DEFAULT
action_class: 'LoseHealthOrMSB'
required_bits: []
- *SHIFT-W
- *HEAL-RB
+ - &SHIFT-N-AND-HARM
+ card_name: 'shift-n-harm'
+ actions:
+ - *TOGGLE-BITS-HARM-DEFAULT
+ - *SHIFT-N
+ - *HEAL-RG
+ - &SHIFT-S-AND-HARM
+ card_name: 'shift-s-harm'
+ actions:
+ - *TOGGLE-BITS-HARM-DEFAULT
+ - *SHIFT-S
+ - *HEAL-RG
+ - &SHIFT-E-AND-HARM
+ card_name: 'shift-e-harm'
+ actions:
+ - *TOGGLE-BITS-HARM-DEFAULT
+ - *SHIFT-E
+ - *HEAL-RB
+ - &SHIFT-W-AND-HARM
+ card_name: 'shift-w-harm'
+ actions:
+ - *TOGGLE-BITS-HARM-DEFAULT
+ - *SHIFT-W
+ - *HEAL-RB
+
- &ROT-CW-AND-SET
card_name: 'rot-cw-set'
actions:
- *SHIFT-W
- *BITSHIFT-L
+ - &MEAN-CARD
+ card_name: 'mean-card'
+ actions:
+ - *BAD-DEFAULT
+
+ - &REALLY-MEAN-CARD
+ card_name: 'mean-card'
+ actions:
+ - action_class: 'ClearBitsAndHealth'
+ required_bits: []
+ - action_class: 'LoseHealthOrMSB'
+ required_bits: [RED]
+
cards:
- *WIN-CARD-1
- *WIN-CARD-2
- *SHIFT-S-AND-HEAL
- *SHIFT-E-AND-HEAL
- *SHIFT-W-AND-HEAL
+ - *SHIFT-N-AND-HARM
+ - *SHIFT-S-AND-HARM
+ - *SHIFT-E-AND-HARM
+ - *SHIFT-W-AND-HARM
- *SHIFT-E-BITSHIFT
- *SHIFT-W-BITSHIFT
- *ROT-CW-AND-SET
- *ROT-CCW-AND-SET
+ - *MEAN-CARD
+ - *REALLY-MEAN-CARD
replacement_params:
chance: 0.2
'data': self.data,
'action_class': self.__class__.__name__}
+ def take_damage(self, board):
+ sound.play_sound('awwww.ogg')
+ board.lose_health()
+
class DoNothing(LocationAction):
TEXT = "No effect."
def perform_action(self, board, location):
if not self.check_and_clear_MSB(board.player):
- sound.play_sound('awwww.ogg')
- board.lose_health()
+ self.take_damage(board)
class SetBits(LocationAction):
board.player.bits.clear_bits(location.bitwise_operand)
+class ClearBitsAndHealth(LocationAction):
+ TEXT = "Clear %(location_bits)s and {HEALTH}."
+ GLYPHS = (ACTION_GLYPHS.CLEAR_BITS, ACTION_GLYPHS.DAMAGE)
+
+ def perform_action(self, board, location):
+ board.player.bits.clear_bits(location.bitwise_operand)
+ self.take_damage(board)
+
+
class ToggleBits(LocationAction):
TEXT = "Toggle %(location_bits)s."
GLYPHS = (ACTION_GLYPHS.TOGGLE_BITS,)
board.player.bits.toggle_bits(location.bitwise_operand)
+class ToggleBitsAndHarm(LocationAction):
+ TEXT = "Toggle %(location_bits)s and lose {HEALTH}."
+ GLYPHS = (ACTION_GLYPHS.TOGGLE_BITS, ACTION_GLYPHS.DAMAGE)
+
+ def perform_action(self, board, location):
+ board.player.bits.toggle_bits(location.bitwise_operand)
+ self.take_damage(board)
+
+
class GenericBits(LocationAction):
GLYPHS = (ACTION_GLYPHS.SET_BITS, ACTION_GLYPHS.CLEAR_BITS)