Mercurial > sypikslang
changeset 207:ed25c335fd67
Per-turn income
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 12 May 2012 19:50:53 +0200 |
parents | 2b8b6c9b71eb |
children | f9426f6cebf4 |
files | gamelib/gamestate.py gamelib/missions.py |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gamestate.py Sat May 12 19:14:22 2012 +0200 +++ b/gamelib/gamestate.py Sat May 12 19:50:53 2012 +0200 @@ -20,6 +20,7 @@ self.points = 0 self.reputation = 0 self.turn = 0 + self.income = 0 # Missions being attempted self.cur_missions = [] # Science allocation for the current turn @@ -39,6 +40,7 @@ self.points += 1 + M_VALS[self.milestone] * 2 self.minions += 1 + M_VALS[self.milestone] * 2 self.turn += 1 + self.money += self.income self.cur_missions = [] self.cur_allocation = [] # Suggest research @@ -74,13 +76,15 @@ return self.points - len(self.cur_allocation) def apply_mission_special(self, new_milestone=None, new_schematic=None, - new_science=None): + new_science=None, income=None): if new_milestone: self.milestone = new_milestone if new_schematic: self.lab.steal_science(new_schematic) if new_science: self.lab.steal_science(new_science) + if income: + self.income += income def end_turn(self): # Attempt the missions @@ -120,6 +124,7 @@ data['points'] = self.points data['lab'] = self.lab.save_data() data['turn'] = self.turn + data['income'] = self.income # Save mission state data['missions'] = {} for mission in self.missions: @@ -134,6 +139,7 @@ self.reputation = data['reputation'] self.points = data['points'] self.turn = data['turn'] + self.income = data['income'] self.milestone = data['milestone'] self.lab = lab.Lab(data['lab']) for mis_class in missions.Mission.__subclasses__():
--- a/gamelib/missions.py Sat May 12 19:14:22 2012 +0200 +++ b/gamelib/missions.py Sat May 12 19:50:53 2012 +0200 @@ -450,7 +450,7 @@ " still, but you're finally out of that pokey basement and" " have some elbow room to work with. Next step: the city!", money=randint(1000, 2000), rep=randint(5, 15), - new_milestone="neighbourhood") + new_milestone="neighbourhood", income=100) if cat.HAND_WEAPON in categorised: self.succeed( @@ -489,7 +489,7 @@ " for you. The city cowers before you, and you finally" " feel like you're getting somewhere. Soon, the world will" " be yours.", money=randint(10000, 20000), - rep=randint(10, 20), new_milestone='city') + rep=randint(10, 20), new_milestone='city', income=1000) if cat.AI in categorised: self.use_equipment_category(categorised, cat.AI)