Make action.MSB_GLYPH a function, action.get_msb_glyph.
[naja.git] / naja / actions.py
index 2407d829b59155b4077d7f56e5d4e171c9bfb646..d5e2b37227b0fb22f3ad512b6381e9537d43b4c3 100644 (file)
@@ -16,6 +16,12 @@ class LocationAction(object):
         self.required_bits = required_bits
         self.data = data
 
+    def get_glyphs(self):
+        return self.GLYPHS
+
+    def get_msb_glyph(self):
+        return self.MSB_GLYPH
+
     def get_text(self, location=None):
         substitutions = self.data.copy()
 
@@ -130,6 +136,8 @@ class GenericBits(LocationAction):
         bits.clear_bits(self.clear_bits)
 
     def get_text(self, location=None):
+        if 'message' in self.data:
+            return super(GenericBits, self).get_text()
         parts = []
         for template, bits in [
                 ('Set %s.', self.set_bits), ('Clear %s.', self.clear_bits),
@@ -173,6 +181,8 @@ class AcquireWinToken(LocationAction):
         board.player.bits.clear_bits(set([
             BITS.RED, BITS.GREEN, BITS.BLUE,
         ]))
+        if self.data.get('once', False):
+            location.actions.remove(self)
 
 
 class GainHealth(LocationAction):