diff gamelib/gamestate.py @ 33:12c33aac7684

Gate certain missions by reputation.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 06 May 2012 21:27:33 +0200
parents 4d9610c59efa
children e285b1e31a08
line wrap: on
line diff
--- a/gamelib/gamestate.py	Sun May 06 20:57:04 2012 +0200
+++ b/gamelib/gamestate.py	Sun May 06 21:27:33 2012 +0200
@@ -39,6 +39,13 @@
                 if isinstance(x, products.Product) and x.COST <= self.money]
         return available
 
+    def get_available_missions(self):
+        """Return a list of missions we can feasibly attempt"""
+        available = [x for x in self.missions
+                     if (x.MINIMUM_REPUTATION is None
+                         or x.MINIMUM_REPUTATION <= self.reputation)]
+        return available
+
     def end_turn(self):
         # Attempt the missions
         mission_results = []