projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Standardise music volume
[naja.git]
/
naja
/
actions.py
diff --git
a/naja/actions.py
b/naja/actions.py
index 0ada21be372024131d2175ce54b92fce58933ddb..9f3b221b3af18cf033093465d0306a9ec1ddab93 100644
(file)
--- 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']
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',
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):
def perform_action(self, board, location):
if not self.check_and_clear_MSB(board.player):
+ sound.play_sound('awwww.ogg')
board.lose_health()
board.lose_health()
@@
-101,8
+103,8
@@
class ToggleBits(LocationAction):
class ShiftBits(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']
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):
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)
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):
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,
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):
GLYPHS = (ACTION_GLYPHS.HEAL,)
def perform_action(self, board, location):
+ sound.play_sound('aha.ogg')
board.gain_health()
board.gain_health()
@@
-148,6
+153,7
@@
class GainHealthAndClearBitsOrMSB(LocationAction):
MSB_GLYPH = ACTION_GLYPHS.CLEAR_BITS
def perform_action(self, board, location):
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)
board.gain_health()
if not self.check_and_clear_MSB(board.player):
board.player.bits.clear_bits(location.bitwise_operand)