changeset 35:2754c453b39b

Topple a government.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 06 May 2012 21:56:21 +0200
parents 20ed2843adec
children efc4f90cfd63 9c4bf1f15431
files gamelib/missions.py
diffstat 1 files changed, 32 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/missions.py	Sun May 06 21:40:13 2012 +0200
+++ b/gamelib/missions.py	Sun May 06 21:56:21 2012 +0200
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4
 
-from products import HAND_WEAPON, PATHOGEN, DOOMSDAY_DEVICE
+from products import HAND_WEAPON, VEHICLE, PATHOGEN, DOOMSDAY_DEVICE
 
 MAJOR_SETBACK, FAILURE, SUCCESS, MAJOR_SUCCESS, GAME_WIN = range(5)
 
@@ -112,6 +112,36 @@
         return Result(FAILURE, 0, reputation, "\n".join(failures))
 
 
+class ToppleThirdWorldGovernment(Mission):
+
+    NAME = "Topple a third-world government"
+    SHORT_DESCRIPTION = "We could use a more amenable despot there"
+    LONG_DESCRIPTION = (
+        "It's a small and fairly useless country, but it's still an actual"
+        " government that can be toppled. A good test bed for some of the"
+        " larger toys in the armory.")
+    MINIMUM_REPUTATION = 50
+
+    def attempt(self, equipment, state):
+        failures = []
+        if not equipment:
+            return Result(FAILURE, 0, 0, (
+                    "The border post may be poorly guarded, but you need to"
+                    " bring *some* kind of weaponry along. Your troops sulk"
+                    " on the way home."))
+        for item in equipment:
+            if any(item.is_a(cat) for cat in (VEHICLE, HAND_WEAPON)):
+                return Result(SUCCESS, 10000, 5, (
+                        "The corruption and oppression continue, but at least"
+                        " the proceeds are making their way into *your*"
+                        " pockets. And you don't even have to dirty your own"
+                        " jackboots."))
+            else:
+                failures.append("You fail to inspire fear with your %s"
+                        % item.NAME)
+        return Result(FAILURE, 0, 0, "\n".join(failures))
+
+
 class RobBank(Mission):
 
     NAME = "Rob the local bank"
@@ -143,7 +173,7 @@
                     " enough to inspire an impressive level of cooperation")
             else:
                 failures.append("You fail to inspire fear with your %s"
-                        % item.name)
+                        % item.NAME)
         return Result(FAILURE, 0, 0, "\n".join(failures))