# HG changeset patch # User Jeremy Thurgood # Date 1336334181 -7200 # Node ID 2754c453b39b80e0f3d3c28e1ca8599cb836495a # Parent 20ed2843adec17bdd335df9d1553b2e8d8f7924a Topple a government. diff -r 20ed2843adec -r 2754c453b39b gamelib/missions.py --- 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))