X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Factions.py;h=9f3b221b3af18cf033093465d0306a9ec1ddab93;hb=2a3de29aeb0e924ee03ce864222d7228e02a506e;hp=0ada21be372024131d2175ce54b92fce58933ddb;hpb=653d96206e72f07934d6d562e2680ee8b3fb7db9;p=naja.git diff --git a/naja/actions.py b/naja/actions.py index 0ada21b..9f3b221 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -21,7 +21,8 @@ class LocationAction(object): if 'shift' in self.data: substitutions['shift'] = self.data['shift'] - substitutions['direction'] = self.data['direction'] + substitutions['shift_glyph'] = ('{SHIFT_%s}' + % self.data['direction'].upper()) elif 'direction' in self.data: substitutions['rowcol'] = { 'NORTH': 'column', @@ -81,6 +82,7 @@ class LoseHealthOrMSB(LocationAction): def perform_action(self, board, location): if not self.check_and_clear_MSB(board.player): + sound.play_sound('awwww.ogg') board.lose_health() @@ -101,8 +103,8 @@ class ToggleBits(LocationAction): class ShiftBits(LocationAction): - TEXT = "Barrel-shift player %(shift)s bits %(direction)s." - GLYPHS = (ACTION_GLYPHS.CHANGE_BOARD,) + TEXT = "Barrel-shift player bits %(shift_glyph)s %(shift)s." + GLYPHS = (ACTION_GLYPHS.SHIFT_LEFT,) def perform_action(self, board, location): shift = self.data['shift'] @@ -119,6 +121,7 @@ class LoseHealthOrMSBAndSetBits(LocationAction): def perform_action(self, board, location): if not self.check_and_clear_MSB(board.player): + sound.play_sound('awwww.ogg') board.lose_health() board.player.bits.set_bits(location.bitwise_operand) @@ -128,6 +131,7 @@ class AcquireWinToken(LocationAction): GLYPHS = (ACTION_GLYPHS.WINTOKEN,) def perform_action(self, board, location): + sound.play_sound('yipee.ogg') board.acquire_win_token() board.player.bits.clear_bits(set([ BITS.RED, BITS.GREEN, BITS.BLUE, @@ -139,6 +143,7 @@ class GainHealth(LocationAction): GLYPHS = (ACTION_GLYPHS.HEAL,) def perform_action(self, board, location): + sound.play_sound('aha.ogg') board.gain_health() @@ -148,6 +153,7 @@ class GainHealthAndClearBitsOrMSB(LocationAction): MSB_GLYPH = ACTION_GLYPHS.CLEAR_BITS def perform_action(self, board, location): + sound.play_sound('aha.ogg') board.gain_health() if not self.check_and_clear_MSB(board.player): board.player.bits.clear_bits(location.bitwise_operand)