Mercurial > sypikslang
diff gamelib/lab.py @ 36:efc4f90cfd63
Mission refactoring and research fix.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Mon, 07 May 2012 00:18:16 +0200 |
parents | 23720d0fd9a0 |
children | 1e8f7e694f0c |
line wrap: on
line diff
--- a/gamelib/lab.py Sun May 06 21:56:21 2012 +0200 +++ b/gamelib/lab.py Mon May 07 00:18:16 2012 +0200 @@ -100,7 +100,7 @@ total_points += my_science.points return total_points - base_points >= extra - def find_new_products(self, research_area): + def find_new_products(self): available_products = [] for product_class in self.new_products: if self.meet_requirements(product_class): @@ -115,7 +115,8 @@ return available_research def apply_area_research(self, research): - options = self.find_new_products(research) + options = [product for product in self.find_new_products() + if type(research) in [p[0] for p in product.PREREQUISITES]] breakthroughs = [product for product in options if random() < product.ACQUISITION_CHANCE] if breakthroughs: