changeset 95:0f437e0584f7

Add mission for taking over the world.
author Simon Cross <hodgestar@gmail.com>
date Wed, 09 May 2012 21:26:30 +0200
parents 245ef50de84d
children 50f8476aa929
files gamelib/missions.py
diffstat 1 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/missions.py	Wed May 09 21:22:10 2012 +0200
+++ b/gamelib/missions.py	Wed May 09 21:26:30 2012 +0200
@@ -3,7 +3,7 @@
 
 from random import randint
 
-from gamelib.constants import SUCCESS, FAILURE
+from gamelib.constants import SUCCESS, FAILURE, GAME_WIN
 from gamelib.schematics import cat
 
 
@@ -302,3 +302,29 @@
             return Result(SUCCESS, 0, rep, self.SUCCESS_MESSAGE % (result,))
         else:
             return self.attempt_no_equipment(state)
+
+
+class TakeOverTheWorld(Mission):
+
+    NAME = "Take over the world!"
+    SHORT_DESCRIPTION = "It's for their own good."
+    LONG_DESCRIPTION = (
+        "Someone has to rule the world and if it's not you it'd just be"
+        " someone less well qualified -- and that would be worse for"
+        " everyone.")
+    MINIMUM_REPUTATION = 200
+
+    SUCCESS_MESSAGE = (
+        "A small army of urchins delivers thousands of cheaply printed"
+        " pamphlets. %s")
+
+    def attempt_no_equipment(self, state):
+        return Result(FAILURE, 0, 0, "It's going to take more than your bare"
+                      " hands to take over the world!")
+
+    def attempt_with(self, categorised, state):
+        if cat.MIND_CONTROL not in categorised:
+            return Result(FAILURE, 0, 5, "If you're going to take over the"
+                          " first you must control key elements within the"
+                          " populace.")
+        return Result(GAME_WIN, 0, 100, "The world is yours!")