comparison gamelib/missions.py @ 209:5ca97ed09738

rat mission
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 19:52:29 +0200
parents ed25c335fd67
children 53e78cddb9a4
comparison
equal deleted inserted replaced
208:f9426f6cebf4 209:5ca97ed09738
3 3
4 from random import randint, random, choice 4 from random import randint, random, choice
5 5
6 from gamelib.constants import SUCCESS, FAILURE, GAME_WIN, M_VALS 6 from gamelib.constants import SUCCESS, FAILURE, GAME_WIN, M_VALS
7 from gamelib.schematics import cat 7 from gamelib.schematics import cat
8 from gamelib.research import Biogenetics
8 9
9 10
10 class Result(Exception): 11 class Result(Exception):
11 """Results of a mission. 12 """Results of a mission.
12 13
1084 if cat.HAND_WEAPON in categorised: 1085 if cat.HAND_WEAPON in categorised:
1085 self.fail( 1086 self.fail(
1086 "You want to be known as more than just a local gangster." 1087 "You want to be known as more than just a local gangster."
1087 " Guns are an efficient tool, but hardly the means to" 1088 " Guns are an efficient tool, but hardly the means to"
1088 " securing your reputation.") 1089 " securing your reputation.")
1090
1091
1092 class RatArmy(Mission):
1093 NAME = "Breed Rat Burglars"
1094 SHORT_DESCRIPTION = "Your furry money source"
1095 LONG_DESCRIPTION = (
1096 "Small and easy to breed. An army of rat burgulars will provide"
1097 " a useful supply of steady income")
1098
1099 def can_attempt(self, state):
1100 if self.get_data('completed'):
1101 return False
1102 if state.lab.meet_requirements(Biogenetics, 1):
1103 return True
1104 return False
1105
1106 def attempt_no_equipment(self, state):
1107 self.data['completed'] = True
1108 self.succeed(
1109 "You breed an army of small rats, engineered to steal small"
1110 " change. The resulting income is not much, but still useful",
1111 money=0, rep=0, income=randint(10, 15))
1112
1113 def attempt_with(self, categorised, state):
1114 self.fail(
1115 "You're overthinking this doctor. Perhaps a simpler approach"
1116 " will work better?")