changeset 180:8868ac7ece8b

Tweak steal research mission
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 12:28:39 +0200
parents 71db080a1fbf
children 07e81cd0cdd6
files gamelib/missions.py
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/missions.py	Sat May 12 11:46:08 2012 +0200
+++ b/gamelib/missions.py	Sat May 12 12:28:39 2012 +0200
@@ -571,28 +571,28 @@
         " fool invests in some defenses. You'll need to be better prepared"
         " in the future.")
 
-    def succeed(self, msg, state):
+    def _succ(self, msg, state):
         reward = choice(('schematic', 'science',
             'money', 'money', 'money', 'money', 'money',
             'nothing', 'nothing', 'nothing'))
         if reward == 'nothing':
-            msg = msg + (" Unfortunately, not only are these people working"
-                    " on ideas you've already covered, they're flat broke.")
-            raise Result(SUCCESS, msg, money=0, rep=1)
+            self.succeed("%s Unfortunately, not only are these people working"
+                " on ideas you've already covered, they're flat broke." % msg,
+                money=0, rep=1)
         elif reward == 'money':
-            msg = msg + (" While their research yields nothing of interest,"
-                    " you can repurpose their funding to more worthy causes.")
-            raise Result(SUCCESS, msg, money=randint(1000, 2000), rep=1)
+            self.succeed("%s While their research yields nothing of interest,"
+                " you can repurpose their funding to more worthy causes."
+                % msg, money=randint(1000, 2000), rep=1)
         elif reward == 'schematic':
-            msg = msg + (" You find the plans for a new device. How did"
-                 " these fools stumble upon this?")
-            raise Result(SUCCESS, msg, money=0, rep=randint(2, 5),
-                    new_schematic=choice(state.lab.new_schematics))
+            self.succeed("%s You find the plans for a new device. How did"
+                 " these fools stumble upon this?" % msg,
+                 money=0, rep=randint(2, 5),
+                 new_schematic=choice(state.lab.new_schematics))
         # New science
-        msg = msg + (" Their notes are most illuminating. You realise you have"
-                " sadly neglected research into this field.")
-        raise Result(SUCCESS, msg, money=0, rep=randint(2, 5),
-                    new_science=choice(state.lab.new_research))
+        self.succeed("%s Their notes are most illuminating. You realise you"
+            " have sadly neglected research into this field." % msg,
+            money=0, rep=randint(2, 5),
+            new_science=choice(state.lab.new_research))
 
     def attempt_with(self, categorised, state):
 
@@ -604,11 +604,11 @@
                 " total destruction of the lab will not help you cause.")
 
         if cat.AI in categorised:
-            self.succeed("Your AI easily takes control of the lab's network.",
+            self._succ("Your AI easily takes control of the lab's network.",
                 state)
 
         if self.combat_power(categorised) > randint(20, 40):
-            self.succeed(
+            self._succ(
                 "The resistance is stiff, but your forces prevail"
                 " thanks to your superior technology.", state)
         else: