comparison gamelib/missions.py @ 32:00aff02bc6fc

Product categories.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 06 May 2012 20:57:04 +0200
parents 27570aca5d17
children 12c33aac7684
comparison
equal deleted inserted replaced
31:51ff46f42ed2 32:00aff02bc6fc
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4 2 # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4
3 3
4 from products import DoomsdayVirus, MachineGun, LightningGun 4 from products import DoomsdayVirus, HAND_WEAPON
5 5
6 MAJOR_SETBACK, FAILURE, SUCCESS, MAJOR_SUCCESS, GAME_WIN = range(5) 6 MAJOR_SETBACK, FAILURE, SUCCESS, MAJOR_SUCCESS, GAME_WIN = range(5)
7 7
8 8
9 class Result(object): 9 class Result(object):
56 NAME = "Rob kids in the playground" 56 NAME = "Rob kids in the playground"
57 SHORT_DESCRIPTION = "Steal from those significantly weaker than yourself" 57 SHORT_DESCRIPTION = "Steal from those significantly weaker than yourself"
58 LONG_DESCRIPTION = ("It's not menancing, or lucrative, but when the bills" 58 LONG_DESCRIPTION = ("It's not menancing, or lucrative, but when the bills"
59 " are due, no one cares how you earn the money") 59 " are due, no one cares how you earn the money")
60 60
61 def attempt(sefl, equipment, state): 61 def attempt(self, equipment, state):
62 return Result(SUCCESS, 100, -1, "You devote your resources to" 62 return Result(SUCCESS, 100, -1, "You devote your resources to"
63 " robbing kids in a playpark. It's not the finest moment" 63 " robbing kids in a playpark. It's not the finest moment"
64 " in your reign of terror, but at least you walked away" 64 " in your reign of terror, but at least you walked away"
65 " with a surprising amount of small change.") 65 " with a surprising amount of small change.")
66 66
128 " trivial") 128 " trivial")
129 else: 129 else:
130 return Result(SUCCESS, 1000, 0, "Holding up a bank with" 130 return Result(SUCCESS, 1000, 0, "Holding up a bank with"
131 " only a small vial of clear liquid. Now that" 131 " only a small vial of clear liquid. Now that"
132 " is power.") 132 " is power.")
133 elif isinstance(item, (MachineGun, LightningGun)): 133 elif HAND_WEAPON in item.CATEGORIES:
134 return Result(SUCCESS, 1000, 0, "The threat of your weapons is" 134 return Result(SUCCESS, 1000, 0, "The threat of your weapons is"
135 " enough to inspire an impressive level of cooperation") 135 " enough to inspire an impressive level of cooperation")
136 else: 136 else:
137 failures.append("You fail to inspire fear with your %s" 137 failures.append("You fail to inspire fear with your %s"
138 % item.name) 138 % item.name)