# HG changeset patch # User Neil Muller # Date 1336836975 -7200 # Node ID df350c2f8c106e84b2668f63e801d5c038be51dc # Parent 108806a1d6f9fa12463668349ddfed09a26c6895 Add another mission diff -r 108806a1d6f9 -r df350c2f8c10 gamelib/missions.py --- 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)) diff -r 108806a1d6f9 -r df350c2f8c10 gamelib/schematics.py --- a/gamelib/schematics.py Sat May 12 17:27:52 2012 +0200 +++ b/gamelib/schematics.py Sat May 12 17:36:15 2012 +0200 @@ -21,6 +21,7 @@ 'AI', 'COUNTERMEASURE', 'SPACE', + 'WEATHER_MACHINE', ) K = 1000 @@ -216,7 +217,7 @@ class TornadoMachine(Schematic): NAME = "tornado machine" COST = 7 * K - CATEGORIES = (cat.VEHICLE,) + CATEGORIES = (cat.VEHICLE, cat.WEATHER_MACHINE) PREREQUISITES = ( (research.Meteorology, 6), (research.Physics, 5), @@ -365,7 +366,7 @@ class WeatherControlStation(Schematic): NAME = "weather control station" COST = 15 * M - CATEGORIES = (cat.DOOMSDAY_DEVICE, cat.SPACE) + CATEGORIES = (cat.DOOMSDAY_DEVICE, cat.SPACE, cat.WEATHER_MACHINE) PREREQUISITES = ( (SpySatellite, 3), (research.Lasers, 5),