X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Factions.py;h=08d63693bf1c4915b1886177acba5b286ec934e2;hb=HEAD;hp=07d9d0a14bc86dc3cecefbf4e8c1b3f383563629;hpb=5b8bd6cbb4e8fc7268b83a948c7d7808c1645370;p=naja.git diff --git a/naja/actions.py b/naja/actions.py index 07d9d0a..08d6369 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -94,7 +94,7 @@ class DoNothing(LocationAction): class LoseHealthOrMSB(LocationAction): - TEXT = "Lose {HEALTH} or {MSB}." + TEXT = "Lose {MSB} or {HEALTH}." MSB_GLYPH = ACTION_GLYPHS.DAMAGE def perform_action(self, board, location): @@ -233,7 +233,7 @@ class ShiftBits(LocationAction): class LoseHealthOrMSBAndSetBits(LocationAction): - TEXT = "Lose {HEALTH} or {MSB}, then set %(location_bits)s." + TEXT = "Lose {MSB} or {HEALTH}, then set %(location_bits)s." GLYPHS = (ACTION_GLYPHS.SET_BITS,) MSB_GLYPH = ACTION_GLYPHS.DAMAGE @@ -276,7 +276,7 @@ class GainHealth(LocationAction): class GainHealthAndClearBitsOrMSB(LocationAction): - TEXT = "Gain {HEALTH}, then clear %(location_bits)s or {MSB}." + TEXT = "Gain {HEALTH}, then clear {MSB} or %(location_bits)s." GLYPHS = (ACTION_GLYPHS.HEAL,) MSB_GLYPH = ACTION_GLYPHS.CLEAR_BITS @@ -296,6 +296,12 @@ class ShiftLocations(LocationAction): board.shift_locations( self.data['direction'], self.data.get('skip_current', True)) + if self.data.get('move_player', False): + pos = { + 'NORTH': (0, -1), 'SOUTH': (0, 1), + 'EAST': (1, 0), 'WEST': (-1, 0), + }.get(self.data['direction'], (0, 0)) + board.player.force_position(pos, delta=True) class RotateLocations(LocationAction): @@ -319,8 +325,8 @@ class AllowChessMove(LocationAction): class AllowChessMoveIfMSB(LocationAction): TEXT = ( - "Clear {MSB} and move like a %(chesspiece_name)s for one turn if it " - "was set.") + "If {MSB} is set, unset {MSB} and move like a " + "%(chesspiece_name)s for one turn. Otherwise do nothing.") MSB_GLYPH = ACTION_GLYPHS.MOVEMENT def perform_action(self, board, location):