changeset 247:594c45f0f685

Don't reward science or schematics when we know everything
author Neil Muller <drnlmuller@gmail.com>
date Sun, 13 May 2012 00:50:18 +0200
parents 235b1faf590e
children 8c237a830efe
files gamelib/missions.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/missions.py	Sun May 13 00:44:31 2012 +0200
+++ b/gamelib/missions.py	Sun May 13 00:50:18 2012 +0200
@@ -639,9 +639,14 @@
         " in the future.")
 
     def _succ(self, msg, state):
-        reward = choice(('schematic', 'science',
-            'money', 'money', 'money', 'money', 'money',
-            'nothing', 'nothing', 'nothing'))
+        possible_rewards = ['schematic', 'science']
+        possible_rewards.extend(['money'] * 5)
+        possible_rewards.extend(['nothing'] * 3)
+        if not state.lab.new_research:
+            possible_rewards.remove('science')
+        if not state.lab.new_schematics:
+            possible_rewards.remove('schematic')
+        reward = choice(possible_rewards)
         if reward == 'nothing':
             self.succeed("%s Unfortunately, not only are these people working"
                 " on ideas you've already covered, they're flat broke." % msg,