X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Factions.py;h=35f4342a3afc40c74196ce516473599d0ab68ec2;hb=5fe12b55d1908f850145eec16a1ee2c8e61ba6ef;hp=34c84f6660e7ac343e0dc94de2c200c609198fed;hpb=0c5003d45e57223eca4a995952517648a9baa465;p=naja.git diff --git a/naja/actions.py b/naja/actions.py index 34c84f6..35f4342 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -1,5 +1,5 @@ from naja.constants import BITS, CHESS_PIECES -from naja.utils import bit_glyphs +from naja.utils import bit_glyphs, move_glyph class LocationAction(object): @@ -24,9 +24,11 @@ class LocationAction(object): 'EAST': 'row', 'WEST': 'row', }[self.data['direction']] + substitutions['direction'] = '{%s}' % (substitutions['direction'],) if 'chesspiece' in self.data: - substitutions['chesspiece_name'] = self.data['chesspiece'].lower() + substitutions['chesspiece_name'] = move_glyph( + self.data['chesspiece']) if location is None: substitutions['location_bits'] = 'bits specified by this location' @@ -64,7 +66,7 @@ class DoNothing(LocationAction): class LoseHealthOrMSB(LocationAction): - TEXT = "Lose HEALTH or MSB." + TEXT = "Lose {HEALTH} or {MSB}." USES_MSB = True def perform_action(self, board, location): @@ -87,7 +89,7 @@ class ToggleBits(LocationAction): class LoseHealthOrMSBAndSetBits(LocationAction): - TEXT = "Lose HEALTH or MSB, then set %(location_bits)s." + TEXT = "Lose {HEALTH} or {MSB}, then set %(location_bits)s." USES_MSB = True def perform_action(self, board, location): @@ -97,7 +99,7 @@ class LoseHealthOrMSBAndSetBits(LocationAction): class AcquireWinToken(LocationAction): - TEXT = "Gain WINTOKEN, then clear {RED,GREEN,BLUE}." + TEXT = "Gain {WINTOKEN}, then clear {RED,GREEN,BLUE}." def perform_action(self, board, location): board.acquire_win_token() @@ -107,7 +109,7 @@ class AcquireWinToken(LocationAction): class GainHealthAndClearBitsOrMSB(LocationAction): - TEXT = "Gain HEALTH, then clear %(location_bits)s or MSB." + TEXT = "Gain {HEALTH}, then clear %(location_bits)s or {MSB}." USES_MSB = True def perform_action(self, board, location):