diff gamelib/missions.py @ 203:4159e34d7310

Replace the mayor
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 18:17:53 +0200
parents 6a4457b912a5
children d8b0f07a6dbe
line wrap: on
line diff
--- a/gamelib/missions.py	Sat May 12 17:56:49 2012 +0200
+++ b/gamelib/missions.py	Sat May 12 18:17:53 2012 +0200
@@ -972,7 +972,7 @@
         if cat.WEATHER_MACHINE in categorised:
             self.use_equipment(
                     {cat.WEATHER_MACHINE: categorised[cat.WEATHER_MACHINE]})
-            return self.succeed(
+            self.succeed(
                 "You cunningly use your device to disrupt the nearby farmers."
                 " The ensuing panic buyng of supplies is easy to exploit for"
                 " profit.", money=randint(5000, 10000), rep=randint(5, 15))
@@ -980,7 +980,7 @@
         if cat.AI in categorised:
             self.use_equipment(
                     {cat.AI: categorised[cat.AI]})
-            return self.succeed(
+            self.succeed(
                 "You easily survert the local exchange's computer systems."
                 " It hardly seems fair to profit off such a trivial challenge"
                 " but there are always bills to pay",
@@ -989,9 +989,47 @@
         if cat.BEAST in categorised:
             self.use_equipment(
                     {cat.BEAST: categorised[cat.BEAST]})
-            return self.succeed(
+            self.succeed(
                 "Releasing the monster into the exchange certainly created"
                 " a stir, and there was much running and screaming, but, with"
                 " the exchange closing it's doors until the creature was"
                 " contained, there wasn't much opportunity to make a profit.",
                 money=0, rep=randint(2, 5))
+
+
+class ControlMayor(Mission):
+    NAME = "Control the Mayor"
+    SHORT_DESCRIPTION = "Minions in high places."
+    LONG_DESCRIPTION = (
+        "While the mayor powers are limited, it's a step towards controlling"
+        " the entire city")
+    MINIMUM_MILESTONE = "neighbourhood"
+
+    def attempt_with(self, categorised, state):
+        if cat.CLONE in categorised:
+            self.use_equipment(
+                    {cat.CLONE: categorised[cat.CLONE]})
+            self.data['completed'] = True
+            self.succeed(
+                "Replacing the mayor with a copy under your control. Such"
+                " a genius scheme could only come from a brain as brillant"
+                " as yours.", rep=randint(10, 15))
+        if cat.MIND_CONTROL in categorised:
+            self.use_equipment(
+                    {cat.MIND_CONTROL: categorised[cat.CLONE]})
+            self.data['completed'] = True
+            self.succeed(
+                "Mind control. It's hardly a novel approach to the problem"
+                " but who can argue with the results.", rep=randint(7, 15))
+
+        if cat.HAND_WEAPONS in categorised:
+            self.fail(
+                "Brute force. It seems such a crude approach. You decide"
+                " this is unworthy of you and abandon the plan.")
+
+        if cat.BEAST in categorised:
+            self.fail(
+                "In retrospect, unleashing a monster into the downtown streets"
+                " was a great way to cause panic, but not a reliable method"
+                " for securing the loyalties of the mayor. You return to"
+                " the drawing board")