diff gamelib/missions.py @ 198:df350c2f8c10

Add another mission
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 17:36:15 +0200
parents 75989ca906cd
children 6a4457b912a5
line wrap: on
line diff
--- a/gamelib/missions.py	Sat May 12 17:27:52 2012 +0200
+++ b/gamelib/missions.py	Sat May 12 17:36:15 2012 +0200
@@ -935,3 +935,63 @@
             self.succeed("The review board respond favourably to a little"
                     " light intidimation, and your paper is accepted.",
                     rep=randint(10, 15))
+
+
+class DisruptMarkets(Mission):
+    NAME = "Disrupt local enconomy"
+    SHORT_DESCRIPTION = "Creating chaos and fear."
+    LONG_DESCRIPTION = (
+        "People place far too much value on their money. This is a weakness"
+        " that just begs to be exploited. And, in the chaos and fear, "
+        " there's almost certainly and opportunity to profit.")
+    MINIMUM_MILESTONE = "neighbourhood"
+    MINIMUM_MONEY = 2000
+
+    NO_EQUIP_FAILURE = (
+        "You cannot beat the game just with your mind, doctor. You'll need"
+        " to have some extra toys")
+    GENERIC_FAILURE = (
+        "No-one notices your efforts. Back to the drawing board")
+
+    def can_attempt(self, state):
+        if state.money < self.MINIMUM_MONEY:
+            # You need to be in the game to cheat at it
+            return False
+        return super(DisruptMarkets, self).can_attempt(state)
+
+    def attempt_with(self, categorised, state):
+
+        if cat.DOOMSDAY_MACHINE in categorised:
+            return self.fail(
+                "While destroying the area is certainly within your"
+                " capabilities, and would cause wide-spread panic,"
+                " there seems little prospect of exploiting the"
+                " confusion usefully at this time. You decide to"
+                " shelve this plan for now.")
+
+        if cat.WEATHER_MACHINE in categorised:
+            self.use_equipment(
+                    {cat.WEATHER_MACHINE: categorised[cat.WEATHER_MACHINE]})
+            return 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))
+
+        if cat.AI in categorised:
+            self.use_equipment(
+                    {cat.AI: categorised[cat.AI]})
+            return self.succeed(
+                "You easily survert the local exchanges computer systems."
+                " It hardly seems fair to profit off such a trivial challenge"
+                " but there are always bills to pay",
+                money=randint(5000, 10000), rep=randint(2, 5))
+
+        if cat.BEAST in categorised:
+            self.use_equipment(
+                    {cat.BEAST: categorised[cat.BEAST]})
+            return self.succeed(
+                "Releasing the monster into the exchange certainly created"
+                " a stir, and the 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))