Mercurial > sypikslang
view gamelib/products.py @ 7:eadc5c19d665
.hgignore
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 06 May 2012 12:51:13 +0200 |
parents | 826b44731323 |
children | 9d61abb3cfaf |
line wrap: on
line source
from gamelib import research class Product(object): NAME = None PREREQUISITES = () ACQUISITION_CHANCE = 0.8 def __init__(self): self.points = 0 def spend_points(self, points): self.points += points class MachineGun(Product): NAME = "Machine gun" class TeslaGun(Product): NAME = "Tesla gun" PREREQUISITES = ( (research.Tesla, 1), ) class DoomsdayVirus(Product): NAME = "Doomsday virus" PREREQUISITES = ( (research.BioGenetics, 5), )